mymesh.rays.RayBoxIntersection#

mymesh.rays.RayBoxIntersection(pt, ray, xlim, ylim, zlim)[source]#

Intersection algorithm for detecting intersections between a ray and an axis-aligned box. Williams, A., Barrus, S., Morley, R. K., & Shirley, P. (2005). An efficient and robust ray-box intersection algorithm. ACM SIGGRAPH 2005 Courses, SIGGRAPH 2005, 10(1), 55-60. https://www.doi.org/10.1145/1198555.1198748 [WBMS05]

Parameters:
  • pt (array_like) – 3D coordinates for the starting point of the ray.

  • ray (array_like) – 3D vector of ray direction. This should, in general, be a unit vector.

  • xlim (array_like) – Two element list, array, or tuple with the upper and lower x-direction bounds for an axis-aligned box.

  • ylim (array_like) – Two element list, array, or tuple with the upper and lower y-direction bounds for an axis-aligned box.

  • zlim (array_like) – Two element list, array, or tuple with the upper and lower z-direction bounds for an axis-aligned box.

Returns:

intersection – True if there is an intersection between the ray and the box, otherwise False.

Return type:

bool