Reputation: 1
I want to use scipy.spatial.delaunay get the triangle mesh from the 3d point cloud. And i use trimesh to save the triangle mesh as .ply form. But the result seems bad. All points play roles as vertices, so it works slowly and bad... how can i get a better mesh output with this delaunay method?
Code:
#pcd is 3d point cloud
tri = Delaunay(pcd)
#faces
f = tri.simplices
# Mesh
mesh = trimesh.Trimesh(vertices=pos_combine, faces=f)
# show mesh and export it
mesh.show()
mesh.export(file_obj="mesh.ply")
Upvotes: 0
Views: 1431
Reputation: 58791
I write meshio for this. Just do
import meshio
meshio.Mesh(pcd, {"triangles": tri.simplices}).write("out.ply")
should do the job.
Upvotes: -1