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

Function main

scripts/highlight_delaunay.py:16–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14 return parser.parse_args();
15
16def main():
17 args = parse_args();
18 mesh = pymesh.load_mesh(args.input_mesh);
19 delaunay = pymesh.is_delaunay(mesh);
20 mesh.add_attribute("delaunay");
21 mesh.set_attribute("delaunay", delaunay);
22
23 strictly_delaunay = np.count_nonzero(delaunay > 0);
24 cospherical = np.count_nonzero(delaunay == 0);
25 not_delaunay = np.count_nonzero(delaunay < 0);
26
27 print("Strictly Delaunay: {:10} ({:>6.3%})".format(strictly_delaunay,
28 float(strictly_delaunay) / mesh.num_voxels));
29 print(" Cospherical: {:10} ({:>6.3%})".format(cospherical,
30 float(cospherical) / mesh.num_voxels));
31 print(" Not Delaunay: {:10} ({:>6.3%})".format(not_delaunay,
32 float(not_delaunay) / mesh.num_voxels));
33
34 pymesh.save_mesh(args.output_mesh, mesh, "delaunay");
35
36if __name__ == "__main__":
37 main();

Callers 1

Calls 6

is_delaunayMethod · 0.80
parse_argsFunction · 0.70
load_meshMethod · 0.45
add_attributeMethod · 0.45
set_attributeMethod · 0.45
save_meshMethod · 0.45

Tested by

no test coverage detected