File Exchange

## gptoolbox

version 1.1.0.0 (14.4 MB) by Alec Jacobson

### Alec Jacobson (view profile)

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

Updated 07 Jul 2020

https://github.com/alecjacobson/gptoolbox/
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

### Cite As

Alec Jacobson (2020). gptoolbox (https://github.com/alecjacobson/gptoolbox), GitHub. Retrieved .

Wang Jack

### Wang Jack (view profile)

curve_offset working improperly in some cases
e.g.
x = [0 3 2 4 4 5 6 5 7];
y = [8 12 20 22 14 8 16 20 20];

jack jack

### jack jack (view profile)

cant install

Manca Zerovnik Mekuc

### Manca Zerovnik Mekuc (view profile)

Very complicated to compile this on Windows.

Jin Yang

### Jin Yang (view profile)

Is there some example or demo file to make the codes more clear? Many thx!

Guang Liang Chen

### Guang Liang Chen (view profile)

not clear enough! I have spent three days to compile, but still not succeeded.

Alec Jacobson

### Alec Jacobson (view profile)

@Johannes I've rewritten the mex installation to use CMake, you might find that easier.

Tibor Stanko

Johannes

### Johannes (view profile)

Many tools do not work without installing eigen and libilgl. The installation of these on a windows machine is also not well documented. I did not get it to work.

hong tianhao

### hong tianhao (view profile)

Thanks for sharing!

Amirali Nojoomi

### Amirali Nojoomi (view profile)

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
https://github.com/alecjacobson/gptoolbox/issues?q=is%3Aissue+is%3Aclosed

Fritz

### Fritz (view profile)

@Helen Khambay

You have to get the newest stable versions of eigen and libigl:
http://eigen.tuxfamily.org/index.php?title=Main_Page
https://github.com/libigl/libigl

You may deinstall MinGW? Not sure.
You can find more examples for other cpp functions of the gptoolbox here:
https://github.com/alecjacobson/gptoolbox/issues?q=is%3Aissue+is%3Aclosed

Then try following code:
---------------------------------------
clearvars

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

path_to_libigl='C:\dev\libigl';

MEXOPTS={'-v','-largeArrayDims','-DMEX'};

EIGEN_INC= ['-I' path_to_eigen];

LIBIGL_INC=['-I' path_to_libigl '\include'];
LIBIGL_FLAGS='-DIGL_SKIP';
LIBIGL_LIB={'-DIGL_SKIP'};
LIBIGL_LIBMATLAB='-DIGL_SKIP';
LIBIGL_LIBCGAL='-DIGL_SKIP';
LIBIGL_LIBCORK='-DIGL_NO_CORK';
LIBIGL_BASE={LIBIGL_INC, LIBIGL_FLAGS,LIBIGL_LIB{:}, LIBIGL_LIBMATLAB};

mex( ...
MEXOPTS{:}, ...
LIBIGL_BASE{:},EIGEN_INC, ...
'point_mesh_squared_distance.cpp');

Helen Khambay

### Helen Khambay (view profile)

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.

Fritz

### Fritz (view profile)

@Rik
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

### Rik (view profile)

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

### 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

### Chiyu Jiang (view profile)

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

Xiao Sidao

good job！

AP

### 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

### Josef (view profile)

 12 Feb 2015 1.1.0.0 Logo thumbnail
##### MATLAB Release Compatibility
Created with R2014b
Compatible with any release
##### Platform Compatibility
Windows macOS Linux
##### Acknowledgements

Inspired by: Toolbox Graph