I have a 3D non-degenerate triangle, with a front and back determined by vertex winding. This triangle, together with a depth d, describes a right triangular prism* (the back of the triangle is "inside", and the other triangular face is defined implicitly).
Given a fourth point, I need to check if that point is within the prism, and, if so, find the closest point to it on the surface of the given triangular face.
Notes:
- This question is similar, but not quite what I want.
- *not necessarily with a right triangular face.