The intersect function computes the first intersection of a ray with geometry.
Another closer look into one of the vex functions that you can use in Houdini. This is a very useful one - allowing you to test your geometry for collisions, finding distances between objects and gives you access to the result of that test.
Attached you find the hip file for this function.
It will be available as an early access for all patrons for one week before it goes public
Cheers
Dave