Intro
Say I have a 3D point, a normal and a triangle mesh of a tetraeder:
pt = np.array([0,0,0.5])
normal = np.array([1,1,0])
vertices_tetr = np.array([0,0,0],[0,1,1],[1,0,1],[1,1,0])
faces_tetr = np.array([0,1,2],[0,2,3],[0,1,3],[1,2,3])
Link to .ply file of tetraeder can be found here.
Question
What would be a good method to project the 3D point to the mesh along the given normal?
Additional info
Efficiency is appreciated if the solution is not too complicated. If there's a good library for this then that's also an option.
Extra clarification: I am not looking for the closest point of the mesh, but really the projection of the 3D point on one of the faces of the mesh along the given normal.Thus as shown in the picture below with p, the original point, n the normal and p', the projected point.