-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate from compas_view2 to compas_viewer #5
Migrate from compas_view2 to compas_viewer #5
Conversation
compas_view2 is deprecated and is no longer supported with newer compas versions, which makes cra viewer inoperable
@tomvanmele could you take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally LGTM, just a few small comments...
class Arrow: | ||
def __init__(self, position=[0, 0, 0], direction=[0, 0, 1], linewidth=0.02): | ||
super().__init__() | ||
self.position = Vector(*position) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not make this a point?
Vector(*self.direction), | ||
anchor=Point(*self.position), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.direction
is already a Vector
. why the conversion?
same for self.position
(if you change self.position = Point(*position)
)
viewer.add( | ||
Collection(blocks), | ||
viewer.scene.add( | ||
blocks, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just FYI, groups and collections are not exactly the same. collections are a bit faster once the viewer is running. groups provide logical grouping in the scene tree.
if we are concerned about speed, we could consider switching to BufferGeometry
, but this can be done ina separate PR...
from compas_viewer.config import Config | ||
|
||
|
||
class Arrow: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could make an actual arrow object for compas_viewer
as well, but this will work for now...
env_osx.yml
Outdated
- compas_view2 | ||
- ipopt | ||
- compas_viewer | ||
- ipopt ==3.14.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure about this version? i have 3.14.9
locally...
@andrusha i have updated the envs in the repo because the builds were failing. perhaps you can resubmit with those envs... |
ideally we can update the solvers to more recent versions, but this will require some testing |
@andrusha please add yourself to the list of contributors... |
Thanks! Appreciate the merge. My goal was to make it at least work with the examples to unblock a friend of mine, who would like to try this library out. So I didn't know how to make it proper. Another thing I've noticed is that JSON format is not longer compatible with the latest compas, but I couldn't find an easy fix for it. |
i've fixed the JSON files. on my computer (OSX) all examples work. a few things are still remaining:
will try to fix those later this week. |
btw, if you are on windows or linux, please let me know if there are still problems... |
@petrasvestartas could you test this on your machine? |
compas_view2
is deprecated and is no longer supported with newer compas versions, which makes cra viewer inoperable.What type of change is this?
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.CHANGELOG.md
file in theUnreleased
section under the most fitting heading (e.g.Added
,Changed
,Removed
).invoke test
).invoke lint
).compas.datastructures.Mesh
.