MCPcopy Create free account
hub / github.com/cdcseacave/openMVS / extract_mesh_dense

Function extract_mesh_dense

scripts/python/MvsPointCloud2TSDF.py:228–242  ·  view source on GitHub ↗
(sdf_grid, min_bound, voxel_size, output_file)

Source from the content-addressed store, hash-verified

226 return sdf_grid, min_bound, voxel_size
227
228def extract_mesh_dense(sdf_grid, min_bound, voxel_size, output_file):
229 print("Running Marching Cubes on dense grid...")
230 try:
231 verts, faces, normals, values = marching_cubes(sdf_grid, level=0.0, spacing=(voxel_size, voxel_size, voxel_size))
232
233 # Transform vertices back to world space
234 verts += min_bound
235
236 print(f"Saving mesh to {output_file}...")
237 save_ply(output_file, verts, faces, normals)
238
239 except ValueError as e:
240 print(f"Marching Cubes failed: {e}")
241 except RuntimeError as e:
242 print(f"Marching Cubes failed: {e}")
243
244def extract_mesh(tsdf_vol, min_bound, voxel_size, output_file):
245 if not tsdf_vol:

Callers 1

mainFunction · 0.85

Calls 2

printFunction · 0.85
save_plyFunction · 0.85

Tested by

no test coverage detected