intersection_ray_mesh
- intersection_ray_mesh(ray, M)[source]
Compute the intersection(s) between a ray and a mesh.
- Parameters:
- raytuple[list[float], list[float]]
A ray 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[tuple[int, float, float, float]]
The array contains a tuple per intersection of the ray with the mesh. Each tuple contains:
the index of the intersected face
the u coordinate of the intersection in the barycentric coordinates of the face
the u coordinate of the intersection in the barycentric coordinates of the face
the distance between the ray origin and the hit