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_delete(object)
% delete mesh, algorithm, or everything at once
% Danil Kirsanov, 09/2007 

function object = geodesic_delete(object)

global geodesic_library;
if ~libisloaded(geodesic_library)       %everything is already cleared
    object = [];
    return;
end

if nargin == 0          % the simplest way to delete everything is to unload the library
   unloadlibrary(geodesic_library);
else
    if libisloaded(geodesic_library)
        if strcmp(object.object_type, 'mesh')       
            calllib(geodesic_library, 'delete_mesh', object.id);      % delete mesh and corresponding algorithms
        else                                        
            calllib(geodesic_library, 'delete_algorithm', object.id); % delete a single algorithm
        end
    end
end
object = [];

Contact us at files@mathworks.com