11import numpy as np
2+ from compas .plugins import plugin
23from compas_cgal ._cgal import triangulations
34
45
5- def delaunay_triangulation (vertices ):
6- """Construct a Delaunay triangulation.
6+ @plugin (category = "traingulation" , requires = ['compas_cgal' ])
7+ def delaunay_triangulation (points ):
8+ """Construct a Delaunay triangulation from a set of points.
79
810 Parameters
911 ----------
10- vertices : list of :class:`compas.geometry.Point`
11- Vertices of the triangulation.
12+ points : list of :class:`compas.geometry.Point`
13+ Points of the triangulation.
1214
1315 Returns
1416 -------
@@ -20,10 +22,11 @@ def delaunay_triangulation(vertices):
2022 ...
2123
2224 """
23- vertices = np .asarray (vertices , dtype = np .float64 )
25+ vertices = np .asarray (points , dtype = np .float64 )
2426 return triangulations .delaunay_triangulation (vertices )
2527
2628
29+ @plugin (category = 'triangulation' , requires = ['compas_cgal' ])
2730def constrained_delaunay_triangulation (boundary , points = None , holes = None , curves = None ):
2831 """Construct a Constrained Delaunay triangulation.
2932
@@ -66,6 +69,7 @@ def constrained_delaunay_triangulation(boundary, points=None, holes=None, curves
6669 return triangulations .constrained_delaunay_triangulation (boundary , points , holes , curves , is_conforming = False )
6770
6871
72+ @plugin (category = 'triangulation' , requires = ['compas_cgal' ])
6973def conforming_delaunay_triangulation (boundary , points = None , holes = None , curves = None ):
7074 """Construct a Conforming Delaunay triangulation.
7175
@@ -109,7 +113,7 @@ def conforming_delaunay_triangulation(boundary, points=None, holes=None, curves=
109113
110114
111115def refined_delaunay_mesh (boundary , points = None , holes = None , curves = None , maxlength = None , is_optimized = False ):
112- """Construct a refined Delaunay mesh.
116+ """Construct a refined Delaunay mesh [1]_ .
113117
114118 Parameters
115119 ----------
@@ -131,9 +135,9 @@ def refined_delaunay_mesh(boundary, points=None, holes=None, curves=None, maxlen
131135 list
132136 The vertices and faces of the triangulation.
133137
134- Notes
135- -----
136- ...
138+ References
139+ ----------
140+ .. [1] https://doc.cgal.org/latest/Mesh_2/index.html#secMesh_2_meshes
137141
138142 """
139143 boundary = np .asarray (boundary , dtype = np .float64 )
0 commit comments