# libigl - A simple C++ geometry processing library
[](https://travis-ci.org/libigl/libigl)
[](https://ci.appveyor.com/project/danielepanozzo/libigl-6hjk1)

> Get started with:
>
```bash
git clone --recursive https://github.com/libigl/libigl.git
```
libigl is a simple C++ geometry processing library. We have a wide
functionality including construction of sparse discrete differential geometry
operators and finite-elements matrices such as the cotangent Laplacian and
diagonalized mass matrix, simple facet and edge-based topology data structures,
mesh-viewing utilities for OpenGL and GLSL, and many core functions for matrix
manipulation which make [Eigen](http://eigen.tuxfamily.org) feel a lot more
like MATLAB.
It is **a header-only library**. You do not need to compile anything to use,
just include igl headers (e.g. `#include `) and run. Each
header file contains a single function (e.g. `igl/cotmatrix.h` contains
`igl::cotmatrix()`). Most are tailored to operate on a generic triangle mesh
stored in an n-by-3 matrix of vertex positions `V` and an m-by-3 matrix of
triangle indices `F`.
_Optionally_ the library may also be [pre-compiled](optional/) into a statically
linked library, for faster compile times with your projects. This only effects
compile time (run-time performance and behavior is identical). If in doubt, use
the header-only default mode: (i.e. just include the headers you want to use).
We use the [Eigen](http://eigen.tuxfamily.org) library heavily in our code. Our
group prototypes a lot in MATLAB, and we have a useful [MATLAB to libigl+Eigen
conversion table](matlab-to-eigen.html).
We regularly test compiling our library on Mac OS X with clang, Linux with gcc
and Windows with Visual Studio 2015 Community Edition.
## Tutorial
As of version 1.0, libigl includes an introductory
[tutorial](http://libigl.github.io/libigl/tutorial/tutorial.html) that covers many functionalities.
## Installation
Libigl is a **header-only** library. You do **not** need to build anything to
install. Simply add `libigl/include` to your include path and include relevant
headers. Here is a small "Hello, World" program:
```cpp
#include
#include
#include
#include
int main()
{
Eigen::MatrixXd V(4,2);
V<<0,0,
1,0,
1,1,
0,1;
Eigen::MatrixXi F(2,3);
F<<0,1,2,
0,2,3;
Eigen::SparseMatrix L;
igl::cotmatrix(V,F,L);
std::cout<<"Hello, mesh: "< A;
```
to
```cpp
Eigen::Matrix A;
// or simply
Eigen::Matrix A;
```
We hope to fix this, or at least identify which functions are safe (many of
them probably work just fine). This requires setting up unit testing, which is
a major _todo_ for our development.
## Git Submodules
Libigl uses git submodules for its _optional_ dependencies,
in particular, those needed by the OpenGL viewer to run the examples in the
[tutorial](tutorial/tutorial.html). Git submodules allow use to treat clones of
other libraries as sub-directories within ours while separating our commits.
Read the [documentation](http://git-scm.com/docs/git-submodule) for a detailed
explanation, but essentially our libigl repo stores a hash for each of its
subrepos containing which version to update to. When a change is introduced in
a dependencies repo we can incorporate that change by pulling in our sub-repo
and updating (i.e. committing) that change to the hash.
When pulling new changes to libigl it's also a good idea to update changes to
subrepos:
```bash
git pull
git submodule update --recursive
```
## Unit testing
Libigl maintains [separate
repository](https://github.com/libigl/libigl-unit-tests) for unit testing.
## How to contribute
If you are interested in joining development, please fork the repository and
submit a [pull request](https://help.github.com/articles/using-pull-requests/)
with your changes.
## License
libigl is primarily [MPL2](http://www.mozilla.org/MPL/2.0/) licensed
([FAQ](http://www.mozilla.org/MPL/2.0/FAQ.html)). Some files contain
third-party code under other licenses. We're currently in the processes of
identifying these and marking appropriately.
## Attribution
If you use libigl in your academic projects, please cite the papers we
implement as appropriate. To cite the library in general, you could use this
BibTeX entry:
```bibtex
@misc{libigl,
title = {{libigl}: A simple {C++} geometry processing library},
author = {Alec Jacobson and Daniele Panozzo and others},
note = {http://libigl.github.io/libigl/},
year = {2016},
}
```
## Projects/Universities using libigl
Libigl is used by many research groups around the world. In 2015, it won the
Eurographics/ACM Symposium on Geometry Processing software award. Here are a
few labs/companies/institutions using libigl:
- [Adobe Research](http://www.adobe.com/technology/)
- [Electronic Arts, Inc](http://www.ea.com)
- [Mesh](http://meshconsultants.ca/), consultants, Canada
- [Pixar Research](http://graphics.pixar.com/research/)
- [Spine by Esoteric Software](http://esotericsoftware.com/) is an animation tool dedicated to 2D characters.
- Columbia University, [Columbia Computer Graphics Group](http://www.cs.columbia.edu/cg/), USA
- [Cornell University](http://www.graphics.cornell.edu/), USA
- [Czech Technical University in Prague](http://dcgi.felk.cvut.cz/), Czech
- EPF Lausanne, [Computer Graphics and Geometry Laboratory](http://lgg.epfl.ch/people.php), Switzerland
- ETH Zurich, [Interactive Geometry Lab](http://igl.ethz.ch/) and [Advanced Technologies Lab](http://ait.inf.ethz.ch/), Swizterland
- George Mason University, [CraGL](http://cs.gmu.edu/~ygingold/), USA
- [Hong Kong University of Science and Technology](http://www.ust.hk/), Hong Kong
- [National Institute of Informatics](http://www.nii.ac.jp/en/), Japan
- New York University, [Media Research Lab](http://mrl.nyu.edu/), USA
- NYUPoly, [Game Innovation Lab](http://game.engineering.nyu.edu/), USA
- [TU Berlin](https://www.cg.tu-berlin.de), Germany
- [TU Delft](http://www.tudelft.nl/en/), Netherlands
- [TU Wien](https://www.tuwien.ac.at/en/tuwien_home/), Austria
- [Telecom ParisTech](http://www.telecom-paristech.fr/en/formation-et-innovation-dans-le-numerique.html), Paris, France
- [Universidade Federal de Santa Catarina](http://mtm.ufsc.br/~leo/), Brazil
- [University College London](http://vecg.cs.ucl.ac.uk/), England
- [University of California Berkeley](http://vis.berkeley.edu/), USA
- [University of Cambridge](http://www.cam.ac.uk/), England
- [University of Pennsylvania](http://cg.cis.upenn.edu/), USA
- [University of Texas at Austin](http://www.cs.utexas.edu/users/evouga/), USA
- [University of Victoria](https://www.csc.uvic.ca/Research/graphics/), Canada
- [Università della Svizzera Italiana](http://www.usi.ch/en), Switzerland
- [Université Toulouse III Paul Sabatier](http://www.univ-tlse3.fr/), France
- [Zhejiang University](http://www.math.zju.edu.cn/cagd/), China
## Contact
Libigl is a group endeavor led by [Alec
Jacobson](http://www.cs.columbia.edu/~jacobson/) and [Daniele
Panozzo](http://www.inf.ethz.ch/personal/dpanozzo/). Please [contact
us](mailto:alecjacobson@gmail.com,daniele.panozzo@gmail.com) if you have
questions or comments. For troubleshooting, please post an
[issue](https://github.com/libigl/libigl/issues) on github.
If you're using libigl in your projects, quickly [drop us a
note](mailto:alecjacobson@gmail.com,daniele.panozzo@gmail.com). Tell us who you
are and what you're using it for. This helps us apply for funding and justify
spending time maintaining this.
If you find bugs or have problems please use our [github issue tracking
page](https://github.com/libigl/libigl/issues).
## Copyright
2016 Alec Jacobson, Daniele Panozzo, Christian Schüller, Olga Diamanti, Qingnan
Zhou, Sebastian Koch, Nico Pietroni, Stefan Brugger, Kenshi Takayama, Wenzel Jakob, Nikolas De
Giorgis, Luigi Rocca, Leonardo Sacht, Kevin Walliman, Olga Sorkine-Hornung, and others.
Please see individual files for appropriate copyright notices.