# Algorithm - True shortest path for triangulated 3d-surface

I need to find true shortest path between two points. true means that shortest path can be laid both through the vertices, and through the edges.

### Input

• Set of triangles, given by coordinates of 3D-points.
• Source and target points.

### Output

• Sequence of 3D-points representing a true shortest path from source to target.

I found video with visualization here. But I couldn't find ready algorithm, so I tried to create my own. Please make my algorithm review and let me know whether it is correct or it has issues. Also I will be gratefull if you have ready algorithm.

### My algorighm

1. Find the shortest path via only vertices (E.g. by Dijkstra).
2. Get triangles (faces) that go along the path. In the next steps we will consider vertices that belong only to these triangles.
3. Find another vertices that can lie on true shortest path but are not known vertices. These are the points that are placed on edges.

foreach startVertex in vertices
{
foreach finishVertex in vertices
{
// Create line segment between two vertices.
lineSegment = ToLineSegment(startVertex, finishVertex);

// Make lineSegement-projection on edges.
// Return points that are the intersection of the projection and the edges.