Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Changed directory where ghuser components are installed.
* Added ghuser components directory to those removed by the `clean` task.
* Clean up the ghuser directory before building ghuser components.
* Fixed bug in `compas.geometry.distance.closest_point_on_segment_xy`
* Fixed bug in `compas.geometry.distance.closest_point_on_segment_xy`.
* Fixed bug in Rhino implementations of `trimesh` curvature functions.

### Removed

Expand Down
27 changes: 12 additions & 15 deletions src/compas_rhino/geometry/trimesh/curvature.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ def trimesh_gaussian_curvature(M):
# (0) see if input is already Rhino.Geometry.Mesh
mesh = Rhino.Geometry.Mesh()
if not isinstance(M, Rhino.Geometry.Mesh):
for vertices, faces in M:
for x, y, z in vertices:
mesh.Vertices.Add(x, y, z)
for face in faces:
mesh.Faces.AddFace(*face)
for x, y, z in M[0]:
mesh.Vertices.Add(x, y, z)
for face in M[1]:
mesh.Faces.AddFace(*face)
else:
mesh = M

Expand Down Expand Up @@ -170,11 +169,10 @@ def trimesh_mean_curvature(M):
# (0) see if input is already Rhino.Geometry.Mesh
mesh = Rhino.Geometry.Mesh()
if not isinstance(M, Rhino.Geometry.Mesh):
for vertices, faces in M:
for x, y, z in vertices:
mesh.Vertices.Add(x, y, z)
for face in faces:
mesh.Faces.AddFace(*face)
for x, y, z in M[0]:
mesh.Vertices.Add(x, y, z)
for face in M[1]:
mesh.Faces.AddFace(*face)
else:
mesh = M

Expand Down Expand Up @@ -275,11 +273,10 @@ def trimesh_principal_curvature(M):
# (0) see if input is already Rhino.Geometry.Mesh
mesh = Rhino.Geometry.Mesh()
if not isinstance(M, Rhino.Geometry.Mesh):
for vertices, faces in M:
for x, y, z in vertices:
mesh.Vertices.Add(x, y, z)
for face in faces:
mesh.Faces.AddFace(*face)
for x, y, z in M[0]:
mesh.Vertices.Add(x, y, z)
for face in M[1]:
mesh.Faces.AddFace(*face)
else:
mesh = M

Expand Down