Say I have a navigation mesh in 3d space, which for simplicity's sake consists of only triangle polygons. Say the mesh is not coplanar. To construct a path we can use midpoints of edges between triangles. If we were to stop the path construction here, the character would always walk along the mesh surface when moving between two path points. However the path typically needs to be optimized to remove redundant points with ex simple stupid funnel algorithm. The issue is that all the information I could find about this algorithm seems to describe it only for two dimensional navigation meshes or for 3d navigation meshes projected onto top down view. The path points then seem to be optimized away based solely on calculating determinants in 2d space.
Now say we optimized away a point. And say the mesh is not coplanar between those two points. The character then is not moving along the mesh surface from one point to another. How does one handle this problem?