intersection_rays_mesh

intersection_rays_mesh(rays, M)[source]

Compute the intersection(s) between multiple rays and a mesh.

Parameters:
rayslist[tuple[list[float], list[float]]]

List of rays, each represented by a point and a direction vector.

Mtuple[list[list[float]], list[list[int]]]

A mesh represented by a tuple of (vertices, faces) where vertices are 3D points and faces are triangles

Returns:
list[list[tuple[int, float, float, float]]]

List of intersection results, one per ray. Each intersection result contains tuples with:

  1. the index of the intersected face

  2. the u coordinate of the intersection in the barycentric coordinates of the face

  3. the u coordinate of the intersection in the barycentric coordinates of the face

  4. the distance between the ray origin and the hit