Unzip to folder, assume the path is PATH = "geometry-processing-package-master"

PATH
│   .gitattributes
│   .gitignore
│   contents.m
│   template.m
│
├───algebra
│       compute_bc.m
│       ...│
├───data
│       bunny.obj
│       bunny.off
│       ...
│
├───graphics
│       plot_mesh.m
│       plot_path.m
│
├───io
│       ...
│
├───misc
│       csc_to_sparse.m
│       csr_to_sparse.m
│      ...
│
├───parameterization
│       disk_harmonic_map.m
│      ...
├───topology
│       clean_mesh.m
│      ...│
└───tutorial
tutorial0.m
tutorial1.m
tutorial2.m

>> addpath(genpath('geometry-processing-package-master')


## Data Struct

Mesh Data is usually stored as Faces and Vertices.

[F, V]=read_obj('bunny.obj')


Similary, to read from off file,

[F, V]=read_off('bunny.off')



## Save Mesh

To write mesh file,

write_obj('out.obj',F,V)


Similary, to write off file,

write_off('out.off',F,V)

[F, V]=read_obj('bunny.obj')
plot_mesh(F, V)


## Compute The Adjacent Matrix of mesh

Adjat = compute_adjacency_matrix(F);


## Find Boundary of a mesh

Find boundary inds.

bdind = compute_bd(F);


We can further show the boundary by:

plot_path(F,V, bdind)


## Compute Dual Graph

In the mathematical discipline of graph theory, the dual graph of a plane graph G is a graph that has a vertex for each face of G.
Each face in original mesh corresponds to a vertex in dual graph, vertex position be the centroid of the original face.

[DualConnectMat, dual_vertex]=compute_dual_graph(F,V)


## Others

• compute_edge.m
• compute_face_ring.m
• compute_halfedge.m
• compute_vertex_face_ring.m
• compute_vertex_ring.m
• face_area.m
• generalized_laplacian.m
• laplace_beltrami.m
• vertex_area.m

## Disk Harmonic Mapping

A (smooth) map $$\phi : M \rightarrow N$$ between Riemannian manifolds M and N is called harmonic if it is a critical point of the Dirichlet energy functional
$$E(\phi)=\int_{M}|d \phi|^{2} d \mathrm{Vol}$$

[F, V]=read_obj('bunny.obj');
uv = disk_harmonic_map(F,V);
plot_mesh(F,uv);


## Spherical Harmonic Mapping

For a closed surface, it can be map to a sphere

[F, V]=read_off('maxplanck.nf25k.off');
uv = spherical_conformal_map(F,V);
plot_mesh(F,uv);