MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / main

Function main

scripts/point_cloud.py:22–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20 return parser.parse_args();
21
22def main():
23 args = parse_args();
24 in_mesh = load_mesh(args.input_mesh);
25 in_mesh.add_attribute("vertex_normal");
26 v_normals = in_mesh.get_vertex_attribute("vertex_normal");
27
28 out_mesh = form_mesh(in_mesh.vertices, np.zeros((0, 3), dtype=int));
29 out_mesh.add_attribute("nx");
30 out_mesh.add_attribute("ny");
31 out_mesh.add_attribute("nz");
32 out_mesh.set_attribute("nx", v_normals[:,0].ravel());
33 out_mesh.set_attribute("ny", v_normals[:,1].ravel());
34 out_mesh.set_attribute("nz", v_normals[:,2].ravel());
35
36 save_mesh(args.output_mesh, out_mesh, "nx", "ny", "nz");
37
38if __name__ == "__main__":
39 main();

Callers 1

point_cloud.pyFile · 0.70

Calls 7

load_meshFunction · 0.90
form_meshFunction · 0.90
save_meshFunction · 0.90
get_vertex_attributeMethod · 0.80
parse_argsFunction · 0.70
add_attributeMethod · 0.45
set_attributeMethod · 0.45

Tested by

no test coverage detected