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 (np.ndarray) – 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 (np.ndarray) – 2 element array of the lower and upper bounds of the box in the x direction
[xmin, xmax]ylim (np.ndarray) – 2 element array of the lower and upper bounds of the box in the y direction
[ymin, ymax]zlim (np.ndarray) – 2 element array of the lower and upper bounds of the box in the z direction
[zmin, zmax]TriNormal (np.ndarray, optional) – Triangle normal vector, by default None. Will be computed if not provided.
BoxCenter (np.ndarray, 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: