Original Post
I''m attempting to find the shortest distance from any point on a vector to any point on a triangle in 3D space. I''ve tried a couple methods and haven''t had much luck. I tried finding the shortest distance from a vector to the plane the triangle was on, but that only gave me the shortest distance if that point was inside the triangle. There are also several cases which look differently. For example, one case is if the vector and the triangle intersect. Another case is if the vector intersects the plane the triangle is on but not the triangle. Also, there''s the case where the vector is on the same plane as the triangle, and there''s one case where the vector is on a plane which is parallel to the triangle''s plane. If multiple points on the vector are the same shortest distance from the triangle (from the last two cases), then I need the first point. That is, if I have a vector from point A to point B, then the first point on the vector that is the shortest distance from the vector to the triangle.