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

Function main

scripts/map_to_sphere.py:101–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99 return pymesh.form_mesh(out_vertices, np.zeros((0, 3)), mesh.voxels);
100
101def main():
102 args = parse_args();
103 basename, ext = os.path.splitext(args.output_mesh);
104
105 mesh = pymesh.load_mesh(args.input_mesh);
106 mesh = generate_tet_mesh(mesh);
107 pymesh.save_mesh("{}_source.msh".format(basename), mesh);
108
109 bd_vertex_indices, bd_vertex_positions = map_boundary_to_sphere(
110 mesh, basename);
111 out_mesh = tutte_3D(mesh, bd_vertex_indices, bd_vertex_positions);
112
113 tet_orientations = pymesh.get_tet_orientations(out_mesh);
114 out_mesh.add_attribute("orientation");
115 out_mesh.set_attribute("orientation", tet_orientations);
116 pymesh.save_mesh(args.output_mesh, out_mesh, "orientation");
117
118if __name__ == "__main__":
119 main();

Callers 1

map_to_sphere.pyFile · 0.70

Calls 9

generate_tet_meshFunction · 0.85
map_boundary_to_sphereFunction · 0.85
tutte_3DFunction · 0.85
get_tet_orientationsMethod · 0.80
parse_argsFunction · 0.70
load_meshMethod · 0.45
save_meshMethod · 0.45
add_attributeMethod · 0.45
set_attributeMethod · 0.45

Tested by

no test coverage detected