Skip to content

libigl example project

A blank project example showing how to use libigl and cmake can be found here. Feel free and encouraged to copy or fork this project as a way of starting a new personal project using libigl.

See the tutorial first

Then build, run and understand the libigl tutorial.


Compile this project using the standard cmake routine:

mkdir build
cd build
cmake ..

This should find and build the dependencies and create a example_bin binary.


From within the build directory just issue:


A glfw app should launch displaying a 3D cube.


The only dependencies are stl, eigen, libigl and the dependencies of the igl::opengl::glfw::Viewer.

We recommend to install libigl using git via:

git clone
cd libigl/
git checkout 6ebc585611d27d8e2038bbbf9cb4910c51713848
git submodule update --init --recursive
cd ..

If you have installed libigl at /path/to/libigl/ then a good place to clone this library is /path/to/libigl-example-project/.