I think you can make a graph of the entire surface and have your algorithm "walk" over it. Your planes would be hugging the surface but it would be the shortest. You could fix the hugging by a local upward translation on the plane.
If you have a weird maze-like structure, you might want to "cross the gaps", so you need to adapt the algorithm to be able to cross air gaps, you could do this by just iterating all triangles and connecting them to all other triangles (thus creating a graph). Of course, you can't pass through the walls, so you need to take into account the surface normals. If you construct the lines between two surfaces, and you compare the surface normals to the direction of that line, it can tell you whether you are going through the surface (forbidden) or away from it (crossing air gaps). If the 2 surfaces are direct neighbors you don't need to do the line-normal check, and you can assume your algorithm can walk from one triangle to the other.
Most 3d model files reuse the same vertices for multiple triangles so it's easy to check whether they are neighbors: just check if they have vertices in common.
Once you have constructed the final graph, you can just use a pathfinding algorithm to find the shortest path to traverse the graph.