Get the intersections point between Mesh/Ray

Hello,
I’m trying to do a component in C++ that gets the intersection point(s) between a Mesh and a Ray. I’m using (Intersection.MeshRay Method (Mesh, Ray3d, Int32[])) but this only gives me if there is an intersection and the face_indices.
How do I get the intersection points? Thank you.

Return Value
Type: Double 
>= 0.0 parameter along ray if successful. < 0.0 if no intersection found.

That method returns a Double, which you can use in Ray3d.PointAt to get the Point

(also note that MeshRay only returns the parameter for the first intersection. If you want to find all intersections you could use MeshLine or MeshLineSorted instead)

Thank you Daniel!

1 Like