mymesh.rays.TrianglesTrianglesIntersection#
- mymesh.rays.TrianglesTrianglesIntersection(Tri1s, Tri2s, eps=1e-14, edgeedge=False)[source]#
Vectorized intersection test for two sets of triangles.
Möller, T. (1997). Fast triangle-triangle intersection test. Journal of Graphics Tools, 2(2), 25-30. https://doi.org/10.1080/10867651.1997.10487472 [Moller97]
- Parameters:
Tri1s (array_like) – Coordinates of triangle vertices for each triangle in the format
np.array([[[a, b, c], [d, e, f], [g, h, i]], [[...],[...],[...]], ...)
. Should have shape (n,3,3) for n triangles.Tri2s (array_like) – Coordinates of triangle vertices for each triangle in the format
np.array([[[a, b, c], [d, e, f], [g, h, i]], [[...],[...],[...]], ...)
. Should have shape (n,3,3) for n triangles.eps (float, optional) – Small parameter used to determine if a value is sufficiently close to 0, by default 1e-14
edgeedge (bool, optional) – If
edgeedge
is true, two triangles that meet exactly at the edges will be counted as an intersection, by default False. This inclues two adjacent triangles that share an edge, but also cases where two points of Tri1 lie exactly on the edges of Tri2.
- Returns:
Intersections – Array of bools for each pair of triangles. True if there is an intersection, otherwise False.
- Return type:
np.ndarray