Skip to content

Commit e8b5de8

Browse files
committed
Merge branch 'main' into occ-nurbs
2 parents b06702b + e80f3db commit e8b5de8

File tree

3 files changed

+39
-5
lines changed

3 files changed

+39
-5
lines changed

CHANGELOG.md

Lines changed: 4 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
* Added `compas.geometry.Curve` and `compas.geometry.NurbsCurve`.
1314
* Added `compas.geometry.Surface` and `compas.geometry.NurbsSurface`.
@@ -16,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1617

1718
### Changed
1819

20+
* Fixed bug in directions of `compas.datastructures.Mesh.from_meshgrid`.
21+
1922
### Removed
2023

2124

@@ -26,7 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2629
### Changed
2730

2831
* Changed default path for Rhino 7 legacy install cleanup to Rhino7.app in `compas_rhino.__init__.py`.
29-
* Changed z-coordinate of `compas.datastructures.Mesh.from_meshgrid` to `0.0` instead of `0`.
32+
* Changed z-coordinate of `compas.datastructures.Mesh.from_meshgrid` to `0.0` instead of `0`.
3033

3134
### Removed
3235

src/compas/datastructures/mesh/mesh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,14 +639,14 @@ def from_meshgrid(cls, dx, nx, dy=None, ny=None):
639639
dy = dy or dx
640640
ny = ny or nx
641641

642-
V, U = meshgrid(linspace(0, dx, nx + 1), linspace(0, dy, ny + 1), indexing='ij')
642+
U, V = meshgrid(linspace(0, dx, nx + 1), linspace(0, dy, ny + 1), indexing='ij')
643643

644644
quads = [[
645645
[U[i + 0][j + 0], V[i + 0][j + 0], 0.0],
646646
[U[i + 0][j + 1], V[i + 0][j + 1], 0.0],
647647
[U[i + 1][j + 1], V[i + 1][j + 1], 0.0],
648648
[U[i + 1][j + 0], V[i + 1][j + 0], 0.0]
649-
] for i, j in product(range(ny), range(nx))]
649+
] for i, j in product(range(nx), range(ny))]
650650

651651
return cls.from_polygons(quads)
652652

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)