intersect VEX function
This function computes the intersection of the specified ray with the geometry.
Contexts: image3d, chop, cop, pop, sop, surface, displace, fog, light, shadow, photon, cvex

int intersect(string filename, vector orig, vector dir, vector p&, float u&, float v&)
This function computes the intersection of the specified ray with the geometry. The primitive number is returned, or 1 if there is an error. The world position of the intersection location is stored in p. The corresponding parametric location of the intersection is stored in u, v. In the case of multiple intersections, the intersection closest to the ray origin is used.
When intersections are performed against metaball geometry, it is impossible to determine the primitive number of the metaball which was hit. In this case, the function returns the number of primitives in the intersection geometry.