index.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <title>libigl</title>
  6. <meta name="author" content="Alec Jacobson and Daniele Panozzo and others"/>
  7. <link type="text/css" rel="stylesheet" href="tutorial/style.css"/>
  8. <script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
  9. <link rel='stylesheet' href='http://yandex.st/highlightjs/7.3/styles/default.min.css'>
  10. <script src='http://yandex.st/highlightjs/7.3/highlight.min.js'></script>
  11. <script>hljs.initHighlightingOnLoad();</script>
  12. </head>
  13. <body>
  14. <h1 id="libigl-asimplecgeometryprocessinglibrary">libigl - A simple C++ geometry processing library</h1>
  15. <p><a href="https://travis-ci.org/libigl/libigl"><img src="https://travis-ci.org/libigl/libigl.svg?branch=master" alt="Build Status" /></a>
  16. <a href="https://ci.appveyor.com/project/danielepanozzo/libigl-6hjk1/branch/master"><img src="https://ci.appveyor.com/api/projects/status/mf3t9rnhco0vhly8/branch/master?svg=true" alt="Build status" /></a>
  17. <img src="libigl-teaser.png" alt="" /></p>
  18. <p><a href="https://github.com/libigl/libigl/">https://github.com/libigl/libigl/</a></p>
  19. <blockquote>
  20. <p>Get started with:</p>
  21. <pre><code class="bash">git clone --recursive https://github.com/libigl/libigl.git
  22. </code></pre>
  23. </blockquote>
  24. <p>libigl is a simple C++ geometry processing library. We have a wide
  25. functionality including construction of sparse discrete differential geometry
  26. operators and finite-elements matrices such as the cotangent Laplacian and
  27. diagonalized mass matrix, simple facet and edge-based topology data structures,
  28. mesh-viewing utilities for OpenGL and GLSL, and many core functions for matrix
  29. manipulation which make <a href="http://eigen.tuxfamily.org">Eigen</a> feel a lot more
  30. like MATLAB.</p>
  31. <p>It is <strong>a header-only library</strong>. You do not need to compile anything to use,
  32. just include igl headers (e.g. <code>#include &lt;igl/cotmatrix.h&gt;</code>) and run. Each
  33. header file contains a single function (e.g. <code>igl/cotmatrix.h</code> contains
  34. <code>igl::cotmatrix()</code>). Most are tailored to operate on a generic triangle mesh
  35. stored in an n-by&#8211;3 matrix of vertex positions <code>V</code> and an m-by&#8211;3 matrix of
  36. triangle indices <code>F</code>.</p>
  37. <p><em>Optionally</em> the library may also be <a href="optional/">pre-compiled</a> into a statically
  38. linked library, for faster compile times with your projects. This only effects
  39. compile time (run-time performance and behavior is identical). If in doubt, use
  40. the header-only default mode: (i.e. just include the headers you want to use).</p>
  41. <p>We use the <a href="http://eigen.tuxfamily.org">Eigen</a> library heavily in our code. Our
  42. group prototypes a lot in MATLAB, and we have a useful <a href="matlab-to-eigen.html">MATLAB to libigl+Eigen
  43. conversion table</a>.</p>
  44. <p>We regularly test compiling our library on Mac OS X with clang, Linux with gcc
  45. and Windows with Visual Studio 2015 Community Edition.</p>
  46. <h2 id="tutorial">Tutorial</h2>
  47. <p>As of version 1.0, libigl includes an introductory
  48. <a href="http://libigl.github.io/libigl/tutorial/tutorial.html">tutorial</a> that covers many functionalities.</p>
  49. <h2 id="libiglexampleproject">libigl Example Project</h2>
  50. <p>We provide a <a href="https://github.com/libigl/libigl-example-project">blank project example</a> showing how to use libigl and cmake. Feel free and encouraged to copy or fork this project as a way of starting a new personal project using libigl.</p>
  51. <h2 id="codingguidelinesandtips">Coding Guidelines and Tips</h2>
  52. <p>libigl follows strict coding guidelines, please take a look <a href="http://libigl.github.io/libigl/style-guidelines.html">here</a> before submitting your pull requests. We also have a set of <a href="http://libigl.github.io/libigl/coding-guidelines.html">general coding tips</a> on how to code a geometry processing research project.</p>
  53. <h2 id="installation">Installation</h2>
  54. <p>Libigl is a <strong>header-only</strong> library. You do <strong>not</strong> need to build anything to
  55. install. Simply add <code>libigl/include</code> to your include path and include relevant
  56. headers. Here is a small &#8220;Hello, World&#8221; program:</p>
  57. <pre><code class="cpp">#include &lt;igl/cotmatrix.h&gt;
  58. #include &lt;Eigen/Dense&gt;
  59. #include &lt;Eigen/Sparse&gt;
  60. #include &lt;iostream&gt;
  61. int main()
  62. {
  63. Eigen::MatrixXd V(4,2);
  64. V&lt;&lt;0,0,
  65. 1,0,
  66. 1,1,
  67. 0,1;
  68. Eigen::MatrixXi F(2,3);
  69. F&lt;&lt;0,1,2,
  70. 0,2,3;
  71. Eigen::SparseMatrix&lt;double&gt; L;
  72. igl::cotmatrix(V,F,L);
  73. std::cout&lt;&lt;&quot;Hello, mesh: &quot;&lt;&lt;std::endl&lt;&lt;L*V&lt;&lt;std::endl;
  74. return 0;
  75. }
  76. </code></pre>
  77. <p>If you save this in <code>hello.cpp</code>, then you could compile this with (assuming
  78. Eigen is installed in <code>/usr/local/include/eigen3</code>):</p>
  79. <pre><code class="bash">g++ -std=c++11 -I/usr/local/include/eigen3 -I./libigl/include/ hello.cpp -o hello
  80. </code></pre>
  81. <p>Running <code>./hello</code> would then produce</p>
  82. <pre><code>Hello, mesh:
  83. 0.5 0.5
  84. -0.5 0.5
  85. -0.5 -0.5
  86. 0.5 -0.5
  87. </code></pre>
  88. <h2 id="dependencies">Dependencies</h2>
  89. <p>Dependencies are on a per-include basis and the majority of the functions in
  90. libigl depends only on the <a href="http://eigen.tuxfamily.org">Eigen</a> library.</p>
  91. <p>For more information see our <a href="tutorial/tutorial.html">tutorial</a>.</p>
  92. <h3 id="optionaldependencies">Optional Dependencies</h3>
  93. <p>Libigl compartmentalizes its <strong>optional</strong> dependences via its directory
  94. organization in the <code>include/</code> folder. All header files located <em>directly</em> in
  95. the <code>include/igl/</code> folder have only stl and Eigen as dependencies. For example,
  96. all of the headers that depend on CGAL are located in <code>include/igl/cgal</code>. For a
  97. full list of <em>optional</em> dependencies check <code>optional/CMakeLists.txt</code>.</p>
  98. <h3 id="gccandtheoptionalcgaldependency">GCC and the Optional CGAL Dependency</h3>
  99. <p>The <code>include/igl/cgal/*.h</code> headers depend on CGAL. It has come to our attention
  100. that CGAL does not work properly with GCC 4.8. To the best of our knowledge,
  101. GCC 4.7 and clang will work correctly.</p>
  102. <h3 id="openmpandwindows">OpenMP and Windows</h3>
  103. <p>Some of our functions will take advantage of OpenMP if available. However, it
  104. has come to our attention that Visual Studio + Eigen + OpenMP does not work
  105. properly. Since we use OpenMP only to improve performance, we recommend
  106. avoiding OpenMP on Windows or proceeding with caution.</p>
  107. <h2 id="download">Download</h2>
  108. <p>You can keep up to date by cloning a read-only copy of our GitHub
  109. <a href="https://github.com/libigl">repository</a>.</p>
  110. <h2 id="knownissues">Known Issues</h2>
  111. <p>We rely heavily on Eigen. Nearly all inputs and outputs are Eigen matrices of
  112. some kind. However, we currently <em>only</em> officially support Eigen&#8217;s default
  113. column-major ordering. That means, we <strong>do not</strong> expect our code to work for
  114. matrices using the <code>Eigen::RowMajor</code> flag. If you can, change definitions like:</p>
  115. <pre><code class="cpp">Eigen::Matrix&lt;double, Eigen::Dynamic, 3, Eigen::RowMajor&gt; A;
  116. </code></pre>
  117. <p>to</p>
  118. <pre><code class="cpp">Eigen::Matrix&lt;double, Eigen::Dynamic, 3, Eigen::ColMajor&gt; A;
  119. // or simply
  120. Eigen::Matrix&lt;double, Eigen::Dynamic, 3&gt; A;
  121. </code></pre>
  122. <p>We hope to fix this, or at least identify which functions are safe (many of
  123. them probably work just fine). This requires setting up unit testing, which is
  124. a major <em>todo</em> for our development.</p>
  125. <h2 id="gitsubmodules">Git Submodules</h2>
  126. <p>Libigl uses git submodules for its <em>optional</em> dependencies,
  127. in particular, those needed by the OpenGL viewer to run the examples in the
  128. <a href="tutorial/tutorial.html">tutorial</a>. Git submodules allow use to treat clones of
  129. other libraries as sub-directories within ours while separating our commits.
  130. Read the <a href="http://git-scm.com/docs/git-submodule">documentation</a> for a detailed
  131. explanation, but essentially our libigl repo stores a hash for each of its
  132. subrepos containing which version to update to. When a change is introduced in
  133. a dependencies repo we can incorporate that change by pulling in our sub-repo
  134. and updating (i.e. committing) that change to the hash.</p>
  135. <p>When pulling new changes to libigl it&#8217;s also a good idea to update changes to
  136. subrepos:</p>
  137. <pre><code class="bash">git pull
  138. git submodule update --recursive
  139. </code></pre>
  140. <h2 id="unittesting">Unit Testing</h2>
  141. <p>Libigl maintains <a href="https://github.com/libigl/libigl-unit-tests">separate
  142. repository</a> for unit testing.</p>
  143. <h2 id="howtocontribute">How to Contribute</h2>
  144. <p>If you are interested in joining development, please fork the repository and
  145. submit a <a href="https://help.github.com/articles/using-pull-requests/">pull request</a>
  146. with your changes. libigl follows strict coding guidelines, please take a look at our <a href="style-guidelines.html">style guidelines</a> before submitting your pull requests.</p>
  147. <h2 id="license">License</h2>
  148. <p>libigl is primarily <a href="http://www.mozilla.org/MPL/2.0/">MPL2</a> licensed
  149. (<a href="http://www.mozilla.org/MPL/2.0/FAQ.html">FAQ</a>). Some files contain
  150. third-party code under other licenses. We&#8217;re currently in the processes of
  151. identifying these and marking appropriately.</p>
  152. <h2 id="attribution">Attribution</h2>
  153. <p>If you use libigl in your academic projects, please cite the papers we
  154. implement as appropriate. To cite the library in general, you could use this
  155. BibTeX entry:</p>
  156. <pre><code class="bibtex">@misc{libigl,
  157. title = {{libigl}: A simple {C++} geometry processing library},
  158. author = {Alec Jacobson and Daniele Panozzo and others},
  159. note = {http://libigl.github.io/libigl/},
  160. year = {2016},
  161. }
  162. </code></pre>
  163. <h2 id="projectsuniversitiesusinglibigl">Projects/Universities using libigl</h2>
  164. <p>Libigl is used by many research groups around the world. In 2015, it won the
  165. Eurographics/ACM Symposium on Geometry Processing software award. Here are a
  166. few labs/companies/institutions using libigl:</p>
  167. <ul>
  168. <li><a href="http://www.activision.com">Activision</a></li>
  169. <li><a href="http://www.adobe.com/technology/">Adobe Research</a></li>
  170. <li><a href="http://www.ea.com">Electronic Arts, Inc</a></li>
  171. <li><a href="https://epicgames.com">Epic Games</a></li>
  172. <li><a href="https://research.google.com">Google Research</a></li>
  173. <li><a href="http://meshconsultants.ca/">Mesh</a>, consultants, Canada</li>
  174. <li><a href="http://graphics.pixar.com/research/">Pixar Research</a></li>
  175. <li><a href="http://esotericsoftware.com/">Spine by Esoteric Software</a> is an animation tool dedicated to 2D characters.</li>
  176. <li>Columbia University, <a href="http://www.cs.columbia.edu/cg/">Columbia Computer Graphics Group</a>, USA</li>
  177. <li><a href="http://www.graphics.cornell.edu/">Cornell University</a>, USA</li>
  178. <li><a href="http://dcgi.felk.cvut.cz/">Czech Technical University in Prague</a>, Czech</li>
  179. <li>EPF Lausanne, <a href="http://lgg.epfl.ch/people.php">Computer Graphics and Geometry Laboratory</a>, Switzerland</li>
  180. <li>ETH Zurich, <a href="http://igl.ethz.ch/">Interactive Geometry Lab</a> and <a href="http://ait.inf.ethz.ch/">Advanced Technologies Lab</a>, Swizterland</li>
  181. <li>George Mason University, <a href="http://cs.gmu.edu/~ygingold/">CraGL</a>, USA</li>
  182. <li><a href="http://www.ust.hk/">Hong Kong University of Science and Technology</a>, Hong Kong</li>
  183. <li><a href="https://www.inria.fr/centre/grenoble/">Inria, Université Grenoble Alpes</a>, France</li>
  184. <li><a href="http://english.jiangnan.edu.cn">Jiangnan university</a>, China</li>
  185. <li><a href="http://www.nii.ac.jp/en/">National Institute of Informatics</a>, Japan</li>
  186. <li>New York University, <a href="http://mrl.nyu.edu/">Media Research Lab</a>, USA</li>
  187. <li>NYUPoly, <a href="http://game.engineering.nyu.edu/">Game Innovation Lab</a>, USA</li>
  188. <li><a href="https://www.cg.tu-berlin.de">TU Berlin</a>, Germany</li>
  189. <li><a href="http://www.tudelft.nl/en/">TU Delft</a>, Netherlands</li>
  190. <li><a href="https://www.tuwien.ac.at/en/tuwien_home/">TU Wien</a>, Austria</li>
  191. <li><a href="http://www.telecom-paristech.fr/en/formation-et-innovation-dans-le-numerique.html">Telecom ParisTech</a>, Paris, France</li>
  192. <li><a href="http://www.staff.science.uu.nl/~vaxma001/">Utrecht University</a>, The Netherlands</li>
  193. <li><a href="http://mtm.ufsc.br/~leo/">Universidade Federal de Santa Catarina</a>, Brazil</li>
  194. <li><a href="http://vecg.cs.ucl.ac.uk/">University College London</a>, England</li>
  195. <li><a href="http://vis.berkeley.edu/">University of California Berkeley</a>, USA</li>
  196. <li><a href="http://www.cam.ac.uk/">University of Cambridge</a>, England</li>
  197. <li><a href="http://cg.cis.upenn.edu/">University of Pennsylvania</a>, USA</li>
  198. <li><a href="http://www.cs.utexas.edu/users/evouga/">University of Texas at Austin</a>, USA</li>
  199. <li><a href="http://dgp.toronto.edu">University of Toronto</a>, Canada</li>
  200. <li><a href="https://www.csc.uvic.ca/Research/graphics/">University of Victoria</a>, Canada</li>
  201. <li><a href="http://www.uwec.edu/computer-science/">University of Wisconsin-Eau Claire</a>, USA</li>
  202. <li><a href="http://www.usi.ch/en">Università della Svizzera Italiana</a>, Switzerland</li>
  203. <li><a href="http://www.univ-tlse3.fr/">Université Toulouse III Paul Sabatier</a>, France</li>
  204. <li><a href="http://www.math.zju.edu.cn/cagd/">Zhejiang University</a>, China</li>
  205. </ul>
  206. <h2 id="contact">Contact</h2>
  207. <p>Libigl is a group endeavor led by <a href="http://www.cs.toronto.edu/~jacobson/">Alec
  208. Jacobson</a> and <a href="http://cs.nyu.edu/~panozzo/">Daniele
  209. Panozzo</a>. Please <a href="&#109;&#97;&#105;&#108;&#x74;&#111;&#x3a;&#x61;&#x6c;&#101;&#x63;&#x6a;&#x61;&#x63;&#111;&#98;&#115;&#111;&#110;&#64;&#103;&#109;&#x61;&#105;&#108;&#x2e;&#x63;&#x6f;&#x6d;&#44;&#x64;&#x61;&#110;&#105;&#101;&#x6c;&#101;&#x2e;&#x70;&#x61;&#110;&#x6f;&#122;&#x7a;&#x6f;&#64;&#x67;&#x6d;&#x61;&#x69;&#x6c;&#x2e;&#99;&#x6f;&#x6d;">&#99;&#x6f;&#x6e;&#116;&#x61;&#99;&#x74;
  210. &#117;&#115;</a> if you have
  211. questions or comments. For troubleshooting, please post an
  212. <a href="https://github.com/libigl/libigl/issues">issue</a> on github.</p>
  213. <p>If you&#8217;re using libigl in your projects, quickly <a href="&#x6d;&#x61;&#105;&#108;&#x74;&#x6f;&#58;&#97;&#x6c;&#101;&#99;&#106;&#x61;&#x63;&#111;&#x62;&#x73;&#x6f;&#110;&#64;&#103;&#x6d;&#x61;&#x69;&#x6c;&#46;&#99;&#x6f;&#x6d;&#x2c;&#100;&#x61;&#110;&#105;&#x65;&#108;&#x65;&#x2e;&#112;&#97;&#x6e;&#111;&#x7a;&#x7a;&#x6f;&#x40;&#103;&#109;&#x61;&#105;&#x6c;&#x2e;&#x63;&#111;&#109;">&#x64;&#x72;&#111;&#112; &#x75;&#x73; &#97;
  214. &#110;&#111;&#116;&#101;</a>. Tell us who you
  215. are and what you&#8217;re using it for. This helps us apply for funding and justify
  216. spending time maintaining this.</p>
  217. <p>If you find bugs or have problems please use our <a href="https://github.com/libigl/libigl/issues">github issue tracking
  218. page</a>.</p>
  219. <h2 id="copyright">Copyright</h2>
  220. <p>2017 Alec Jacobson, Daniele Panozzo, Christian Schüller, Olga Diamanti, Qingnan
  221. Zhou, Sebastian Koch, Amir Vaxman, Nico Pietroni, Stefan Brugger, Kenshi Takayama, Wenzel Jakob, Nikolas De
  222. Giorgis, Luigi Rocca, Leonardo Sacht, Kevin Walliman, Olga Sorkine-Hornung, and others.</p>
  223. <p>Please see individual files for appropriate copyright notices.</p>
  224. </body>
  225. </html>