Open s-leger opened 4 years ago
Very good new ! thanks Stephen for sharing this !
Hi Stephen, did you try this function? any snippet ? can't get it to works, got an obscure TypeError.
# What output looks like.
# 0 => triangles with convex hull.
# 1 => triangles inside constraints.
# 2 => the input constraints, intersected.
# 3 => like 2 but with extra edges to make valid BMesh faces.
from mathutils.geometry import delaunay_2d_cdt
import random
# shuffle verts
random.shuffle(verts)
v2d = [v.to_2d() for v in verts]
overts, edges, faces, orig_verts, orig_edges, orig_faces = \
delaunay_2d_cdt(v2d, [], [], 0, 0.00001)
# Note: verts indices may change to integer instead of list with single item
verts = [verts[i[0]] for i in orig_verts]
Many thanks, finally I made it work but I don't really understand the output type : 0 works as expected 1 return only a set of points 2 and 3 cause a seg fault
yep doc still spare, must ask howardt for exact meaning of arguments
TODO add option for constrained triangulation (if I can get it to work!)
Hi just want to share a great news, Howardt pushed constrained delaunay triangulation in 2.80 daily ! https://docs.blender.org/api/blender2.8/mathutils.geometry.html#mathutils.geometry.delaunay_2d_cdt