Code covered by the BSD License  

Highlights from
Exact geodesic for triangular meshes

4.25

4.2 | 4 ratings Rate this file 34 Downloads (last 30 days) File Size: 300.75 KB File ID: #18168
image thumbnail

Exact geodesic for triangular meshes

by Danil Kirsanov

 

31 Dec 2007 (Updated 03 Mar 2008)

Geodesic (shortest path) algorithm for triangular mesh (triangulated 2D surface in 3D).

| Watch this File

File Information
Description

This is an implementation of exact geodesic algorithm for triangular mesh (first described by Mitchell, Mount and Papadimitriou in 1987) with some minor improvements, extensions and simplifications. The algorithm has O(n^2 \log n) worst-case time complexity, but in practice can work with million-node meshes in reasonable time. For the quick overview, see J. O'Rourke, "Computational Geometry Column 35", SIGACT News, 30(2) Issue #111.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (13)
05 Jan 2008 Danil Kirsanov

C++ code could be downloaded from
http://code.google.com/p/geodesic/downloads/list

28 Feb 2008 Jeff Jiang

It looks a very nice contribution. I just tried examples, but it failed with long error message from mathwork basically saying "Segmentation violation detected ..."

29 Feb 2008 Danil Kirsanov

yeap, my code has an issue with matlab 2007b. I am currently testing the fix, so let me know if you need it immediately.

07 Jul 2008 Gwenael Birot

Thanks for this nice contribution. It works perfectly. I built the linux 32 and 64 bits shared library geodesic_matlab_api from the c++ code. It would be great to add them in this contribution...

09 Dec 2008 Paolo de Leva

Good job. Contains five detailedly commented examples. Works perfectly after bug fixes (3 Mar 2008).

17 Jun 2009 RENOO Laborbe

I am trying to run this code on linux 64bits. How did you compile the code geodesic_matlab_api ? I haven't see any makefile in the source code directory.
Thank you

23 Jun 2009 Danil Kirsanov

I did not test the library on linux at all, but if I understand it correctly (and I might be wrong), you need to install BOOST, and create a shared library from geodesic_matlab_api.cpp.
Watch out for the compiler messages though -- from what I see now, you might have to put -1.0 instead of -1 on line 167 of geodesic_matlab_api.cpp for this file to work correctly.

26 Oct 2009 Hassan Radvar-Esfahlan

Hi Danil and thanks for sharing this code. Actually i use Matlab (R2009a). for example 1 this error occured:
??? Error using ==> calllib
Pointer type must match data type

Error in ==> geodesic_distance_and_source at 19
    [num_vertices, d, s] = calllib(geodesic_library, 'distance_and_source_for_all_vertices',
    algorithm.id, tmp, tmp1);

Error in ==> example1 at 26
[source_id, distances] = geodesic_distance_and_source(algorithm);
approximately the same errors for example 3 and 5 but works very nice for examples 2 and 4.

25 Apr 2010 fraisa1985 Youssef

hello,
please how i can use this implementtation to find the geodesic distance between two points for 3D face with triangular mesh

27 Sep 2010 David

Segmentation violation error occurs when applied to some tri-mesh. This error is usually caused by memory leakage, it would be a nice contribution if the error can be fixed.

17 Jul 2011 carmi

Thanks for the submit - to fix the "Pointer type must match data type", change int32PtrPtr to longPtrPtr in line 17 of file "geodesic_distance_and_source.m".

14 Nov 2011 dai zhengguo

carmi, thanks for your note

07 Feb 2012 nicodhidt

Thanks for the code. I have problems trying to run it under Win7 64 bits with a 64bits Matlab version also. It says "Microsoft Visual C++ 2005 or 2008 is required to use this feature." While loading a library. I've installed the runtime libraries from visual studio but it didn't work. Any idea?

Please login to add a comment or rating.
Updates
04 Jan 2008

minor changes in readme file

03 Mar 2008

- fixed libpointer conflict with matlab 2007b
- fixed cellfun error with earlier versions of matlab

Tag Activity for this File
Tag Applied By Date/Time
geodesic Danil Kirsanov 22 Oct 2008 09:41:02
shortest path Danil Kirsanov 22 Oct 2008 09:41:02
triangular mesh Danil Kirsanov 22 Oct 2008 09:41:02
mathematics Danil Kirsanov 22 Oct 2008 09:41:02
geodesic Jayani Amarathunga 29 Nov 2010 20:18:28
shortest path Jayani Amarathunga 30 Nov 2010 00:56:59
geodesic shu 31 Dec 2011 07:53:49

Contact us at files@mathworks.com