()
| 20 | return parser.parse_args(); |
| 21 | |
| 22 | def 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 | |
| 38 | if __name__ == "__main__": |
| 39 | main(); |
no test coverage detected