README 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. libigl - A simple c++ geometry processing library
  2. http://igl.ethz.ch/projects/libigl/
  3. Copyright 2013 - Alec Jacobson, Daniele Panozzo, Olga Diamanti, Kenshi
  4. Takayama, Leo Sacht, Interactive Geometry Lab - ETH Zurich
  5. This is first and foremost a *header* library. Each header file should contain
  6. a single function. The function may have multiple prototypes. All functions
  7. should use the igl namespace and should adhere to the conventions and styles
  8. listed below.
  9. = Dependencies =
  10. Eigen3 Last tested with Eigen Version 3.2
  11. = Optional =
  12. OpenGL (IGL_NO_OPENGL)
  13. AntTweakBar (IGL_NO_ANTTWEAKBAR) Last tested 1.16 (see
  14. libigl/external/AntTweakBar)
  15. GLEW Windows only
  16. OpenMP
  17. libpng libiglpng extra only
  18. Mosek libiglmosek extra only
  19. Matlab libiglmatlab extra only
  20. boost libboost extra only
  21. = Optional (included in external/ =
  22. TetGen libigltetgen extra only
  23. Embree libiglembree extra only
  24. tinyxml2 libiglxml extra only
  25. = Header only =
  26. libigl is designed to work "out-of-the-box" as a headers only library. To
  27. include libigl in your project. You need only include the libigl/include/
  28. directory in your include path and define the IGL_HEADER_ONLY macro. To
  29. compile a hello-word example.cpp:
  30. #include <Eigen/Dense>
  31. #include <igl/readOBJ.h>
  32. #include <iostream>
  33. int main(int argc, char * argv[])
  34. {
  35. if(argc>1)
  36. {
  37. Eigen::MatrixXd V;
  38. Eigen::MatrixXi F;
  39. igl::readOBJ(argv[1],V,F);
  40. std::cout<<"Hello, mesh with "<<V.rows()<<" vertices!"<<std::endl;
  41. }else{
  42. std::cout<<"Hello, world!"<<std::endl;
  43. }
  44. return 0;
  45. }
  46. using gcc (replacing appropriate paths):
  47. g++ -DIGL_HEADER_ONLY -I/usr/local/igl/libigl/include \
  48. -I/opt/local/include/eigen3 example.cpp -o example
  49. Then run this example with:
  50. ./example examples/shared/TinyTorus.obj
  51. = Compile =
  52. = Linux/Mac OS X/Cygwin =
  53. libigl may also be compiled to a static library. This is advantageous when
  54. building a project with libigl, since the header only directive can slow down
  55. compile times.
  56. To build the entire libigl library producing lib/libigl.a, issue:
  57. make lib
  58. You may need to edit Makefile.conf accordingly. Best to give yourself an
  59. IGL_USERNAME and add a custom install suite for yourself. Then you can enable
  60. appropriate extras.
  61. = Extras =
  62. Once you've set up an IGL_USERNAME and enabled extras within Makefile.conf.
  63. You can build the extra libraries (into lib/ligiglpng.a, lib/libiglmatlab.a,
  64. lib/libigltetgen.a, lib/libiglmosek.a, etc.) by issuing:
  65. make extras
  66. = Examples =
  67. You can make a slew of examples by issuing:
  68. make examples
  69. = External =
  70. Finally there are a number of external libraries that we include in
  71. ./external/ because they are either difficult to obtain or they have been
  72. patched for easier use with libigl. Please see the respective readmes in
  73. those directories.
  74. = Windows (Experimental) =
  75. To build a static library (.lib) on windows, open Visual Studio 2010.
  76. New > Project ...
  77. Visual C++ > Win32
  78. Win32 Console Application
  79. Name: libiglVisualStudio
  80. Uncheck "Create directory for solution"
  81. Then hit OK, and then Next
  82. Check "Static Library"
  83. Uncheck "Precompiled headers"
  84. Add all include/igl/*.cpp to the sources directory
  85. Add all include/igl/*.h to the headers directory
  86. Open Project > libigl Properties...
  87. Add the path to eigen3 to the include paths
  88. Change the target name to libigl
  89. Build and pray (this should create libigl.lib
  90. = Source =
  91. http://msdn.microsoft.com/en-us/library/ms235627(v=vs.80).aspx
  92. = Examples =
  93. To get started, we advise that you take a look at a few examples:
  94. ./examples/hello-world/
  95. ./examples/meshio/
  96. ./examples/basic-topology/
  97. ./examples/ReAntTweakBar/
  98. = Development =
  99. Further documentation for developers is listed in tutorial.html,
  100. style_guidelines.html
  101. = License =
  102. For now, all files are Copyright 2013 - Alec Jacobson, Daniele Panozzo, Olga
  103. Diamanti, Kenshi Takayama, Leo Sacht, Interactive Geometry Lab - ETH Zurich
  104. unless otherwise noted. Soon we hope to upgrade to a more liberal license.
  105. = Zipping =
  106. Zip this directory without .hg litter using:
  107. make clean
  108. zip -9 -r --exclude=@exclude.lst libigl.zip ../libigl
  109. = Contact =
  110. libigl is a group endeavor led by Alec Jacobson and Daniele Panozzo. Please
  111. contact alecjacobson@gmail.com if you have questions or comments. We are happy
  112. to get feedback! Enjoy!