Create is_watertight.py
This commit is contained in:
13
hy3dshape/tools/evaluation/is_watertight.py
Normal file
13
hy3dshape/tools/evaluation/is_watertight.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import igl # pip install libigl
|
||||
import numpy as np
|
||||
import trimesh
|
||||
|
||||
mesh_file = 'your_mesh.glb'
|
||||
mesh = trimesh.load(mesh_file, force='mesh', process=False)
|
||||
F = np.asarray(mesh.faces)
|
||||
bnd_loops = igl.boundary_loop(F)
|
||||
|
||||
if len(bnd_loops) == 0 and igl.is_edge_manifold(F) and igl.is_vertex_manifold(F).all():
|
||||
print("判断网格是水密的封闭流形")
|
||||
else:
|
||||
print("非水密网格")
|
||||
Reference in New Issue
Block a user