File Exchange

image thumbnail


version 1.1 (24.8 MB) by

Useful functions for geometry processing, constrainted optimization and image processing.


This is a toolbox of useful matlab functions for geometry processing. There are also tools related to constrainted optimization and image processing. Typically these are utility functions that are not stand alone applications.
Here's an incomplete list of cool features this matlab toolbox contains:

 - wrappers for TetGen, Triangle, QSlim, meshfix
 - mesh smoothing
 - mesh clean up (remove duplicates, remove unreferenced)
 - geodesic distances on triangle and tetrahedral meshes
 - mesh quantities and queries (normals, discrete gaussian curvature, list boundary edges, topology, angles, dihedral angles etc.)
 - mesh deformation (as-rigid-as-possible (ARAP), moving least-squares, etc.)
 - mesh parameterization (harmonic, least squares conformal, ARAP, etc.)
 - automatic skinning weight computation (bounded biharmonic weights, bone heat)
 - 2D triangle mesh from binary image
 - Input/Output for many mesh formats (.obj,.off,.stl,.wrl,.ply,.mesh,.node,.ele,.poly,.smf,.bdl,.face)
 - discrete differential geometry operators for triangle and tetrahedral meshes (cotangent Laplacian, gradient, divergence)
 - quadratic programming, active set solver
 - scribble-based image colorization, diffusion curves
 - exact (un)signed distance field computation for meshes
 - constructive solid geometry operations on meshes, booleans
 - accelerated point location in triangle and tetrahedral meshes
 - image dithering
 - deep matlab function dependency

Comments and Ratings (11)

Great toolbox, However, I still have some problem compiling some of the .cpp files.

Does anyone have complied versions of 'point_mesh_squared_distance.cpp' and 'signed_distance.cpp' either in .mexw64 or .mexmaci64? It will be really helpful.

I already tried every way described on


Fritz (view profile)

@Helen Khambay

You have to get the newest stable versions of eigen and libigl:

You may deinstall MinGW? Not sure.
You can find more examples for other cpp functions of the gptoolbox here:

Then try following code:

path_to_eigen=['C:\dev\eigen-eigen-' eigen_version];



EIGEN_INC= ['-I' path_to_eigen];

LIBIGL_INC=['-I' path_to_libigl '\include'];

mex( ...
  MEXOPTS{:}, ...

Hello, Can someone please help me compile the point_mesh_squared_distance.cpp with mex as I want to use the hausdorff function. I have installed MinGW but get the error message "point_mesh_squared_distance.cpp:5:34: fatal error: igl/matlab/MexStream.h: No such file or directory compilation terminated."
I am a novice at using MATLAB.
Many thanks in advance...


Fritz (view profile)

It also works on a windows machine.

At first you have to compile the point_mesh_squared_distance.cpp with mex if you want to use the hausdorff function.

Rik Wisselink

It may be useful, but since I work on a Windows machine, I can't use the hausdorff script.

This submission misses two things:
1) a list of function with a one-line explanation to facilitate searching
2) a mention in the description that some things that will not work on Windows.


Fritz (view profile)

Great toolbox! Thanks a lot!

Some ideas:
Small examples in description of the functions would be useful.

You could reduce the file size of the zip file by compressing the "gptoolbox-logo.pdf".

Chiyu Jiang

Very helpful tool box! Great job! Thanks for sharing!

Xiao Sidao

good job!


AP (view profile)

Wonderful job and thanks for sharing with the community.

My application is that I have a closed triangulated surface in 3D. I want to use the signed distance function and apply it to a uniform 3D Cartesian grid in which the 3D triangulated closed surface lies. In other words, this 3D surface is immersed in the Cartesian uniform grid. I was able to successfully compile and build the mex file.

Would you let me know how I should use the function and find the signed distance function for my application assuming V and F are the vertices, faces of the surface and x, y, z are the coordinates of the uniform Cartesian grid. I would be very grateful.

Anton Semechko

Anton Semechko (view profile)

This is a very useful toolbox for anyone working with surface meshes. Thanks for sharing!


Josef (view profile)



Logo thumbnail

MATLAB Release
MATLAB 8.4 (R2014b)

Inspired by: Toolbox Graph

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video