Skip to content

Commit b45b9f7

Browse files
committed
fix bug in mesh.from_points related to delaunay triangulation
1 parent dc6f2de commit b45b9f7

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4141

4242
### Changed
4343

44+
* Fixed bug (inconsistency) in return value of `compas.geometry.triangulation_delaunay.delaunay_triangulation`. Only the faces of the triangulation should be returned.
45+
4446
### Removed
4547

4648
* Removed property `is_compound` from `compas.geometry.Brep` as OCC specific.

src/compas/datastructures/mesh/mesh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ def from_points(cls, points): # type: (...) -> Mesh
576576
"""
577577
from compas.geometry import delaunay_triangulation
578578

579-
vertices, faces = delaunay_triangulation(points)
580-
return cls.from_vertices_and_faces(vertices, faces)
579+
faces = delaunay_triangulation(points)
580+
return cls.from_vertices_and_faces(points, faces)
581581

582582
@classmethod
583583
def from_polygons(cls, polygons, precision=None): # type: (...) -> Mesh

src/compas/geometry/triangulation_delaunay.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ def delaunay_triangulation(points):
1212
1313
Returns
1414
-------
15-
(list, list)
16-
The vertices of the triangulation, and the faces of the triangulation.
15+
list[list[int]]
16+
The faces of the triangulation.
1717
1818
Examples
1919
--------
@@ -25,7 +25,7 @@ def delaunay_triangulation(points):
2525

2626
xyz = asarray(points)
2727
d = Delaunay(xyz[:, 0:2])
28-
return xyz, d.simplices
28+
return d.simplices
2929

3030

3131
delaunay_triangulation.__pluggable__ = True

0 commit comments

Comments
 (0)