Skip to content

Commit e80f3db

Browse files
authored
Merge pull request #921 from juney-lee/main
Add abstract methods to `compas_rhino.artists.volmeshartist`.
2 parents cdda2a9 + 10732a8 commit e80f3db

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## Unreleased
99

1010
### Added
11+
* Add abstract methods to `compas_rhino.artists.volmeshartist`.
1112

1213
### Changed
1314

@@ -23,7 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2324
### Changed
2425

2526
* Changed default path for Rhino 7 legacy install cleanup to Rhino7.app in `compas_rhino.__init__.py`.
26-
* Changed z-coordinate of `compas.datastructures.Mesh.from_meshgrid` to `0.0` instead of `0`.
27+
* Changed z-coordinate of `compas.datastructures.Mesh.from_meshgrid` to `0.0` instead of `0`.
2728

2829
### Removed
2930

src/compas_rhino/artists/volmeshartist.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,42 @@ class VolMeshArtist(RhinoArtist, VolMeshArtist):
2828
def __init__(self, volmesh, layer=None, **kwargs):
2929
super(VolMeshArtist, self).__init__(volmesh=volmesh, layer=layer, **kwargs)
3030

31-
def clear_by_name(self):
32-
"""Clear all objects in the "namespace" of the associated volmesh."""
31+
# ==========================================================================
32+
# clear
33+
# ==========================================================================
34+
35+
def clear(self):
3336
guids = compas_rhino.get_objects(name="{}.*".format(self.volmesh.name))
3437
compas_rhino.delete_objects(guids, purge=True)
3538

39+
def clear_vertices(self):
40+
guids = compas_rhino.get_objects(name="{}.vertex.*".format(self.volmesh.name))
41+
compas_rhino.delete_objects(guids, purge=True)
42+
43+
def clear_edges(self):
44+
guids = compas_rhino.get_objects(name="{}.edge.*".format(self.volmesh.name))
45+
compas_rhino.delete_objects(guids, purge=True)
46+
47+
def clear_faces(self):
48+
guids = compas_rhino.get_objects(name="{}.face.*".format(self.volmesh.name))
49+
compas_rhino.delete_objects(guids, purge=True)
50+
51+
def clear_cells(self):
52+
guids = compas_rhino.get_objects(name="{}.cell.*".format(self.volmesh.name))
53+
compas_rhino.delete_objects(guids, purge=True)
54+
55+
def clear_vertexlabels(self):
56+
guids = compas_rhino.get_objects(name="{}.vertexlabel.*".format(self.volmesh.name))
57+
compas_rhino.delete_objects(guids, purge=True)
58+
59+
def clear_edgelabels(self):
60+
guids = compas_rhino.get_objects(name="{}.edgelabel.*".format(self.volmesh.name))
61+
compas_rhino.delete_objects(guids, purge=True)
62+
63+
def clear_facelabels(self):
64+
guids = compas_rhino.get_objects(name="{}.facelabel.*".format(self.volmesh.name))
65+
compas_rhino.delete_objects(guids, purge=True)
66+
3667
# ==========================================================================
3768
# draw
3869
# ==========================================================================

0 commit comments

Comments
 (0)