Skip to content

Commit 90be9b9

Browse files
committed
add option to not toggle visibility of polygon face
1 parent 91f5b93 commit 90be9b9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/compas_rhino/artists/polygonartist.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class PolygonArtist(PrimitiveArtist):
4646
4747
"""
4848

49-
def draw(self, show_points=False, show_edges=False):
49+
def draw(self, show_points=False, show_edges=False, show_face=True):
5050
"""Draw the polygon.
5151
5252
Parameters
@@ -55,6 +55,8 @@ def draw(self, show_points=False, show_edges=False):
5555
Default is ``False``.
5656
show_edges : bool, optional
5757
Default is ``False``.
58+
show_face : bool, optional
59+
Default is ``True``.
5860
5961
Returns
6062
-------
@@ -69,8 +71,9 @@ def draw(self, show_points=False, show_edges=False):
6971
if show_edges:
7072
lines = [{'start': list(a), 'end': list(b), 'color': self.color, 'name': self.name} for a, b in self.primitive.lines]
7173
guids += compas_rhino.draw_lines(lines, layer=self.layer, clear=False, redraw=False)
72-
polygons = [{'points': _points, 'color': self.color, 'name': self.name}]
73-
guids += compas_rhino.draw_faces(polygons, layer=self.layer, clear=False, redraw=False)
74+
if show_face:
75+
polygons = [{'points': _points, 'color': self.color, 'name': self.name}]
76+
guids += compas_rhino.draw_faces(polygons, layer=self.layer, clear=False, redraw=False)
7477
self._guids = guids
7578
return guids
7679

0 commit comments

Comments
 (0)