xyzdist
expression function
Returns the distance between a 3D coordinate and a primitive.
See also: primdist, nearpoint, pointdist
Usage
xyzdist(x, y, z, surface_node, prim_num, return_type)
If the prim_num is -1, finds the closest distance to any primitive in the surface node.
-
return_type = 0 returns the minimum distance.
-
return_type = 1 returns the u parametric value at the point of minimum distance.
-
return_type = 2 returns the v parametric value at the point of minimum distance.
-
return_type = 3 returns the primitive number that was closest.
Examples
xyzdist(1, 2, 3, "/obj/geo1/grid1", 0, 0)
Returns the distance between (1, 2, 3) and the closest spot from the surface of grid1 primitive number 0. If the return_type were 1, the u parametric value that is closest to the point would be returned.