-
Notifications
You must be signed in to change notification settings - Fork 113
Update compas_rhino artists #642
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
Conversation
adding draw_collection to box artist
|
i just updated |
|
just a few points for discussion:
|
gonzalocasas
left a comment
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.
Please add a line to CHANGELOG.
Otherwise it LGTM!
About your questions: boxes are always closed, right? so I'd tend to assume it would display it as one mesh rather than individual faces, but I realize the usage and assumptions on this point changes a lot between teams, so maybe add the join_faces option like the MeshArtist has.
Regarding collection functions, having functional parity between single entity and collection would be nice (ie. the same show_* params on both ideally)
|
the reason behind the simplified functionality for the |
update log
Ah! Understood. I personally have never used these |
| points = [{'pos': point, 'color': self.color} for point in vertices] | ||
| guids += compas_rhino.draw_points(points, layer=self.layer, clear=False, redraw=False) | ||
| if show_edges: | ||
| raise NotImplementedError |
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.
i have left this open for now. the capsule doesn't actually have any edges. they could be generated to be able to visualize the wireframe. in general, the question is what the most relevant information is. i would argue that even showing the vertices is questionable...
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.
Leaving this as an exception permanently results in kind of a strange user experience though. I would tend toward letting the user decide if he wants to see edges and vertices, even if it doesn't make sense. I find pretty senselessness preferable to runtime errors. But if you do choose to leave it this way, please mention in the documentation that it's not implemented.
| @line.setter | ||
| def line(self, line): | ||
| self._line = line | ||
| self._line = Line(*line) |
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.
while fixing this, i noticed that the capsule has a very different logic than for example the box. it doesn't have a local frame and is defined directly through a line defined by two points. perhaps that should become an alternative constructor. the default, like with the box, should accept a frame and the parameters that define the capsule in that frame. ideally this is the default for all shapes: a frame and parameters. alternative constructors allow to use direct geometrical inputs, but would then have to compute a frame from those internally...
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.
the suggestion makes sense to me
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.
will submit a proposal for this via a different PR
| return guids | ||
|
|
||
| @staticmethod | ||
| def draw_collection(collection, |
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.
the collection methods offer very little advantage over the individual draw methods. since static methods are somewhat frowned upon anyway, perhaps the collection methods are not really necessary...
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.
i tend to agree. it seems that really the only added functionality of draw_collection is the grouping, and it seems like that function should be pulled out, perhaps as a static method to the BaseArtist or maybe somewhere else. it seems reasonable that one may want to group objects of mixed type, ie a box and a mesh or two.
src/compas/geometry/shapes/cone.py
Outdated
| @circle.setter | ||
| def circle(self, circle): | ||
| self._circle = circle | ||
| self._circle = Circle(*circle) |
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.
while fixing this bug, i noticed that the cone does not have a bottom face. should it?
Co-authored-by: beverlylytle <57254617+beverlylytle@users.noreply.github.com>
|
@gonzalocasas this thing is final now, so please let me know if it can be merged... |
adding draw_collection to box artist
What type of change is this?
Checklist
Put an
xin 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.mdfile in theUnreleasedsection under the most fitting heading (e.g.Added,Changed,Removed).invoke test).invoke lint).compas.datastructures.Mesh.