# Geodesic Mesh Processing¶


This tour explores geodesic computations on 3D meshes.

In [2]:
warning off


## Distance Computation on 3D Meshes¶

Using the fast marching on a triangulated surface, one can compute the distance from a set of input points. This function also returns the segmentation of the surface into geodesic Voronoi cells.

In [3]:
name = 'elephant-50kv';
nvert = size(vertex,2);


Starting points for the distance computation.

In [4]:
nstart = 15;
pstarts = floor(rand(nstart,1)*nvert)+1;
options.start_points = pstarts;


No end point for the propagation.

In [5]:
clear options;
options.end_points = [];


Use a uniform, constant, metric for the propagation.

In [6]:
options.W = ones(nvert,1);


Compute the distance using Fast Marching.

In [7]:
options.nb_iter_max = Inf;
[D,S,Q] = perform_fast_marching_mesh(vertex, faces, pstarts, options);


Display the distance on the 3D mesh.

In [8]:
clf;
plot_fast_marching_mesh(vertex,faces, D, [], options);


Extract precisely the voronoi regions, and display it.

In [9]:
[Qexact,DQ, voronoi_edges] = compute_voronoi_mesh(vertex, faces, pstarts, options);
options.voronoi_edges = voronoi_edges;
plot_fast_marching_mesh(vertex,faces, D, [], options);


Exercise 1

Using |options.nb_iter_max|, display the progression of the propagation.

In [10]:
exo1()