-
Notifications
You must be signed in to change notification settings - Fork 108
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
Artist refactoring #1175
Artist refactoring #1175
Conversation
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.
It's a pretty large PR, so my review is rather superficial, but besides a bunch of minor comments, I don't see any big issues, LGTM!
from compas.geometry import NurbsCurve | ||
from compas.artists import Artist | ||
|
||
Artist.clear() | ||
|
||
curve = NurbsCurve.from_points([[0, 0, 0], [3, 3, 6], [6, -3, -3], [9, 0, 0]]) | ||
|
||
artist = Artist(curve) | ||
artist.color = (0.0, 1.0, 0.0) | ||
artist.draw() | ||
|
||
Artist.redraw() |
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.
❤️
artist.draw_vertices() | ||
artist.draw_edges() | ||
artist.draw_faces(color={face: Color.pink() for face in mesh.face_sample(size=17)}) | ||
#artist.draw_vertexnormals() |
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.
#artist.draw_vertexnormals() |
delete?
|
||
point = Point(0, 0, 0) | ||
artist = Artist(point) | ||
# artist.color = (0.0, 1.0, 0.0) |
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.
# artist.color = (0.0, 1.0, 0.0) |
delete? or uncomment?
# artist.color = (0.0, 1.0, 0.0) | ||
|
||
# for i in range(11): | ||
# artist.draw( | ||
# color=Color.from_i(i / 10), | ||
# point=[i, 0, 0], | ||
# show_point=True | ||
# ) | ||
|
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.
same, delete or uncomment?
src/compas/artists/artist.py
Outdated
# if not self._transformation: | ||
# if hasattr(self._item, "transformation"): | ||
# self._transformation = self._item.transformation |
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.
# if not self._transformation: | |
# if hasattr(self._item, "transformation"): | |
# self._transformation = self._item.transformation |
delete?
from .color import Color | ||
|
||
|
||
class ColorDict(Data): |
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.
is it worth it to inherit from UserDict
instead of implementing our own dict logic? Not a lot, but it would shave off a few lines of code that can be used directly from that class
@@ -282,7 +282,7 @@ def from_three_colors(cls, c1, c2, c3): | |||
return cls(colors) | |||
|
|||
@classmethod | |||
def from_rgb(cls): | |||
def from_rgb(cls, n=256): |
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.
Add n
to the docstrings, please
Co-authored-by: Gonzalo Casas <[email protected]>
The goal is to simplify working with artists and to make the use of colors more transparent...
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
.