Extension of libigl which allows to also read the texture of wrl-files in Python as igl.read_triangle_mesh(wrFilePath, V, F, TC)

Daniele Panozzo e1eb91246c Merge branch 'python_bindings' of https://github.com/s-koch/libigl %!s(int64=9) %!d(string=hai) anos
file-formats 1ac7ac111a bf file format %!s(int64=9) %!d(string=hai) anos
include e1eb91246c Merge branch 'python_bindings' of https://github.com/s-koch/libigl %!s(int64=9) %!d(string=hai) anos
optional 7eaf0d3480 update page %!s(int64=9) %!d(string=hai) anos
python e1eb91246c Merge branch 'python_bindings' of https://github.com/s-koch/libigl %!s(int64=9) %!d(string=hai) anos
scripts 0c7ca3bf74 handle subdirs %!s(int64=9) %!d(string=hai) anos
shared f0ecda1418 Merge commit '5ba386306b0e1dc605941711a21d6031132d8094 [formerly 8c6e743cc184155461631cd92dd52029d86c37b9]' %!s(int64=9) %!d(string=hai) anos
tutorial 99d283e0b7 more sources %!s(int64=9) %!d(string=hai) anos
.appveyor.yml 3c9ad39bb7 switched VS build to debug in the hope of improving compilation times and go below the 60 minutes appveyor limit %!s(int64=9) %!d(string=hai) anos
.gitignore c25afb2972 fixed path problem on osx for python tutorial 607 %!s(int64=9) %!d(string=hai) anos
.gitmodules cd5d617ff3 nanogui bindings are now working on macosx %!s(int64=9) %!d(string=hai) anos
.mailmap 83eacd6100 mailmap test %!s(int64=11) %!d(string=hai) anos
.travis.yml 1d0bb08cb5 trying to reduce compiler memory usage %!s(int64=9) %!d(string=hai) anos
ACKNOWLEDGEMENTS bc64088603 better hgignores explicit instanciation for doublearea %!s(int64=11) %!d(string=hai) anos
LICENSE 695e3393cd readme %!s(int64=11) %!d(string=hai) anos
LICENSE.GPL 166ae80c7e strip copyrights %!s(int64=11) %!d(string=hai) anos
LICENSE.MPL2 166ae80c7e strip copyrights %!s(int64=11) %!d(string=hai) anos
README.md f89a77ac42 V F in code style %!s(int64=9) %!d(string=hai) anos
RELEASE_HISTORY.md fc2c90644a update version %!s(int64=10) %!d(string=hai) anos
VERSION.txt fc2c90644a update version %!s(int64=10) %!d(string=hai) anos
before-submitting-pull-request.md 175f0e7780 before submitting pull request guide %!s(int64=9) %!d(string=hai) anos
exclude.lst cb15a39694 better excludes and readme %!s(int64=11) %!d(string=hai) anos
index.html 8bc88c1cfc added tutorial 107 for screen capture and texturing %!s(int64=9) %!d(string=hai) anos
libigl-dependency-diagram.ai.REMOVED.git-id 532720dc68 merge, orient_outward_ao compiles on mac os x %!s(int64=11) %!d(string=hai) anos
libigl-logo.ai.REMOVED.git-id 0f9dcf8931 fix crop on logo %!s(int64=10) %!d(string=hai) anos
libigl-teaser.pdf.REMOVED.git-id e9a5852490 add more bubbles %!s(int64=9) %!d(string=hai) anos
libigl-teaser.png.REMOVED.git-id 802f7be0a4 fix background on teaser %!s(int64=10) %!d(string=hai) anos
matlab-to-eigen.html 21e5dfbde4 rm orphan note %!s(int64=9) %!d(string=hai) anos
style-guidelines.html 8bc88c1cfc added tutorial 107 for screen capture and texturing %!s(int64=9) %!d(string=hai) anos
style-guidelines.md d1d3585823 merge %!s(int64=9) %!d(string=hai) anos
style.css d10afaa873 fixed many missing IGL_INLINEs %!s(int64=11) %!d(string=hai) anos
todos.txt 516ffe9da8 links in references %!s(int64=11) %!d(string=hai) anos

README.md

libigl - A simple C++ geometry processing library

Build Status Build status

https://github.com/libigl/libigl/

Get started with:

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 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 <igl/cotmatrix.h>) 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 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 library heavily in our code. Our group prototypes a lot in MATLAB, and we have a useful MATLAB to libigl+Eigen conversion table.

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

#include <igl/cotmatrix.h>
#include <Eigen/Dense>
#include <Eigen/Sparse>
#include <iostream>
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<double> L;
  igl::cotmatrix(V,F,L);
  std::cout<<"Hello, mesh: "<<std::endl<<L*V<<std::endl;
  return 0;
}

If you save this in hello.cpp, then you could compile this with (assuming Eigen is installed in /usr/local/include/eigen3):

g++ -std=c++11 -I/usr/local/include/eigen3 -I./libigl/include/ hello.cpp -o hello

Running ./hello would then produce

Hello, mesh:
 0.5  0.5
-0.5  0.5
-0.5 -0.5
 0.5 -0.5

Dependencies

Dependencies are on a per-include basis and the majority of the functions in libigl depends only on the Eigen library.

For more information see our tutorial.

Optional dependencies

Libigl compartmentalizes its optional dependences via its directory organization in the include/ folder. All header files located directly in the include/igl/ folder have only stl and Eigen as dependencies. For example, all of the headers that depend on CGAL are located in include/igl/cgal. For a full list of optional dependencies check optional/CMakeLists.txt.

GCC and the optional CGAL dependency

The include/igl/cgal/*.h headers depend on CGAL. It has come to our attention that CGAL does not work properly with GCC 4.8. To the best of our knowledge, GCC 4.7 and clang will work correctly.

OpenMP and Windows

Some of our functions will take advantage of OpenMP if available. However, it has come to our attention that Visual Studio + Eigen + OpenMP does not work properly. Since we use OpenMP only to improve performance, we recommend avoiding OpenMP on Windows or proceeding with caution.

Download

You can keep up to date by cloning a read-only copy of our GitHub repository.

Known Issues

We rely heavily on Eigen. Nearly all inputs and outputs are Eigen matrices of some kind. However, we currently only officially support Eigen's default column-major ordering. That means, we do not expect our code to work for matrices using the Eigen::RowMajor flag. If you can, change definitions like:

Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor> A;

to

Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::ColMajor> A;
// or simply
Eigen::Matrix<double, Eigen::Dynamic, 3> 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. Git submodules allow use to treat clones of other libraries as sub-directories within ours while separating our commits. Read the documentation 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:

git pull
git submodule update --recursive

Unit testing

Libigl maintains separate repository for unit testing.

How to contribute

If you are interested in joining development, please fork the repository and submit a pull request with your changes.

License

libigl is primarily MPL2 licensed (FAQ). 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:

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

Contact

Libigl is a group endeavor led by Alec Jacobson and Daniele Panozzo. Please contact us if you have questions or comments. For troubleshooting, please post an issue on github.

If you're using libigl in your projects, quickly drop us a note. 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.

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.