Skip to content

Commit 44e54e0

Browse files
committed
add option to not show vertices
1 parent 7a299c7 commit 44e54e0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/compas_rhino/artists/cylinderartist.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CylinderArtist(ShapeArtist):
2020
2121
"""
2222

23-
def draw(self, u=10):
23+
def draw(self, u=10, show_vertices=True):
2424
"""Draw the cylinder associated with the artist.
2525
2626
Parameters
@@ -36,9 +36,11 @@ def draw(self, u=10):
3636
"""
3737
vertices, faces = self.shape.to_vertices_and_faces(u=u)
3838
vertices = [list(vertex) for vertex in vertices]
39-
points = [{'pos': point, 'color': self.color} for point in vertices]
39+
guids = []
40+
if show_vertices:
41+
points = [{'pos': point, 'color': self.color} for point in vertices]
42+
guids += compas_rhino.draw_points(points, layer=self.layer, clear=False, redraw=False)
4043
polygons = [{'points': [vertices[index] for index in face], 'color': self.color} for face in faces]
41-
guids = compas_rhino.draw_points(points, layer=self.layer, clear=False, redraw=False)
4244
guids += compas_rhino.draw_faces(polygons, layer=self.layer, clear=False, redraw=False)
4345
self._guids = guids
4446
return guids

0 commit comments

Comments
 (0)