()
| 14 | return parser.parse_args(); |
| 15 | |
| 16 | def 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 | |
| 36 | if __name__ == "__main__": |
| 37 | main(); |
no test coverage detected