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

Function detect_self_intersection

python/pymesh/selfintersection.py:58–73  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

56 return output_mesh
57
58def 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

Callers 4

test_chainMethod · 0.90
assert_self_intersectMethod · 0.90
test_no_intersectionMethod · 0.90

Calls 3

SelfIntersectionMethod · 0.80

Tested by 4

test_chainMethod · 0.72
assert_self_intersectMethod · 0.72
test_no_intersectionMethod · 0.72