Code covered by the BSD License  

Highlights from
Exact geodesic for triangular meshes

image thumbnail
from Exact geodesic for triangular meshes by Danil Kirsanov
Geodesic (shortest path) algorithm for triangular mesh (triangulated 2D surface in 3D).

geodesic_trace_back(algorithm, destination)
function path = geodesic_trace_back(algorithm, destination)

global geodesic_library;

tmp{1} = destination;
d = geodesic_convert_surface_points(tmp);

tmp = libpointer('doublePtrPtr');
[path_length, tmp, path_double] = calllib(geodesic_library, 'trace_back', algorithm.id, d, tmp);

setdatatype(path_double, 'doublePtr', path_length*5);
path = geodesic_convert_surface_points(path_double.Value);

Contact us at files@mathworks.com