Find intersection of a line with the boundary of 3D object (point set)


I have two 2D waves, each with 3 columns (x, y, z coords). The first wave is a point set that defines the boundary to an object (irregular but approximately spherical). The second is two points that lie inside the object. What I would like to do is find the distance from each of these two points to the boundary, along the line defined by those two points. I can't figure out how to find the intersect between this line and the boundary defined by the point set. I know how to do this in 2D, but I am confused about the best approach in 3D. Any help appreciated!

Is the problem spherical enough that you could refer to the line-intersecting-sphere problem (e.g., There are also code solutions out there for this kind of problem. If you care for the irregular shape of the object, then one way of approaching this could be to rotate the whole thing until the line equals one of the principal axes (e.g., the x axis). Then the problem becomes 1D. Find the angle between your 'line' vector and the y- and z- axis, then apply the rotation to each of your object points via a common rotation matrix. I guess this is the brute-force method, but Igor can do this for you via MatrixOp. Finally, just find the nearest points on the x-axis (while y,z close to zero).

Rotating your coordinate system so the line becomes a principal axis, as chozo suggested, sounds like a pretty good idea.

Thank you both. I will try those approaches, starting with approximating to a sphere.

Just a reminder that Igor's BoundingBall operation can help you convert from a triplet wave to a bounding sphere (center and radius solutions).