簡體   English   中英

如何使用 python 導出 3d delaunay 三角形網格?

[英]How to export 3d delaunay triangle mesh with python?

我想使用 scipy.spatial.delaunay 從 3d 點雲中獲取三角形網格。 我使用 trimesh 將三角形網格保存為.ply 形式。 但結果似乎很糟糕。 所有的點都扮演着頂點的角色,所以它工作緩慢而且很糟糕......我怎樣才能用這種 delaunay 方法獲得更好的網格 output?

代碼:

#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")

我為此寫了meshio 做就是了

import meshio

meshio.Mesh(pcd, {"triangles": tri.simplices}).write("out.ply")

應該做的工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM