Detect all self-intersections. Args: mesh (:class:`Mesh`): The input mesh. Returns: :py:class:`numpy.ndarray`: A n by 2 array of face indices. Each row contains the indices of two intersecting faces. :math:`n` is the number of intersecting face pairs.
(mesh)
| 56 | return output_mesh |
| 57 | |
| 58 | def detect_self_intersection(mesh): |
| 59 | """ Detect all self-intersections. |
| 60 | |
| 61 | Args: |
| 62 | mesh (:class:`Mesh`): The input mesh. |
| 63 | |
| 64 | Returns: |
| 65 | :py:class:`numpy.ndarray`: A n by 2 array of face indices. Each |
| 66 | row contains the indices of two intersecting faces. :math:`n` is |
| 67 | the number of intersecting face pairs. |
| 68 | """ |
| 69 | |
| 70 | detector = PyMesh.SelfIntersection(mesh.vertices, mesh.faces) |
| 71 | detector.detect_self_intersection() |
| 72 | intersecting_faces = detector.get_self_intersecting_pairs() |
| 73 | return intersecting_faces |