Hunyuan3D-2.2-mrp-MLX/hy3dshape/tools/evaluation/is_watertight.py
modelbeast e4cfa9d1e9 Clean MLX build for MODELBEAST (inference-only)
Fork of dgrauet/Hunyuan3D-2.1-mlx + our generate_e2e.py CLI, env-tunable
remesh (HY3D_REMESH_FACES), and HARDWARE.md. Upstream training data
(mini_trainset) and demo images stripped — inference needs none of it.
Full upstream history: github.com/dgrauet/Hunyuan3D-2.1-mlx
2026-07-16 14:38:14 +10:00

14 lines
389 B
Python

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("非水密网格")