To begin with, please first download the package from, https://github.com/group-gu/geometry-processing-package. Unzip to folder, assume the path is PATH = "geometry-processing-package-master" "` PATH │ .gitattributes │ .gitignore │ contents.m │ LICENSE │ README.md │ template.m │ ├───algebra │ compute_adjacency_matrix.m │ compute_bc.m │ ...│ ├───data │ bunny.obj │ bunny.off │ ... │ ├───graphics │ plot_mesh.m │ plot_path.m │ ├───io │ read_obj.m │ read_off.m │ ... │ ├───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 and Data I/O

Data Struct

Mesh Data is usually stored as Faces and Vertices.

Load Data from obj

To read from obj file,
[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)

Mesh View


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

algebra

Compute The Adjacent Matrix of mesh

Compute adjacent matrix from 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)
plot_path

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. dual
[DualConnectMat, dual_vertex]=compute_dual_graph(F,V)

Others