mymesh.rays.TriangleBoxIntersection#

mymesh.rays.TriangleBoxIntersection(TriCoords, xlim, ylim, zlim, TriNormal=None, BoxCenter=None)[source]#

Intersection test for detecting intersections between a triangle and a box.

Akenine-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:
  • TriCoords (array_like) – Coordinates of the three vertices of the triangle in the format np.array([[a, b, c], [d, e, f], [g, h, i]])

  • 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