Query raycast intersections
Use the get_raycast_locations node to return the locations of the first intersections of rays with a mesh. You can then use the locations with the sample_property node to sample the values of properties such as position, color, surface normal, and so on.

In the example above, rays are cast from the ball's point positions along their normals. If the rays hit the plane, the interpolated vertex colors are sampled.
To find the locations of raycast intersections and sample values from them:
Add a
get_raycast_locationsnode to the graph.Connect the target object toward which you are casting rays into the
geometryinput.Connect the source positions from which the rays originate into the
positionsinput.Connect the matching directions along which to cast each ray into the
directionsinput.Specify the
proximity_method:semi-lineshoots an infinite ray along the direction vector.lineshoots infinite rays along both the positive and negative direction vectors.segmentshoots a ray along the direction vector but only as far as the vector's length. This allows for different distances for each ray, unlikecutoff_distance.
Set
use_cutoff_distanceandcutoff_distanceas desired. When used, only intersections that within the cutoff distance are returned. If you use a cutoff distance in addition to thesegmentmethod, the shorter distance is used for each ray individually.Set
min_distanceto a non-zero value if desired. This prevents returning locations that are too close to each position. It can be useful to avoid always returning the input position when casting rays from an object onto itself.Use the outputs of the
get_closest_locationsnode to sample the values of properties on the geometry:- You can connect the
locationsoutput into one or moresample_propertynodes to sample properties immediately (see Sample geo properties at locations). In these cases, you typically sample on the same geometry that is connected to theget_closest_locationsnode. - You can use the
foundoutput withifnodes to control what happens next in the graph on a per-ray basis, including whether or not to sample properties. - If the input positions correspond to the points of another geometric object, you can store the outputs as geo properties on that object to use them elsewhere (see Getting and setting properties of geometric objects). You can also cache them and use them for future frames in a simulation (see Create custom simulations).
- You can connect the

