()
| 15 | return parser.parse_args(); |
| 16 | |
| 17 | def main(): |
| 18 | args = parse_args(); |
| 19 | mesh = pymesh.load_mesh(args.input_mesh); |
| 20 | |
| 21 | intersecting_faces = pymesh.detect_self_intersection(mesh); |
| 22 | intersection_marker = np.zeros(mesh.num_faces); |
| 23 | for i,face_pair in enumerate(intersecting_faces): |
| 24 | intersection_marker[face_pair] = i+1; |
| 25 | |
| 26 | mesh.add_attribute("intersecting_faces"); |
| 27 | mesh.set_attribute("intersecting_faces", intersection_marker); |
| 28 | mesh.add_attribute("is_self_intersecting"); |
| 29 | mesh.set_attribute("is_self_intersecting", intersection_marker > 0); |
| 30 | pymesh.save_mesh(args.output_mesh, mesh, "intersecting_faces", |
| 31 | "is_self_intersecting"); |
| 32 | |
| 33 | if __name__ == "__main__": |
| 34 | main(); |
no test coverage detected