This is the source code for the graph-based discrete geodesic algorithms in the following paper:
Fast Construction of Discrete Geodesic Graphs
YOHANES YUDHI ADIKUSUMA, ZHENG FANG, and YING HE, Nanyang Technological University
ACM Trans. Graph., Vol. 39, No. 2, Article 14, Publication date: March 2020.
It was based on the implementation available in this repository, made by the paper authors, but it was refactored to run on linux based systems.
-
Enter the
src/directory. -
To compile the geodesic graph pre computing module, use the command:
make DGG_Precompute
-
To compile the shortest path module, use the command:
make DGG_Solution
-
To generate the geodesic graph, use the command:
./DGG_Precompute [method] [model] [accuracy_control_parameter] [number_of_threads]
- method:
'f'for FastDGG or's'for SVG - model:
.obj/.offformat mesh file - accuracy_control_parameter: an expected relative mean error
ε('0.01'representsε= 1%) - number_of_threads: using multiple threads to accelerate the process
Example:
./DGG_Precompute f meshes/spot_mini.obj 0.01 8 - method:
-
To generate the geodesic distances, use the command:
DGG_Solution [method] [model] [graph_binary_file] [source] [output_distance_file]
- method:
'SSAD'for single-source-all-destination or'MSAD'for multiple-source-all-destination - model:
.obj/.offformat mesh file - graph_binary_file: the precomputed geodesic graph in
.binaryformat - source: 0-based source
vertex idfor single source or sourcefile namefor multiple sources - output_distance_file: a file saving the distance field
Example:
./DGG_Solution SSAD meshes/spot_mini.obj meshes/spot_mini_FD0.0100000000_c5.binary 0 distances.txt - method:
You can visualize the geodesic distances with the python script meshes/plot_mesh.py.