MCPcopy Index your code
hub / github.com/OpenMeshLab/MeshXL / process_mesh

Function process_mesh

eval_utils/sample_generation.py:13–24  ·  view source on GitHub ↗
(mesh_coords: Tensor, filename: str)

Source from the content-addressed store, hash-verified

11
12
13def process_mesh(mesh_coords: Tensor, filename: str):
14 mesh_coords = mesh_coords[~torch.isnan(mesh_coords[:, 0, 0])] # nvalid_face x 3 x 3
15 vertices = mesh_coords.reshape(-1, 3)
16 vertices_index = np.arange(len(vertices)) # 0, 1, ..., 3 x face
17 triangles = vertices_index.reshape(-1, 3)
18 write_ply(
19 np.asarray(vertices.cpu()),
20 None,
21 np.asarray(triangles),
22 filename
23 )
24 return vertices
25
26
27@torch.no_grad()

Callers 1

evaluateFunction · 0.85

Calls 1

write_plyFunction · 0.90

Tested by

no test coverage detected