mymesh.rays.BoxTrianglesIntersection#
- mymesh.rays.BoxTrianglesIntersection(Tris, xlim, ylim, zlim, TriNormals=None, BoxCenter=None)[source]#
Intersection test for detecting intersections between a triangle and a box. A vectorized version of
TriangleBoxIntersection()
for one box and multiple trianglesAkenine-Möller, T. (2005). Fast 3D triangle-box overlap testing. ACM SIGGRAPH 2005 Courses, SIGGRAPH 2005. https://doi.org/10.1145/1198555.1198747 [AMoller05]
- Parameters:
Tris (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.
xlim (array_like) – 2 element array of the lower and upper bounds of the box in the x direction
[xmin, xmax]
ylim (array_like) – 2 element array of the lower and upper bounds of the box in the y direction
[ymin, ymax]
zlim (array_like) – 2 element array of the lower and upper bounds of the box in the z direction
[zmin, zmax]
TriNormal (array_like, optional) – Triangle normal vector, by default None. Will be computed if not provided.
BoxCenter (array_like, optional) – Coordinates of the center of the box, by default None. Will be computed if not provided.
- Returns:
intersection – True if there is an intersection, otherwise False.
- Return type:
bool