I have been using scipy.spatial.Delaunay()
till now to perform Delaunay triangulations of point sets. However, this often leads to the creation of skinny triangles, which I am trying to avoid. I was told here that MeshPy
provides a wrapper to Shewchuk's Triangle
, which allows for the construction of high-quality, adjustable meshes.
However, I have been not been able to find any sample code for creating a Delaunay triangulation using Meshpy
, given only the nodes. The MeshPy
site gives this basic example in 3d:
from meshpy.tet import MeshInfo, build
mesh_info = MeshInfo()
mesh_info.set_points([
(0,0,0), (2,0,0), (2,2,0), (0,2,0),
(0,0,12), (2,0,12), (2,2,12), (0,2,12),
])
mesh_info.set_facets([
[0,1,2,3],
[4,5,6,7],
[0,4,5,1],
[1,5,6,2],
[2,6,7,3],
[3,7,4,0],
])
mesh = build(mesh_info)
But supplying facets (or triangles) by hand is precisely what I don't want to do.
Note: The website for Triangle
(http://www.cs.cmu.edu/~quake/triangle.delaunay.html) shows some quick code for Delaunay triangulation. But how would I do this in MeshPy
?