Эх сурвалжийг харах

WIP doc website.

Former-commit-id: b0122aa8be686f28bda440d2e8b07bcfdba544da
Jérémie Dumas 7 жил өмнө
parent
commit
7f2dd8eed0

+ 0 - 17
CONTRIBUTING.md

@@ -1,17 +0,0 @@
-Before opening an issue on creating a pull request, please check the following:
-
-## Compilation Issues
-
-- If you are on Windows, did you select the **x64** version of the Visual Studio compiler?
-
-- If you have a **CMake issue**, make sure you follow the same approach as the  [libigl-example-project](https://github.com/libigl/libigl-example-project) to build libigl with your project, and make sure that you can compile the example project.
-
-- If you have an issue with a **submodule**, check if your submodules are up to date. If you have a doubt about a submodule, delete its folder and run `git submodule update --init --recursive` in the libigl directory.
-
-- If you have an issue with a missing **template issue**, check if your code compile with the *header-only* option of libigl activated. Turn **`OFF`** the CMake option `LIBIGL_USE_STATIC_LIBRARY`: either modify your `CMakeCache.txt` via CMake GUI or ccmake, or delete your `CMakeCache.txt` and re-run `cmake -DLIBIGL_USE_STATIC_LIBRARY=OFF ..` in your build folder.
-
-- Make sure your read the [**FAQ**](https://github.com/libigl/libigl/wiki/FAQ) before asking a new question, and search [**existing issues**](https://github.com/libigl/libigl/issues?q=is%3Aissue+is%3Aclosed) for a problem similar to yours.
-
-- Make sure you read the informations contained in the libigl [homepage](https://github.com/libigl/libigl) as well as the [tutorials](http://libigl.github.io/libigl/tutorial/tutorial.html).
-
-- If none of these solve your problem, then please report your issue in the bug tracker!

+ 0 - 40
LICENSE.md

@@ -1,40 +0,0 @@
-Libigl is primarily licensed under MPL2
-  - http://www.mozilla.org/MPL/2.0/
-  - http://www.mozilla.org/MPL/2.0/FAQ.html
-
-All `.h` and `.cpp` _files_ directly in `include/igl` (but not necessarily in
-sub-directories) are subject only to the terms of the MPL2; they should not
-include any code that is covered by other/less-permissive licenses.
-
-The `.h` and `.cpp` _files_ in sub-directories of `include/igl` allow libigl to
-integrate with external third-party libraries (e.g., those in `external/`) and
-are subject to the MPL2, _**and**_ also the terms of licenses of the
-corresponding external library.  The licenses used by these libraries fall under
-three categories:
-
-- common "free, non-copyleft licenses" (such as zlib, BSD, MIT, and public
-  domain)
-  - `include/igl/anttweakbar`
-  - `include/igl/embree`
-  - `include/igl/opengl`
-  - `include/igl/opengl/glfw`
-  - `include/igl/opengl2`
-  - `include/igl/png`
-  - `include/igl/viewer`
-  - `include/igl/xml`
-- common "copyleft" licences (such as GPL, LGPL, and AGPL)
-  - `include/igl/copyleft`
-  - `include/igl/copyleft/cgal`
-  - `include/igl/copyleft/comiso`
-  - `include/igl/copyleft/cork`
-  - `include/igl/copyleft/tetgen`
-- other "uncommon" licenses or commercial software
-  - `include/igl/lim`
-  - `include/igl/matlab`
-  - `include/igl/mosek`
-  - `include/igl/triangle`
-
-The Libigl code that interfaces with "copyleft" libraries is in
-`include/igl/copyleft`.  Only include these headers if you are accept the
-licensing terms of the corresponding external library.  For example, using
-`include/igl/copyleft/tetgen` requires that you accept the terms of the AGPLv3.

+ 0 - 151
RELEASE_HISTORY.md

@@ -1,151 +0,0 @@
-title: libigl Tutorial
-author: Alec Jacobson
-date: 17 June 2015
-css: tutorial/style.css
-html header:   <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
-<link rel="stylesheet" href="http://yandex.st/highlightjs/7.3/styles/default.min.css">
-<script src="http://yandex.st/highlightjs/7.3/highlight.min.js"></script>
-<script>hljs.initHighlightingOnLoad();</script>
-
-# Libigl version tracking
-
-Version | Short description
---------|----------------------------------------------------------------------
-1.2.1   | Reorganization opengl-dependent functions: opengl and opengl2 extras
-1.2.0   | Reorganization of "extras", rm deprecated funcs, absorb boost & svd3x3
-1.1.7   | Switch build for static library to cmake.
-1.1.6   | Major boolean robustness fix, drop CGAL dependency for AABB/distances
-1.1.5   | Bug fix in booleans
-1.1.4   | Edge collapsing and linear program solving
-1.1.3   | Bug fixes in active set and boundary_conditions
-1.1.1   | PLY file format support
-1.1.0   | Mesh boolean operations using CGAL and cork, implementing [Attene 14]
-1.0.3   | Bone heat method
-1.0.2   | Bug fix in winding number code
-1.0.1   | Bug fixes and more CGAL support
-1.0.0   | Major beta release: many renames, tutorial, triangle, org. build
-0.4.6   | Generalized Winding Numbers
-0.4.5   | CGAL extra: mesh selfintersection
-0.4.4   | STL file format support
-0.4.3   | ARAP implementation
-0.4.1   | Migrated much of the FAST code including extra for Sifakis' 3x3 svd
-0.4.0   | Release under MPL2 license
-0.3.7   | Embree2.0 support
-0.3.6   | boost extra, patches, mosek 7 support, libiglbbw (mosek optional)
-0.3.5   | More examples, naive primitive sorting
-0.3.3   | Many more examples, ambient occlusion with Embree.
-0.3.1   | Linearly dependent constraints in min_quad_with_fixed, SparseQR buggy
-0.3.0   | Better active set method support
-0.2.3   | More explicits, active set method, opengl/anttweakbar guards
-0.2.2   | More explicit instantiations, faster sorts and uniques
-0.2.1   | Bug fixes in barycenter and doublearea found by Martin Bisson
-0.2.0   | XML serializer more stable and fixed bug in remove_duplicate_vertices
-0.1.8   | Embree and xml (windows only) extras
-0.1.5   | Compilation on windows, bug fix for compilation with cygwin
-0.1.1   | Alpha release with core functions, extras, examples
-
-## Version 1.2 Changes ##
-This change introduces better organization of dependencies and removes some
-deprecated/repeated functions. The 3x3 svd code and dependent functions
-(including ARAP) were absorbed into the main library. Similarly, the boost
-dependency extra was absorbed.
-
-
-### External libraries as git subrepos ###
-The core functionality of libigl (still) just depends on stl, c++11 and Eigen.
-There are additional _optional_ dependencies (e.g. CGAL, embree, glfw, tetgen,
-triangle). Libigl functions using these are located (still) in sub-folders of
-the include directory (e.g.  `include/igl/cgal/`, `include/igl/embree/`). Prior
-to version 1.2 we included copies of the code for some of these dependencies in the
-`external/` directory. As of
-version 1.2, these have been replaced with git sub-repos. If you have cloned
-libigl _before version 1.2_ then you should issue 
-
-    git submodule update --init --recursive
-
-### Deprecated/repeated functions ###
-
-Old                                     | New
---------------------------------------- | -----------------------------------
-`igl::angles`                           | `igl::internal_angles`
-`igl::get_modifiers`                    | [deleted]
-`igl::nchoosek(offset,K,N,std::vector)` | `igl::nchoosek(Eigen,K,Eigen)`
-`#include <igl/boost/components.h>`     | `#include <igl/components.h>`
-`#include <igl/boost/bfs_orient.h>`     | `#include <igl/bfs_orient.h>`
-`#include <igl/boost/orientable_patches.h>` | `#include <igl/orientable_patches.h>`
-`#include <igl/svd3x3/arap.h>`          | `#include <igl/arap.h>`
-`#include <igl/svd3x3/arap_dof.h>`      | `#include <igl/arap_dof.h>`
-`#include <igl/svd3x3/fit_rotations.h>` | `#include <igl/fit_rotations.h>`
-`#include <igl/svd3x3/polar_svd3x3.h>`  | `#include <igl/polar_svd3x3.h>`
-`#include <igl/svd3x3/svd3x3.h>`        | `#include <igl/svd3x3.h>`
-`#include <igl/svd3x3/svd3x3_avx.h>`    | `#include <igl/svd3x3_avx.h>`
-`#include <igl/svd3x3/svd3x3_sse.h>`    | `#include <igl/svd3x3_sse.h>`
-
-
-## Version 1.0 Changes ##
-Our beta release marks our confidence that this library can be used outside of
-casual experimenting. To maintain order, we have made a few changes which
-current users should read and adapt their code accordingly.
-
-### Renamed functions ###
-The following table lists functions which have changed name as of version
-1.0.0:
-
-Old                              | New
--------------------------------- | -------------------------------------
-`igl::add_barycenter`            | `igl::false_barycentric_subdivision`
-`igl::areamatrix`                | `igl::vector_area_matrix`
-`igl::barycentric2global`        | `igl::barycentric_to_global`
-`igl::boundary_faces`            | `igl::boundary_facets`
-`igl::boundary_vertices_sorted`  | `igl::boundary_loop`
-`igl::cotangent`                 | `igl::cotmatrix_entries`
-`igl::edgetopology`              | `igl::edge_topology`
-`igl::gradMat`                   | `igl::grad`
-`igl::is_manifold`               | `igl::is_edge_manifold`
-`igl::mexStream`                 | `igl::MexStream`
-`igl::moveFV`                    | `igl::average_onto_vertices`
-`igl::moveVF`                    | `igl::average_onto_faces`
-`igl::plot_vector`               | `igl::print_vector`
-`igl::pos`                       | `igl::HalfEdgeIterator`
-`igl::plane_project`             | `igl::project_isometrically_to_plane`
-`igl::project_points_mesh`       | `igl::line_mesh_intersection`
-`igl::read`                      | `igl::read_triangle_mesh`
-`igl::removeDuplicates.cpp`      | `igl::remove_duplicates`
-`igl::removeUnreferenced`        | `igl::remove_unreferenced`
-`igl::tt`                        | `igl::triangle_triangle_adjacency`
-`igl::vf`                        | `igl::vertex_triangle_adjacency`
-`igl::write`                     | `igl::write_triangle_mesh`
-`igl::manifold_patches`          | `igl::orientable_patches`
-`igl::selfintersect`             | `igl::remesh_self_intersections`
-`igl::project_mesh`              | `igl::line_mesh_intersection`
-`igl::triangulate`               | `igl::polygon_mesh_to_triangle_mesh`
-`igl::is_manifold`               | `igl::is_edge_manifold`
-`igl::triangle_wrapper`          | `igl::triangulate`
-
-### Miscellaneous ###
- - To match interfaces provided by (all) other quadratic optimization
-   libraries, `igl::min_quad_with_fixed` and `igl::active_set` now expect as
-   input twice the quadratic coefficients matrix, i.e. the Hessian. For
-   example, `igl::min_quad_with_fixed(H,B,...)` minimizes $\frac{1}{2}x^T H
-   x+x^T B$.
- - We have inverted the `IGL_HEADER_ONLY` macro to `IGL_STATIC_LIBRARY`. To
-   compile using libigl as a header-only library, simply include headers and
-   libigl in the header search path. To link to libigl, you must define the
-   `IGL_STATIC_LIBRARY` macro at compile time and link to the `libigl*.a`
-   libraries.
- - Building libigl as a static library is now more organized. There is a
-   `build/` directory with Makefiles for the main library (`Makefile`) and each
-   dependency (e.g. `Makefile_mosek` for `libiglmosek.a`)
- - `igl::polar_svd` now always returns a rotation in `R`, never a reflection.
-   This mirrors the behavior of `igl::polar_svd3x3`.  Consequently the `T`
-   part may have negative skews.
- - We have organized the static library build
- - The previous `igl::grad` function, which computed the per-triangle gradient
-   of a per-vertex scalar function has been replaced. Now `igl::grad` computes
-   the linear operator (previous computed using `igl::gradMat`). The gradient
-   values can still be recovered by multiplying the operator against the scalar
-   field as a vector and reshaping to have gradients per row.
- - `MASSMATRIX_*` has become `MASSMATRIX_TYPE_*`
- - The function `igl::project_normals`, which cast a line for each vertex of
-   mesh _A_ in the normal direction and found the closest intersection along
-   these lines with mesh _B_, has been removed.

+ 0 - 62
before-submitting-pull-request.md

@@ -1,62 +0,0 @@
-# Before submitting a pull request
-
-There are a variety of things you can do before submitting a pull request that
-will reduce the effort on the libigl team to merge your code and increase the
-likelihood that the merge ever happens.
-
-  1. Test your code and submit a unit test as part of the pull request
-  2. Verify that your code matches the [libigl style
-  guidelines](style-guidelines.md)
-  3. Run the [exhaustive build test](#exhaustivebuildtest) below
-
-## Exhaustive build test
-
-This script will `git clone` libigl to a temporary directory and build 
-
-  1. the static libigl library, 
-  2. the tutorial using the default header only libigl, and 
-  3. the tutorial using the static library libigl.
-  
-Eventually this script should also run the unit tests.
-
-```bash
-# In scripts/clone_and_build.sh add your email address to the line:
-# `recipients="alecjacobson@gmail.com,youremail@domain.com"`
-# In your email client (e.g. gmail) create a filter to prevent emails 
-# from your local machine from going to spam
-scripts/clone_and_build.sh
-```
-
-### Direct test of tutorial using static library
-
-This part of the `clone_and_build.sh` script catches 99% of the compilation
-issues that _don't_ show up when testing:
-
-```bash
-cd tutorial/
-mkdir build-use-static
-cd build-use-static
-cmake -DCMAKE_BUILD_TYPE=Release -DLIBIGL_USE_STATIC_LIBRARY=ON ..
-make
-```
-
-A typical issue is a missing template instantiation (symbol not found):
-
-    "void igl::cgal::points_inside_component<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&)", referenced from:
-        void igl::cgal::outer_hull<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<long, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&) in libiglboolean.a(mesh_boolean.cpp.o)
-        void igl::cgal::outer_hull<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<long, -1, 1, 0, -1, 1>, Eigen::Matrix<bool, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<bool, -1, 1, 0, -1, 1> >&) in libiglboolean.a(mesh_boolean.cpp.o)
-
-This looks like a mess, but the solution is very simple. Copy the chunk inside of the quotes, in this case:
-
-    "void igl::cgal::points_inside_component<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&)"
-
-and paste it at the bottom of the relevant .cpp file with the word template in front of it and a semicolon at then. In this case, in include/igl/cgal/points_inside_component.cpp:
-
-```cpp
-#ifdef IGL_STATIC_LIBRARY
-// Explicit template instantiation
-template void igl::cgal::points_inside_component<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-#endif
-```
-
-Then "rinse and repeat".

+ 0 - 60
coding-guidelines.html

@@ -1,60 +0,0 @@
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
-<head>
-	<meta charset="utf-8"/>
-	<title>libigl</title>
-	<meta name="author" content="Alec Jacobson and Daniele Panozzo and others"/>
-	<link type="text/css" rel="stylesheet" href="../tutorial/style.css"/>
-<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> <link rel='stylesheet' href='http://yandex.st/highlightjs/7.3/styles/default.min.css'> <script src='http://yandex.st/highlightjs/7.3/highlight.min.js'></script> <script>hljs.initHighlightingOnLoad();</script>
-</head>
-<body>
-
-<h1 id="libiglcodingtipsakahowtocodeasiggraphproject">Libigl Coding Tips (aka &#8220;How to code a SIGGRAPH project&#8221;)</h1>
-
-<p>This is a short list of coding tips that will greatly reduce your pain and suffering before (and after) the SIGGRAPH deadline.</p>
-
-<h3 id="1.serializeitall">1. Serialize it all</h3>
-
-<p>The entire state of your application should be serializable, i.e. It should be possible to save it into a binary file and reload it at any point. This drastically simplifies debugging, since you can serialize just before a crash happens and debug from that point without running your complete algorithm again. Serializing all results shown in the paper&#8217;s figures enables quicker editing iterations before (and after) the deadline. It also allows you to share your results with others that wish to compare with your method. An additional tip is to serialize the state of the application on the window close event and automatically reload it when you launch it again.</p>
-
-<h3 id="2.alwaysassert">2. Always assert</h3>
-
-<p>Even if you know what you are doing, always assert, you will be surprised. Assertion is a powerful but underused feature available in all programming languages. It is essential for writing research code since often you will have to implement algorithms that turns out to not be doing what you expect: in these cases it is important to know if the algorithm is flawed or if there is a bug in your implementation. Discarding a good idea because of a coding bug is frustrating and unfortunately common. Assertion is an ideal way to reduce the chances of introducing bugs in your code and, differently from unit testing, requires a very minor programming effort. You should use them extensively.</p>
-
-<h3 id="3.ploteverything">3. Plot everything</h3>
-
-<p>If you can visually plot the results or some intermediate steps of your algorithm, do it, even if you think your implementation is correct! It is a lot easier to find bugs or to get an intuition on an algorithm by looking at a plot than by looking at the code.</p>
-
-<h3 id="4.ifthecompilationtimeafteracodechangeismorethanfivesecondsyouaredoingitwrong">4. If the compilation time after a code change is more than five seconds, you are doing it wrong</h3>
-
-<p>You will change your code hundreds of times every day for months. Let&#8217;s say that you will change it a hundred times a day (which is a very conservative estimate): if the compilation takes one minute, you will waste almost two hours every day, just waiting! What is even worse, is that since it is only 1&#8211;2 minutes at a time, it will not even be sufficient to prepare a coffee. Spend the hour or two that is needed to get your code to compile in a few seconds, you will benefit from it in the same day already, and the time saved over an entire project will be gigantic.</p>
-
-<h3 id="5.commitoftenandwithameaningfuldescription">5. Commit often (and with a meaningful description)</h3>
-
-<p>Use a distributed version control system (git,hg), and keep the repository on a remote host. Commit often and put meaningful comments. This will serve you as an emergency backup and it will always allow you to have a running version of your code whenever your advisor is passing by and asking to see some results. She will be impressed and you will not have to quickly fix your build with your boss breathing down your neck.</p>
-
-<h3 id="6.dependenciesareevilavoidthem">6. Dependencies are evil, avoid them</h3>
-
-<p>Keep your code simple and with minimal external dependencies. Spending a day or two to code something from scratch while avoiding to use third party code is usually an investment that pays off. The more code you have in your algorithm that is not written by you, the harder debugging becomes. In particular, refrain from building your entire project on code that you do not understand to avoid bad surprises just before the deadline. If you must use code written by others, spend the time that is needed to fully understand what it does, and link it statically so that it will be easy to place breakpoints inside it.</p>
-
-<h3 id="7.globalvariablesarenotevilusethem">7. Global variables are not evil, use them</h3>
-
-<p>Global variables are often extremely useful &#8212; if you think you need one, use it. They are indeed dangerous for large projects, but you are not coding one of those, you are coding a prototype to test a research idea. I suggest to keep one single copy of your entire application state in a global variable (or a singleton class) that can be serialized (see tip 1). This variable should include everything rendered on screen and all the temporary data produced by your algorithm. This will allow you to easily access all the data in your project for plotting or debugging purposes.</p>
-
-<h3 id="8.prototypefirst">8. Prototype first</h3>
-
-<p>Don’t preemptively optimize and try to quickly write code that is clean and correct. It is common to try multiple different approaches to solve a new problem before finding the right one. This means that the majority of the code that you will write will not be used at the end of the project. While you should still write high-quality and bug-free code to make sure that your results is correct, you definitely do not want to spend time optimizing it before you are sure that is the right approach. In particular, it is helpful to learn a good prototyping language (Python, matlab) and use it for the early stages of the project and switch to (or mix it with) c++ only after finding a promising direction.</p>
-
-<h3 id="9.avoidexplicitpointers">9. Avoid explicit pointers</h3>
-
-<p>Do yourself a favor, do not use explicit pointers. If you use a language that supports explicit pointers, use them only if you really have to. And even in that case, keep them isolated in a single file and be very careful with them. Writing data inside another variable by accident might not trigger a crash, and simply produce strange artifacts that might convince you that a promising research direction does not work, while the problem lies in a nasty bug in your code. There is no reason to take that risk during prototyping, just avoid them and leave them for the end of the project in case they become necessary to optimize your code.</p>
-
-<h3 id="10.ifyourprogramcrashesfixitnow">10. If your program crashes, fix it now!</h3>
-
-<p>If your program crashes, don&#8217;t close your eyes and move on. Try to make it happen again, debug it and fix it immediately. These bugs are a nightmare to find, and the more code you add on top of a bug will just make it harder to find. If you don&#8217;t fix it, due to Murphy&#8217;s law, it will start to be problematic only a few days before the deadline and you will have no time to fix it at that point.</p>
-
-<p><em>Daniele Panozzo</em></p>
-
-</body>
-</html>
-

+ 0 - 42
coding-guidelines.md

@@ -1,42 +0,0 @@
-# Libigl Coding Tips (aka "How to code a SIGGRAPH project")
-
-This is a short list of coding tips that will greatly reduce your pain and suffering before (and after) the SIGGRAPH deadline.
-
-
-### 1. Serialize it all
-The entire state of your application should be serializable, i.e. It should be possible to save it into a binary file and reload it at any point. This drastically simplifies debugging, since you can serialize just before a crash happens and debug from that point without running your complete algorithm again. Serializing all results shown in the paper's figures enables quicker editing iterations before (and after) the deadline. It also allows you to share your results with others that wish to compare with your method. An additional tip is to serialize the state of the application on the window close event and automatically reload it when you launch it again.
-
-### 2. Always assert
-Even if you know what you are doing, always assert, you will be surprised. Assertion is a powerful but underused feature available in all programming languages. It is essential for writing research code since often you will have to implement algorithms that turns out to not be doing what you expect: in these cases it is important to know if the algorithm is flawed or if there is a bug in your implementation. Discarding a good idea  because of a coding bug is frustrating and unfortunately common. Assertion is an ideal way to reduce the chances of introducing bugs in your code and, differently from unit testing, requires a very minor programming effort. You should use them extensively.
-
-### 3. Plot everything
-
-If you can visually plot the results or some intermediate steps of your algorithm, do it, even if you think your implementation is correct! It is a lot easier to find bugs or to get an intuition on an algorithm by looking at a plot than by looking at the code.
-
-### 4. If the compilation time after a code change is more than five seconds, you are doing it wrong
-
-You will change your code hundreds of times every day for months. Let's say that you will change it a hundred times a day (which is a  very conservative estimate): if the compilation takes one minute, you will waste almost two hours every day, just waiting! What is even worse, is that since it is only 1-2 minutes at a time, it will not even be sufficient to prepare a coffee. Spend the hour or two that is needed to get your code to compile in a few seconds, you will benefit from it in the same day already, and the time saved over an entire project will be gigantic.
-
-### 5. Commit often (and with a meaningful description)
-
-Use a distributed version control system (git,hg), and keep the repository on a remote host. Commit often and put meaningful comments. This will serve you as an emergency backup and it will always allow you to have a running version of your code whenever your advisor is passing by and asking to see some results. She will be impressed and you will not have to quickly fix your build with your boss breathing down your neck.
-
-### 6. Dependencies are evil, avoid them
-
-Keep your code simple and with minimal external dependencies. Spending a day or two to code something from scratch while avoiding to use third party code is usually an investment that pays off. The more code you have in your algorithm that is not written by you, the harder debugging becomes. In particular, refrain from building your entire project on code that you do not understand to avoid bad surprises just before the deadline. If you must use code written by others, spend the time that is needed to fully understand what it does, and link it statically so that it will be easy to place breakpoints inside it.
-
-### 7. Global variables are not evil, use them
-
-Global variables are often extremely useful --- if you think you need one, use it. They are indeed dangerous for large projects, but you are not coding one of those, you are coding a prototype to test a research idea. I suggest to keep one single copy of your entire application state in a global variable (or a singleton class) that can be serialized (see tip 1). This variable should include everything rendered on screen and all the temporary data produced by your algorithm. This will allow you to easily access all the data in your project for plotting or debugging purposes.
-
-### 8. Prototype first
-Don’t preemptively optimize and try to quickly write code that is clean and correct. It is common to try multiple different approaches to solve a new problem before finding the right one. This means that the majority of the code that you will write will not be used at the end of the project. While you should still write high-quality and bug-free code to make sure that your results is correct, you definitely do not want to spend time optimizing it before you are sure that is the right approach. In particular, it is helpful to learn a good prototyping language (Python, matlab) and use it for the early stages of the project and switch to (or mix it with) c++ only after finding a promising direction.
-
-### 9. Avoid explicit pointers
-Do yourself a favor, do not use explicit pointers. If you use a language that supports explicit pointers, use them only if you really have to. And even in that case, keep them isolated in a single file and be very careful with them. Writing data inside another variable by accident might not trigger a crash, and simply produce strange artifacts that might convince you that a promising research direction does not work, while the problem lies in a nasty bug in your code. There is no reason to take that risk during prototyping, just avoid them and leave them for the end of the project in case they become necessary to optimize your code.
-
-### 10. If your program crashes, fix it now!
-
-If your program crashes, don't close your eyes and move on. Try to make it happen again, debug it and fix it immediately. These bugs are a nightmare to find, and the more code you add on top of a bug will just make it harder to find. If you don't fix it, due to Murphy's law, it will start to be problematic only a few days before the deadline and you will have no time to fix it at that point.
-
-_Daniele Panozzo_

+ 0 - 30
file-formats/bf.html

@@ -1,30 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <link rel='stylesheet' type='text/css' href='../style.css' >
-    <title>libigl file formats | .bf</title>
-  </head>
-  <body class=article_outer>
-  <div class=article_inner>
-    <a href=..><img src=../libigl-logo.jpg alt="igl logo" class=center></a>
-    <h1>.bf - bone forests</h1>
-    <hr>
-    <p>
-A .bf file contains a "bone forest". Normally a skeleton for linear blend
-skinning is a "bone tree" with a single root. But this format may store
-multiple trees, hence a forest.
-    <p>
-Each line contains data about a vertex (joint) of the bone forest:
-    </p>
-    <pre><code>[weight index] [parent index] [x] [y] [z] [undocument optional data]</code></pre>
-    <p>
-Indices begin with 0.  The weight index is -1 if the bone does not have an
-associated weight. The parent index is -1 for root nodes. The x,y,z coordinates
-are offset vectors from this joint's parent's location (for roots, an offset
-from the origin).
-    </p>
-    <p>See also: <a href=.>file formats</a></p>
-  </div>
-  </body>
-</html>
-

+ 0 - 44
file-formats/dmat.html

@@ -1,44 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <link rel='stylesheet' type='text/css' href='../style.css' >
-    <title>libigl file formats | .dmat</title>
-  </head>
-  <body class=article_outer>
-  <div class=article_inner>
-    <a href=..><img src=../libigl-logo.jpg alt="igl logo" class=center></a>
-    <h1>.dmat - dense matrices</h1>
-    <hr>
-    <p>
-A .dmat file contains a dense matrix in column major order. It can contain
-ASCII or binary data. Note that it is uncompressed so binary only reduces the
-file size by 50%. But writing and reading binary is usually faster. In MATLAB,
-binary is almost 100x faster.
-    </p>
-    <h2>ASCII</h2>
-    <p>
-The first line is a header containing:
-    </p>
-    <pre><code>[#cols] [#rows]</code></pre>
-    <p>
-Then the coefficients are printed in column-major order separated by spaces. 
-    </p>
-    <h2>Binary</h2>
-    <p>
-Binary files will also contain the ascii header, but it should read:
-    </p>
-    <pre><code>0 0</code></pre>
-    <p>
-Then there should be another header containing the size of the binary part:
-    </p>
-    <pre><code>[#cols] [#rows]</code></pre>
-    <p>
-Then coefficients are written in column-major order in Little-endian 8-byte
-double precision IEEE floating point format.
-    </p>
-    <p><strong>Note:</strong> Line endings must be <code>'\n'</code> aka char(10) aka line feeds.</p>
-    <p>See also: <a href=.>file formats</a></p>
-  </div>
-  </body>
-</html>
-

+ 0 - 97
file-formats/index.html

@@ -1,97 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <link rel='stylesheet' type='text/css' href='../style.css' >
-    <title>libigl file formats</title>
-  </head>
-  <body class=article_outer>
-  <div  class=article_inner>
-    <a href=..><img src=../libigl-logo.jpg alt="igl logo" class=center></a>
-  <h1>libigl file formats</h1>
-  <ul>
-    <li><a href="./bf.html">.bf</a> ASCII files for representing skeletal bone "forests"</li>
-    <li><a href="./dmat.html">.dmat</a> uncompressed ASCII/binary files for dense matrices</li>
-    <li><i>.ele</i> Element (triangle or tet) list. This format comes in similar flavors: <a
-    href=http://tetgen.berlios.de/fformats.ele.html>tetgen's</a>, <a
-    href=http://www.cs.berkeley.edu/~jrs/stellar/#fileformats>stellar's</a>,
-    and <a href=https://www.cs.cmu.edu/~quake/triangle.ele.html>triangle's</a>.
-    The formats of TetGen and stellar are identical upto conventions on index
-    ordering and number of allowed attributes (unverified).</li>
-    <li><a href=http://tetgen.berlios.de/fformats.face.html
-    class=missing>.face</a> TetGen's file format for simplicial facets.</li>
-    <li><a href="http://www.ann.jussieu.fr/frey/publications/RT-0253.pdf#page=33">.mesh</a> Medit's triangle surface mesh + tetrahedral volume mesh file format, see page 33, section 7.2.1</li>
-    <li><i>.node</i> List of points (vertices). Described identically (upto
-        accepted dimensions, use of attributes and boundary markers) by <a
-    href="https://www.cs.cmu.edu/~quake/triangle.node.html">Triangle</a>, <a
-    href=http://tetgen.berlios.de/fformats.node.html>TetGen</a>, and <a
-    href=http://www.cs.berkeley.edu/~jrs/stellar/#fileformats>Stellar</a>.
-    </li>
-    <li><a href="http://wias-berlin.de/software/tetgen/fformats.off.html">.off</a> Geomview's polyhedral file format</li>
-    <li><a
-    href="http://en.wikipedia.org/wiki/Wavefront_.obj_file#File_format">.obj</a>
-    Wavefront object file format. Usually unsafe to assume anything more than
-    vertex positions and triangle indices are supported</li>
-    <li><a href=http://en.wikipedia.org/wiki/PLY_%28file_format%29>.ply</a>
-    Polygon File Format, supporting ASCII and binary encoding</li>
-    <li><a
-    href=https://en.wikipedia.org/wiki/Portable_Network_Graphics>.png</a>
-    Portable Network Graphics image file. IGLLIB (in the libiglpng extra)
-  supports png image files via the <a href=https://github.com/yig/yimg>yimg</a>
-  library. Alpha channels and compression are supported.</li>
-    <li><i>.poly</i> Piecewise-linear complex. This format comes in many similar but importantly different flavors: 
-      <a href="https://www.cs.cmu.edu/~quake/triangle.poly.html">triangle's</a>, <a href="http://tetgen.berlios.de/fformats.poly.html">tetgen's</a>, <a href="http://sparse-meshing.com/svr/0.2.1/format-poly.html">pyramid/SVR's</a></li>
-    <li><a href=./rbr.html>.rbr</a> ASCII files for saving state of ReAntTweakBar</li>
-    <li><a href=http://en.wikipedia.org/wiki/STL_(file_format)>.stl</a> 3D Systems' CAD and 3D printing mesh file format. ASCII and binary versions.</li>
-    <li><a href=http://en.wikipedia.org/wiki/Truevision_TGA>.tga</a> Truevision TGA or TARGA image file format. IGLLIB supports only very basic reading and writing RGB/RGBA files without colormaps and (unverified) run-length compression.</li>
-    <li><a href="./tgf.html">.tgf</a> ASCII files for representing control handle graphs</li>
-    <li><a href="http://en.wikipedia.org/wiki/VRML#WRL_File_Format">.wrl</a>
-    VRML (Virtual Reality Modeling Language) file format for 3D scenes.</li>
-    <li><a href="./xml.html">.xml</a> XMLSerializer's file format containing the serialization of object data structures.</li>
-  </ul>
-  <h3>Triangle mesh file format performance</h3>
-  <p>
-  <a
-  href="http://en.wikipedia.org/wiki/Wavefront_.obj_file#File_format">.obj</a>
-  and <a href="http://tetgen.berlios.de/fformats.off.html">.off</a> file
-  formats support meshes with arbitrary polygon degrees. However, often we are
-  only working with triangle meshes. Further, .obj files do not have useful
-  headers revealing the number of elements. For triangle meshes, .off and .obj
-  are inferior file formats to the <a
-  href="http://www.ann.jussieu.fr/frey/publications/RT-0253.pdf#page=33">.mesh</a>
-  file format. The current (version 0.1.6) IO functions for these file formats perform as follows for reading and writing a 300,000 triangle mesh:
-  </p>
-  <pre><code>
-writeOBJ:  1.33742 secs
-writeOFF:  0.510111 secs
-writeMESH: 0.218139 secs
-
-readOBJ:   1.3782 secs
-readOFF:   0.691496 secs
-readMESH:  0.242315 secs
-  </code></pre>
-  <p>
-  This reveals that .mesh is 6.5x faster than .obj and about 2.5x faster than .off.
-  </p>
-  <p>
-  While .obj files support normals, it is typically much faster to (re)compute
-  normals from the geometry using <code>per_face_normals</code>,
-  <code>per_vertex_normals</code>, <code>per_corner_normals</code> than to read
-  and write them to files.</p>
-  <p>It gets even better if you're willing to use a nonstandard format. If your
-  triangle mesh is in (<code>V</code>,<code>F</code>) then you can read and
-  write those variables as dense matrices of doubles to 
-  <a href="./dmat.html">.dmat</a> uncompressed <strong>binary</strong> files.
-  This not only ensures perfect precision but also big speed ups. On that same
-  300,000 triangle mesh, .dmat achieves:</p>
-  <pre><code>
-writeDMAT: 0.0384338 secs
-
-readDMAT:  0.0117921 secs
-  </code></pre>
-  <p>This reveals that binary .dmat files are 34x/116x faster at writing and
-  reading than .obj and a hefty 5x/20x over .mesh. In this case it may pay to
-  compute normals once into <code>N</code> and also read and write it to a
-  .dmat file.</p>
-  </div>
-  </body>
-</html>

+ 0 - 34
file-formats/rbr.html

@@ -1,34 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <link rel='stylesheet' type='text/css' href='../style.css' >
-    <title>libigl file formats | .rbr</title>
-  </head>
-  <body class=article_outer>
-  <div  class=article_inner>
-    <a href=..><img src=../libigl-logo.jpg alt="igl logo" class=center></a>
-    <h1>.rbr - ReAntTweakbar state file</h1>
-    <hr>
-    <p>
-An .rbr file contains the saved values of the ReAntTweakBar class. It is used
-to load and save variables (and states specified via callbacks) stored in an
-AntTweakBar GUI.
-    </p>
-    <p>
-Each line contains the name of the AntTweakBar item, the type of item and the
-value as a string:
-    </p>
-    <pre><code>[name]: [type] [value]</code></pre>
-    <p>
-As per AntTweakBar's own advice, names should not contain spaces. Names should
-also not contain colons (':'). An example of a line looks like:
-    </p>
-    <pre><code>my_rotation: TW_TYPE_QUAT4 0.0111272 -0.00101157 0.00648534 -0.999917</code></pre>
-    <p>Not all AntTweakBar types are currently supported. See
-    <code>igl/ReAntTweakbar.h</code> for an up-to-date list of supported
-    types.</p>
-    <p>See also: <a href=.>file formats</a></p>
-  </div>
-  </body>
-</html>
-

+ 0 - 36
file-formats/tgf.html

@@ -1,36 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <link rel='stylesheet' type='text/css' href='../style.css' >
-    <title>libigl file formats | .tgf</title>
-  </head>
-  <body class=article_outer>
-  <div class=article_inner>
-    <a href=..><img src=../libigl-logo.jpg alt="igl logo" class=center></a>
-    <h1>.tgf - control handle graphs</h1>
-    <hr>
-    <p>
-A .tgf file contains a graph of describing a set of control handles/structures:
-point controls, bones of a skeleton and cages made of "cage edges".
-    </p>
-    <p>
-The first part of the file consists of lines regarding each vertex of the graph. Each line reads:
-    </p>
-    <pre><code>[index] [x] [y] [z] [undocument optional data]</code></pre>
-    <p>
-Indices begin with 1 and should proceed in order.
-Then there should be a line with a sole:
-    </p>
-    <pre><code>#</code></pre>
-    <p>
-The next section concerns the edges of the graph. Each line corresponds to an edge:
-    </p>
-    <pre><code>[source index] [dest index] [is bone] [is pseudo-edge] [is cage edge] [undocument other data]</code></pre>
-    <p>
-Bone edges trump pseudo and cage edges. 
-    </p>
-    <p>See also: <a href=.>file formats</a></p>
-  </div>
-  </body>
-</html>
-

+ 0 - 86
file-formats/xml.html

@@ -1,86 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <link rel='stylesheet' type='text/css' href='../style.css' >
-    <title>libigl file formats | .xml</title>
-  </head>
-  <body class=article_outer>
-  <div class=article_inner>
-    <a href=..><img src=../libigl-logo.jpg alt="igl logo" class=center></a>
-    <h1>.xml - serialization format</h1>
-    <hr>
-    <p>
-A .xml file contains the serialization of an object data structure generated with the XMLSerializer:
-    </p>
-    <p>
-The top level elements represent the groups in which the object are organised. The object names are unique within these groups.
-    </p>
-    <pre><code>&lt;group1&gt;
-  &lt;object1 val="value of object 1"/&gt;
-  &lt;object2 val="value of object 2"/&gt;
-&lt;/group1&gt;
-
-&lt;group2&gt;
-  &lt;object1 val="value of object 1"/&gt;
-&lt;/group2&gt;</code></pre>
-    <p>
-An object can be of following type:<br/>
-<br/>
-Basic types: <b>char, char*, std::string, bool, usigned int, int, float, double</b><br/>
-STL containers: <b>std::array, std::vector, std::pair</b><br/>
-Eigen types: <b>Eigen::Matrix, Eigen::SparseMatrix</b><br/>
-User defined types: <b>XMLSerializable*.</b><br/>
-<br/>
-There can also be a hierarchical structure like vector&lt;int&gt;, this will result in the following serialization:
-    </p>
-    <pre><code>&lt;group&gt;
-  &lt;vector size="3"&gt;
-    &lt;value0 val="1"/&gt;
-    &lt;value1 val="2"/&gt;
-    &lt;value2 val="3"/&gt;
-  &lt;/vector&gt;
-&lt;/group&gt;</code></pre>
-
-    <p>An example of a serialization of an instance of the class Test</p>
-    
-	<pre><code>class Test{
-  int var1;
-  vector&ltfloat&gt; vec1;  
-};</code></pre>
-
-<p> is shown here:</p>
-
-<pre><code>&lt;group&gt;
-  &lt;Test&gt;
-    &lt;var1 val="0"&gt;
-    &lt;vec1 size="2"&gt;
-      &lt;value0 val="1"/&gt;
-      &lt;value1 val="2"/&gt;
-    &lt;/vector&gt;
-  &lt;/Test&gt;
-&lt;/group&gt;</code></pre>
-
-<p>In the following we show the serialization of Eigen matrices.</p>
-
-<p>Eigen::Matrix&lt;int,4,3&gt;:</p>
-<pre><code>&lt;group&gt;
-  &lt;matrix row="4" col="3" matrix="
-1,2,3,
-4,5,6,
-7,8,9,
-10,11,12/&gt;
-&lt;/group&gt;</code></pre>
-
-<p>Eigen::SparseMatrix&lt;int&gt; (3x3 identity saved as triplets of the non-zero entries):</p>
-<pre><code>&lt;group&gt;
-  &lt;matrix row="3" col="3" matrix="
-0,0,1,
-1,1,1,
-2,2,1/&gt;
-&lt;/group&gt;</code></pre>
-
-    <p>See also: <a href=.>file formats</a></p>
-  </div>
-  </body>
-</html>
-

+ 0 - 317
matlab-to-eigen.html

@@ -1,317 +0,0 @@
-<html> <head>
-    <title>MATLAB to Eigen</title>
-    <link href="./style.css" rel="stylesheet" type="text/css">
-  </head>
-  <body>
-    <table>
-      <tr class="header">
-        <th>MATLAB</th>
-        <th>Eigen with libigl</th>
-        <th>Notes</th>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>[Y,IX] = sort(X,dim,mode)</code></pre></td>
-        <td><pre><code>igl::sort(X,dim,mode,Y,IX)</code></pre></td>
-        <td>MATLAB version allows Y to be a multidimensional matrix, but the
-        Eigen version is only for 1D or 2D matrices.</td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>B(i:(i+w),j:(j+h)) = A(x:(x+w),y:(y+h))</code></pre></td>
-        <td><pre><code>B.block(i,j,w,h) = A.block(i,j,w,h)</code></pre></td>
-        <td>MATLAB version would allow w and h to be non-positive since the
-        colon operator evaluates to a list of indices, but the Eigen version
-        needs non-negative width and height values.</td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>max(A(:))</code></pre></td>
-        <td><pre><code>A.maxCoeff()</code></pre></td>
-        <td>Find the maximum coefficient over all entries of the matrix.</td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>min(A(:))</code></pre></td>
-        <td><pre><code>A.minCoeff()</code></pre></td>
-        <td>Find the minimum coefficient over all entries of the matrix.</td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>eye(w,h)</code></pre></td>
-        <td><pre><code>MatrixXd::Identity(w,h), MatrixXf::Identity(w,h), etc.</code></pre></td>
-        <td></td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>A(i:(i+w),j:(j+h)) = eye(w,h)</code></pre></td>
-        <td><pre><code>A.block(i,j,w,h).setIdentity()</code></pre></td>
-        <td></td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>[I,J,V] = find(X)</code></pre></td>
-        <td><pre><code>igl::find(X,I,J,V)</code></pre></td>
-        <td>Matlab supports finding subscripts (I and J) as well as indices
-        (just I), but so far igl::find only supports subscripts. Also,
-        igl::find requires X to be sparse.</td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>X(:,j) = X(:,j) + x</code></pre></td>
-        <td><pre><code>X.col(j).array() += x</code></pre></td>
-        <td></td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>Acol_sum = sum(A,1)<br>Arow_sum = sum(A,2)<br>Adim_sum = sum(Asparse,dim)</code></pre></td>
-        <td><pre><code>Acol_sum = A.colwise().sum()<br>Arow_sum = A.rowwise().sum()<br>igl::sum(Asparse,dim,Adim_sum)</code></pre></td>
-        <td>Currently the igl version only supports sparse matrix input (and
-            dim must be 1 or 2).<br>
-            For sparse matrices, one could use
-            <code>A*Matrix&lt;Atype,Dynamic,1&gt;::Ones(A.cols(),1);</code> but this
-            will <b>not</b> work as expected for
-            <code>SparseMatrix&lt;bool&gt;</code>.
-        </td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>D = diag(M)</code></pre></td>
-        <td><pre><code>igl::diag(M,D)</code></pre></td>
-        <td>Extract the main diagonal of a matrix. Currently igl version
-        supports sparse only.</td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>M = diag(D)</code></pre></td>
-        <td><pre><code>igl::diag(D,M)</code></pre></td>
-        <td>Construct new square matrix M with entries of vector D along the
-        diagonal. Currently igl version supports sparse only. Might also
-        consider simply: <code>M = D.asDiagonal();</code></td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>[Y,I] = max(X,[],dim)</code></pre></td>
-        <td id=mat_max><pre><code>igl::mat_max(X,dim,Y,I)</code></pre></td>
-        <td>Matlab has a bizarre convention of passing [] as the second
-          argument to mean take the max/min along dimension dim.</td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>Y = max(X,[],1)<br>Y = max(X,[],2)<br>Y = min(X,[],1)<br>Y = min(X,[],2)</code></pre></td>
-        <td><pre><code>Y = X.colwise().maxCoeff()<br>Y = X.rowwise().maxCoeff()<br>Y = X.colwise().minCoeff()<br>Y = X.rowwise().minCoeff()</code></pre></td>
-        <td>Matlab allows you to obtain the indices of extrema see <a href=#mat_max>mat_max</a></td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>C = A.*B</code></pre></td>
-        <td><pre><code>C = (A.array() * B.array()).matrix()</code></pre></td>
-        <td></td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>C = A.^b</code></pre></td>
-        <td><pre><code>C = A.array().pow(b).matrix()</code></pre></td>
-        <td></td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>A(B == 0) = C(B==0)</code></pre></td>
-        <td><pre><code>A = (B.array() == 0).select(C,A)</code></pre></td>
-        <td></td>
-      </tr>
-
-      <tr class=gotcha1>
-        <td><pre><code>C = A + B'</code></pre></td>
-        <td><pre><code>SparseMatrixType BT = B.transpose()<br>SparseMatrixType C = A+BT;</code></pre></td>
-        <td>Do <b>not</b> attempt to combine .transpose() in expression like
-        this: <pre><code>C = A + B.transpose()</code></pre></td>
-      </tr>
-
-      <tr class=gotcha2>
-        <td><pre><code>[L,p] = chol(A)</code></pre></td>
-        <td><pre><code>SparseLLT&lt;SparseMatrixType&gt; A_LLT(A.template triangularView&lt;Lower&gt;())<br>SparseMatrixType L = A_LLT.matrixL();bool p = (L*0).eval().nonZeros()==0;</code></pre></td>
-        <td>Do <b>not</b> attempt to use A in constructor of A_LLT like
-        this: <pre><code>SparseLLT&lt;SparseMatrixType&gt; A_LLT(A)</code></pre><br>
-        Do <b>not</b> attempt to use A_LLT.succeeded() to determine if Cholesky
-        factorization succeeded, like this:
-        <pre><code>bool p = A_LLT.succeeded()</code></pre>
-        </td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>X = U\(L\b)</code></pre></td>
-        <td><pre><code>X = b;<br>L.template triangularView&lt;Lower&gt;().solveInPlace(X);<br>U.template triangularView&lt;Upper&gt;().solveInPlace(X);</code></pre></td>
-        <td>Expects that L and U are lower and upper triangular matrices
-        respectively</td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>B = repmat(A,i,j)</code></pre></td>
-        <td><pre><code>igl::repmat(A,i,j,B);
-B = A.replicate(i,j);</code></pre></td>
-        <td>igl::repmat is also implemented for Sparse Matrices.
-        </td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>I = low:step:hi</code></pre></td>
-        <td><pre><code>igl::colon(low,step,hi,I);
-// or
-const int size = ((hi-low)/step)+1;
-I = VectorXi::LinSpaced(size,low,low+step*(size-1));</code></pre></td>
-        <td>IGL version should be templated enough to handle same situations as
-        matlab's colon. The matlab keyword <b>end</b> does not correspond in
-        the C++ version. You'll have to use M.size(),M.rows() or whatever.
-        </td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>O = ones(m,n)</code></pre></td>
-        <td><pre><code>Matrix* O = Matrix*::Ones(m,n)</code></pre></td>
-        <td></td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>O = zeros(m,n)</code></pre></td>
-        <td><pre><code>Matrix* O = Matrix*::Zero(m,n)</code></pre></td>
-        <td></td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>B = A(I,J)<br>B = A(I,:)</code></pre></td>
-        <td><pre><code>igl::slice(A,I,J,B)<br>igl::slice(A,I,1,B)</code></pre></td>
-        <td>This is only for the case when I and J are lists of indices and
-        not vectors of logicals.</td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>B(I,J) = A<br>B(I,:) = A</code></pre></td>
-        <td><pre><code>igl::slice_into(A,I,J,B)<br>igl::slice_into(A,I,1,B)</code></pre></td>
-        <td>This is only for the case when I and J are lists of indices and
-        not vectors of logicals.</td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>M = mode(X,dim)</code></pre></td>
-        <td><pre><code>igl::mode(X,dim,M)</code></pre></td>
-        <td></td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>B = arrayfun(FUN, A)</code></pre></td>
-        <td><pre><code>B = A.unaryExpr(ptr_fun(FUN))</code></pre></td>
-        <td>If FUN is templated, the templates must be fully resolved.</td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>B = fliplr(A)<br>B = flipud(A)</code></pre></td>
-        <td><pre><code>B = A.rowwise().reverse().eval()<br>B =
-	A.colwise().reverse().eval()</code></pre></td>
-        <td>The <code>.eval()</code> is not necessary if A != B</td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>B = IM(A)
-
-A = IM(A);
-  </code></pre></td>
-        <td><pre><code>B = A.unaryExpr(bind1st(mem_fun( 
-  static_cast&lt;VectorXi::Scalar&amp;(VectorXi::*)(VectorXi::Index)&gt;
-  (&amp;VectorXi::operator())), &amp;IM)).eval();
-// or
-for_each(A.data(),A.data()+A.size(),[&amp;IM](int &amp; a){a=IM(a);});
-  </code></pre></td>
-        <td>Where IM is an "index map" column vector and A is an arbitrary
-        matrix. The <code>.eval()</code> is not necessary if A != B, but then
-        the second option should be used.</td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>A = sparse(I,J,V)</code></pre></td>
-        <td><pre><code>// build std::vector&ltEigen::Triplet&gt; IJV
-A.setFromTriplets(IJV);
-        </code></pre></td>
-        <td>IJV and A should not be empty! (this might be fixed)</td>
-      </tr>
-
-
-      <tr class=d0>
-        <td><pre><code>A = min(A,c);</code></pre></td>
-        <td><pre><code>C.array() = A.array().min(c);
-        </code></pre></td>
-        <td>Coefficient-wise minimum of matrix and scalar (or matching size matrix)</td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>I=1:10;
-...
-IP = I(P==0);</code></pre></td>
-        <td><pre><code>I = VectorXi::LinSpaced(10,0,9);
-...
-VectorXi IP = I;
-IP.conservativeResize(stable_partition(
-  IP.data(), 
-  IP.data()+IP.size(), 
-  [&amp;P](int i){return P(i)==0;})-IP.data());
-        </code></pre></td>
-        <td>Where I is a vector of increasing indices from 0 to n, and P is a vector. <i>Requires C++11 and <code>#include &lt;algorithm&gt;</code></i></td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>B = A(R&lt;2,C&gt;1);</code></pre>
-        <td><pre><code>B = igl::slice_mask(A,R.array()&lt;2,C.array()&gt;1);</code></pre>
-        <td></td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>a = any(A(:))</code></pre></td>
-        <td><pre><code><del>bool a = any_of(A.data(),A.data()+A.size(),[](bool a){ return a;});</del>
-bool a = A.array().any();
-        </code></pre></td>
-        <td>Casts <code>Matrix::Scalar<code> to <code>bool</code>.</td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>B = mod(A,2)</code></pre></td>
-        <td><pre><code>igl::mod(A,2,B)</code></pre></td>
-        <td></td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>[IA,LOCB] = ismember(A,B)</code></pre></td>
-        <td><pre><code>igl::ismember(A,B,IA,LOCB)</code></pre></td>
-        <td></td>
-      </tr>
-
-      <tr class=d0>
-        <td><pre><code>A = A - diag(diag(A));</code></pre></td>
-        <td><pre><code>A.prune([](const int r, const int c, const Scalar)-&gt;bool{return r!=c;});</code></pre></td>
-        <td>Remove the diagonal from a sparse matrix.</td>
-      </tr>
-
-      <tr class=d1>
-        <td><pre><code>A = A - diag(diag(A));</code></pre></td>
-        <td><pre><code>A.prune([](const int r, const int c, const Scalar)-&gt;bool{return r!=c;});</code></pre></td>
-        <td>Remove the diagonal from a sparse matrix.</td>
-      </tr>
-
-      <!-- Insert rows for each command pair -->
-
-      <!-- Leave this here for copy and pasting
-
-      <tr class=d0>
-        <td><pre><code>Matlab code</code></pre></td>
-        <td><pre><code>Eigen code</code></pre></td>
-        <td>Notes</td>
-      </tr>
-
-      -->
-
-    </table>
-    <a href="http://eigen.tuxfamily.org/dox/AsciiQuickReference.txt">Eigen's
-    "ASCII Quick Reference" with MATLAB translations</a>
-    <br>
-    <a href="./tutorial.html">IGL Lib Tutorial</a>
-  </body>
-</html>

+ 49 - 0
mkdocs.yml

@@ -0,0 +1,49 @@
+site_name: libigl
+theme:
+  name: material
+  logo:
+    icon: 'details'
+  palette:
+    primary: 'light blue'
+    accent: 'blue'
+markdown_extensions:
+  - codehilite
+  - markdown.extensions.toc:
+      permalink: true
+  - pymdownx.arithmatex
+  - pymdownx.betterem:
+      smart_enable: all
+  - pymdownx.caret
+  - pymdownx.critic
+  - pymdownx.details
+  - pymdownx.inlinehilite
+  - pymdownx.magiclink
+  - pymdownx.mark
+  - pymdownx.smartsymbols
+  - pymdownx.superfences
+  - pymdownx.tasklist:
+      custom_checkbox: true
+  - pymdownx.tilde
+extra_javascript:
+  - 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-MML-AM_CHTML'
+pages:
+    - Home: index.md
+    - Tutorial:
+      - "Chapter 1: Introduction to libig": tutorial/chapter-1.md
+      - "Chapter 2: Discrete Geometric Quantities and Operators": tutorial/chapter-2.md
+      - "Chapter 3: Matrices and Linear Algebra": tutorial/chapter-3.md
+      - "Chapter 4: Shape Deformation": tutorial/chapter-4.md
+      - "Chapter 5: Parametrization": tutorial/chapter-5.md
+      - "Chapter 6: External libraries": tutorial/chapter-6.md
+      - "Chapter 7: Miscellaneous": tutorial/chapter-7.md
+      - "Chapter 8: Outlook for continuing development": tutorial/chapter-8.md
+    - Contributing:
+      - Style Guidelines: style-guidelines.md
+      - Bug Report: CONTRIBUTING.md
+      - Creating a Pull Request: before-submitting-pull-request.md
+    - Misc:
+      - Coding Tips: coding-guidelines.md
+    - FAQ: faq.md
+    - About:
+      - Release History: RELEASE_HISTORY.md
+      - License: LICENSE.md

+ 0 - 392
style-guidelines.html

@@ -1,392 +0,0 @@
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
-<head>
-	<meta charset="utf-8"/>
-	<title>libigl</title>
-	<meta name="author" content="Alec Jacobson and Daniele Panozzo and others"/>
-	<link type="text/css" rel="stylesheet" href="tutorial/style.css"/>
-<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> <link rel='stylesheet' href='http://yandex.st/highlightjs/7.3/styles/default.min.css'> <script src='http://yandex.st/highlightjs/7.3/highlight.min.js'></script> <script>hljs.initHighlightingOnLoad();</script>
-</head>
-<body>
-
-<h1 id="libiglstyleguidelines">Libigl Style Guidelines</h1>
-
-<p>Libigl is used and developed by many people. This document highlights some
-style guidelines for <em>developers</em> of the library, but also acts as
-best-practices for users.</p>
-
-<h2 id="filefunction">One function, one .h/.cpp pair </h2>
-
-<p>The structure of libigl is very flat and function-based. For every
-function/sub-routine, create a single .h and .cpp file. For example, if you have
-a function that determines connected components from a face list <code>F</code> you would
-create the header <code>connected_components.h</code> and <code>connected_components.cpp</code> and the only
-function defined should be <code>void connected_components(const ... F, ... C)</code>. If the
-implementation of <code>connected_components</code> requires a subroutine to compute an
-adjacency matrix then <em>create another pair</em> <code>adjacency_matrix.h</code> and
-<code>adjacency_matrix.cpp</code> with a single function <code>void adjacency_matrix(const ... F, ... A)</code>.</p>
-
-<h3 id="example">Example</h3>
-
-<p>Here is an example function that would be defined in
-<code>include/igl/example_fun.h</code> and implemented in <code>include/igl/example_fun.cpp</code>.</p>
-
-<h4 id="example_fun.h"><code>example_fun.h</code></h4>
-
-<pre><code class="cpp">// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 [Your Name] [your email address]
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/
-#ifndef IGL_EXAMPLE_FUN_H
-#define IGL_EXAMPLE_FUN_H
-
-#include &quot;igl_inline.h&quot;
-
-namespace igl
-{
-  // This is an example of a function, it takes a templated parameter and
-  // shovels it into cout
-  //
-  // Input:
-  //   input  some input of a Printable type
-  // Returns true for the sake of returning something
-  template &lt;typename Printable&gt;
-  IGL_INLINE bool example_fun(const Printable &amp; input);
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#include &quot;example_fun.cpp&quot;
-#endif
-
-#endif
-</code></pre>
-
-<h4 id="example_fun.cpp"><code>example_fun.cpp</code></h4>
-
-<pre><code>// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 [Your Name] [your email address]
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/
-#include &quot;igl/example_fun.h&quot;
-#include &lt;iostream&gt;
-
-template &lt;typename Printable&gt;
-IGL_INLINE bool igl::example_fun(const Printable &amp; input)
-{
-  using namespace std;
-  cout&lt;&lt;&quot;example_fun: &quot;&lt;&lt;input&lt;&lt;endl;
-  return true;
-}
-
-#ifdef IGL_STATIC_LIBRARY
-template bool igl::example_fun&lt;double&gt;(const double&amp; input);
-template bool igl::example_fun&lt;int&gt;(const int&amp; input);
-#endif
-</code></pre>
-
-<h3 id="avoidstatichelperfunctions">Avoid static &#8220;helper&#8221; functions</h3>
-
-<p>Strive to encapsulate sub-functions that could possibly be useful outside of
-the implementation of your current function. This might mean abstracting the
-interface a bit. If it doesn&#8217;t dramatically effect performance then create a
-new pair of .h/.cpp files with this sub-function.</p>
-
-<h4 id="lambdafunctions">Lambda functions</h4>
-
-<p>If encapsulation in a separate file is not possible or does not make sense,
-then avoid crowding the namespace by creating lambda functions within the
-function implementation.</p>
-
-<p>These lambda functions must still be documented with clear <a href="#headerdocumentation">input and output
-arguments</a>. Avoid using full capturing of all automatic
-variables: do not use <code>[&amp;]</code> or <code>[=]</code>. Rather specify each captured variable
-individually.</p>
-
-<h3 id="avoidhelperclasses">Avoid &#8220;helper&#8221; classes</h3>
-
-<p>Libigl is built around the high-performance paradigm of &#8220;struct of arrays&#8221;
-rather than &#8220;array of structs&#8221;. The way we achieve this is to avoid classes and
-pass &#8220;basic types&#8221; directly. The price we pay is long function interfaces, but
-this increases code reuse dramatically. A &#8220;basic type&#8221; in our context is a
-Eigen type, stl type, or basic C type.</p>
-
-<h2 id="headerdocumentation">Header Documentation</h2>
-
-<p>Each function prototype should be well documented in its corresponding .h
-header file. A typical documentation consists of four parts:</p>
-
-<pre><code class="cpp">// [A human readable description of what the function does.]
-//
-// Inputs:
-//   [variable name of first (const) input]   [dimensions and description of
-//     this input variable]
-//   [variable name of second (const) input]   [dimensions and description of
-//     this input variable]
-//   ...
-// Outputs:
-//   [variable name of first output ]   [dimensions and description of this
-//     output variable]
-//   [variable name of second output ]   [dimensions and description of this
-//     output variable]
-//   ...
-// Returns [description of return value]
-</code></pre>
-
-<h3 id="example">Example</h3>
-
-<p>For example the header <code>barycenter.h</code></p>
-
-<pre><code>// Computes the barycenter of every simplex
-//
-// Inputs:
-//   V  #V by dim matrix of vertex coordinates
-//   F  #F by simplex_size  matrix of indices of simplex corners into V
-// Output:
-//   BC  #F by dim matrix of 3d vertices
-//
-</code></pre>
-
-<h2 id="constinputs">Const inputs</h2>
-
-<p>All input parameters should be demarcated <code>const</code>. If an input is also an
-output than consider exposing two parameters (one <code>const</code>) or be sure to list
-the variable under both <code>// Inputs:</code> and <code>// Outputs:</code> in the header comments.</p>
-
-<h2 id="referenceparameters">Reference parameters</h2>
-
-<p>All but simple types should be passed by reference (e.g. <code>Matrix &amp; mat</code>) rather
-than pointers (e.g. <code>Matrix * mat</code>) or value (e.g. <code>Matrix mat</code>).</p>
-
-<h2 id="returnsvsoutputparameters">Returns vs output parameters</h2>
-
-<p>All functions should be implemented with at least one overload that has a
-<code>void</code> or simple return type (e.g. <code>bool</code> on success/failure). With this
-implementation its then possible to write an overload that returns a single
-output. Please see <a href="#templatingwitheigen">Templating with Eigen</a>.</p>
-
-<p>For example:</p>
-
-<pre><code class="cpp">template &lt;typename Atype&gt;
-void adjacency_matrix(const ... &amp; F, Eigen::SparseMatrix&lt;AType&gt; &amp; A);
-
-template &lt;typename Atype&gt;
-Eigen::SparseMatrix&lt;Atype&gt; adjacency_matrix(const ... &amp; F);
-</code></pre>
-
-<h2 id="templatingwitheigen">Templating with Eigen</h2>
-
-<p>Functions taking Eigen dense matrices/arrays as inputs and outputs (but <strong>not</strong>
-return arguments), should template on top of <code>Eigen::MatrixBase</code>. <strong>Each
-parameter</strong> should be derived using its own template.</p>
-
-<p>For example,</p>
-
-<pre><code class="cpp">template &lt;typename DerivedV, typename DerivedF, typename DerivedBC&gt;
-void barycenter(
-  const Eigen::MatrixBase&lt;DerivedV&gt; &amp; V,
-  const Eigen::MatrixBase&lt;DerivedF&gt; &amp; F,
-  const Eigen::MatrixBase&lt;DerivedBC&gt; &amp; BC);
-</code></pre>
-
-<p>The <code>Derived*</code> template encodes the scalar type (e.g. <code>double</code>, <code>int</code>), the
-number of rows and cols at compile time, and the data storage (Row-major vs.
-column-major).</p>
-
-<p>Returning Eigen types is discouraged. In cases where the size and scalar type
-are a fixed <strong>and matching</strong> function of an input <code>Derived*</code> template, then
-return that <code>Derived*</code> type. <strong>Do not</strong> return
-<code>Eigen::PlainObjectBase&lt;...&gt;</code> types. For example, this function scales fits a
-given set of points to the unit cube. The return is a new set of vertex
-positions so its type should <em>match</em> that of the input points:</p>
-
-<pre><code class="cpp">template &lt;typename DerivedV&gt;
-void DerivedV fit_to_unit_cube(const Eigen::PlainObjectBase&lt;DerivedV&gt; &amp; V);
-</code></pre>
-
-<p>To implement this function, it is <strong>required</strong> to implement a more generic
-output-argument version and call that. So a full implementation looks like:</p>
-
-<p>In <code>igl/fit_in_unit_cube.h</code>:</p>
-
-<pre><code class="cpp">template &lt;typename DerivedV, typename DerivedW&gt;
-void fit_to_unit_cube(
-  const Eigen::MatrixBase&lt;DerivedV&gt; &amp; V,
-  Eigen::PlainObjectBase&lt;DerivedW&gt; &amp; W);
-template &lt;typename DerivedV&gt;
-void DerivedV fit_to_unit_cube(const Eigen::PlainObjectBase&lt;DerivedV&gt; &amp; V);
-</code></pre>
-
-<p>In <code>igl/fit_in_unit_cube.cpp</code>:</p>
-
-<pre><code>template &lt;typename DerivedV, typename DerivedW&gt;
-void fit_to_unit_cube(
-  const Eigen::MatrixBase&lt;DerivedV&gt; &amp; V,
-  Eigen::PlainObjectBase&lt;DerivedW&gt; &amp; W)
-{
-  W = (V.rowwise()-V.colwise().minCoeff()).array() /
-    (V.maxCoeff()-V.minCoeff());
-}
-
-template &lt;typename DerivedV&gt;
-void DerivedV fit_to_unit_cube(const Eigen::MatrixBase&lt;DerivedV&gt; &amp; V)
-{
-  DerivedV W;
-  fit_to_unit_cube(V,W);
-  return W;
-}
-</code></pre>
-
-<p>Notice that <code>W</code> is declared as a <code>DerivedV</code> type and <strong>not</strong>
-<code>Eigen::PlainObjectBase&lt;DerivedV&gt;</code> type.</p>
-
-<p><strong>Note:</strong> Not all functions are suitable for returning Eigen types. For example
-<code>igl::barycenter</code> above outputs a #F by dim list of barycenters. Returning a
-<code>DerivedV</code> type would be inappropriate since the number of rows in <code>DerivedV</code>
-will be #V and may not match the number of rows in <code>DerivedF</code> (#F).</p>
-
-<h2 id="functionnamingconventions">Function naming conventions</h2>
-
-<p>Functions (and <a href="#filefunction">thus also files</a>) should have simple,
-descriptive names using lowercase letters and underscores between words. Avoid
-unnecessary prefaces. For example, instead of <code>compute_adjacency_matrix</code>,
-<code>construct_adjacency_matrix</code>, <code>extract_adjacency_matrix</code>,
-<code>get_adjacency_matrix</code>, or <code>set_adjacency_matrix</code> just call the function
-<code>adjacency_matrix</code>.</p>
-
-<h2 id="variablenamingconventions">Variable naming conventions</h2>
-
-<p>Libigl prefers short (even single character) variable names <em>with heavy
-documentation</em> in the comments in the header file or above the declaration of
-the function. When possible use <code>V</code> to mean a list of vertex positions and <code>F</code>
-to mean a list of faces/triangles.</p>
-
-<h2 id="classnamingconventions">Class naming conventions</h2>
-
-<p>Classes should be avoided. When naming a class use CamelCase (e.g.
-SortableRow.h).</p>
-
-<h2 id="enumnamingconversion">Enum naming conversion</h2>
-
-<p>Enums types should be placed in the appropriate <code>igl::</code> namespace and should be
-named in CamelCase (e.g. <code>igl::SolverStatus</code>) and instances should be named in
-ALL_CAPS with underscores between words and prefaced with the name of the enum.
-For example:</p>
-
-<pre><code class="cpp">namespace igl
-{
-  enum SolverStatus
-  {
-    // Good
-    SOLVER_STATUS_CONVERGED = 0,
-    // OK
-    SOLVER_STATUS_MAX_ITER = 1,
-    // Bad
-    SOLVER_STATUS_ERROR = 2,
-    NUM_SOLVER_STATUSES = 3,
-  };
-};
-</code></pre>
-
-<h3 id="exceptionforfileio">Exception for file IO</h3>
-
-<p>For legacy reasons, file reading and writing functions use a different naming
-convention. A functions reading a <code>.xyz</code> file should be named <code>readXYZ</code> and a
-function writing <code>.xyz</code> files should be names <code>writeXYZ</code>.</p>
-
-<h2 id="usingnamespace...inglobalscope"><code>using namespace ...</code> in global scope</h2>
-
-<p>Writing <code>using namespace std;</code>, <code>using namespace Eigen;</code> etc. outside of a
-global scope is strictly forbidden. Place these lines at the top of each
-function instead.</p>
-
-<h2 id="namespacesandexternaldependencies">Namespaces and external dependencies</h2>
-
-<p>Functions in the main library (directly in <code>include/igl</code>) should only depend on
-Eigen and stl. These functions should have the <code>igl::</code> namespace.</p>
-
-<p>Functions with other dependencies should be placed into
-appropriate sub-directories (e.g. if <code>myfunction</code> depends on tetgen then create
-<code>igl/copyleft/tetgen/myfunction.h</code> and <code>igl/copyleft/tetgen/myfunction.cpp</code> and give the function
-the namespace <code>igl::copyleft::tetgen::myfunction</code>.</p>
-
-<h3 id="copyleftsubdirectorynamespace">copyleft subdirectory/namespace</h3>
-
-<p>Dependencies that require users of libigl to release their projects open source
-(e.g. GPL) are considered aggressively &#8220;copyleft&#8221; and should be placed in the
-<code>include/igl/copyleft/</code> sub-directory and <code>igl::copyleft::</code> namespace.</p>
-
-<h2 id="assertions">Assertions</h2>
-
-<p>Be generous with assertions and always identify the assertion with strings:</p>
-
-<pre><code class="cpp">assert(m &lt; n &amp;&amp; &quot;m must be less than n&quot;);
-</code></pre>
-
-<h2 id="ifndefincludeguard">ifndef include guard</h2>
-
-<p>Every header file should be wrapped in an <code>#ifndef</code> compiler directive. The
-name of the guard should be in direct correspondence with the path of the .h
-file. For example, <code>include/igl/copyleft/tetgen/tetrahedralize.h</code> should be</p>
-
-<pre><code class="cpp">#ifndef IGL_COPYLEFT_TETGEN_TETRAHEDRALIZE_H
-#define IGL_COPYLEFT_TETGEN_TETRAHEDRALIZE_H
-...
-#endif
-</code></pre>
-
-<h2 id="spacesvs.tabsindentation">Spaces vs. tabs indentation</h2>
-
-<p>Do not use tabs. Use 2 spaces for each indentation level.</p>
-
-<h2 id="maxlinelength">Max line length</h2>
-
-<p>Limit lines to 80 characters. Break up long lines into many operations (this
-also helps performance).</p>
-
-<h2 id="includeorder">Include order</h2>
-
-<p><code>#include</code> directives at the top of a .h or .cpp file should be sorted
-according to a simple principle: place headers of files most likely to be
-edited by you first. This means for
-<code>include/igl/copyleft/tetgen/tetrahedralize.cpp</code> you might see</p>
-
-<pre><code class="cpp">// [Includes of headers in this directory]
-#include &quot;tetrahedralize.h&quot;
-#include &quot;mesh_to_tetgenio.h&quot;
-#include &quot;tetgenio_to_tetmesh.h&quot;
-// [Includes of headers in this project]
-#include &quot;../../matrix_to_list.h&quot;
-#include &quot;../../list_to_matrix.h&quot;
-#include &quot;../../boundary_facets.h&quot;
-// [Includes of headers of related projects]
-#include &lt;Eigen/Core&gt;
-// [Includes of headers of standard libraries]
-#include &lt;cassert&gt;
-#include &lt;iostream&gt;
-</code></pre>
-
-<h2 id="placementofincludes">Placement of includes</h2>
-
-<p>Whenever possible <code>#include</code> directives should be placed in the <code>.cpp</code>
-implementation file rather than the <code>.h</code> header file.</p>
-
-<h2 id="warnings">Warnings</h2>
-
-<p>Code should compile without firing any warnings.</p>
-
-<h3 id="anexception">An Exception</h3>
-
-<p>The only exception is for the use of the deprecated
-<code>Eigen::DynamicSparseMatrix</code> in core sub-routines (e.g. <code>igl::cat</code>). This class
-is still supported and faster than the standard, non-deprecated Eigen
-implementation so we&#8217;re keeping it as long as possible and profitable.</p>
-
-</body>
-</html>
-

+ 0 - 392
style-guidelines.md

@@ -1,392 +0,0 @@
-# Libigl Style Guidelines
-
-Libigl is used and developed by many people. This document highlights some
-style guidelines for _developers_ of the library, but also acts as
-best-practices for users.
-
-## One function, one .h/.cpp pair [filefunction]
-
-The structure of libigl is very flat and function-based. For every
-function/sub-routine, create a single .h and .cpp file. For example, if you have
-a function that determines connected components from a face list `F` you would
-create the header `connected_components.h` and `connected_components.cpp` and the only
-function defined should be `void connected_components(const ... F, ... C)`. If the
-implementation of `connected_components` requires a subroutine to compute an
-adjacency matrix then _create another pair_ `adjacency_matrix.h` and
-`adjacency_matrix.cpp` with a single function `void adjacency_matrix(const ... F, ... A)`.
-
-### Example
-Here is an example function that would be defined in
-`include/igl/example_fun.h` and implemented in `include/igl/example_fun.cpp`.
-
-#### `example_fun.h`
-
-```cpp
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 [Your Name] [your email address]
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/
-#ifndef IGL_EXAMPLE_FUN_H
-#define IGL_EXAMPLE_FUN_H
-
-#include "igl_inline.h"
-
-namespace igl
-{
-  // This is an example of a function, it takes a templated parameter and
-  // shovels it into cout
-  //
-  // Input:
-  //   input  some input of a Printable type
-  // Returns true for the sake of returning something
-  template <typename Printable>
-  IGL_INLINE bool example_fun(const Printable & input);
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "example_fun.cpp"
-#endif
-
-#endif
-```
-
-#### `example_fun.cpp`
-
-```
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 [Your Name] [your email address]
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/
-#include "igl/example_fun.h"
-#include <iostream>
-
-template <typename Printable>
-IGL_INLINE bool igl::example_fun(const Printable & input)
-{
-  using namespace std;
-  cout<<"example_fun: "<<input<<endl;
-  return true;
-}
-
-#ifdef IGL_STATIC_LIBRARY
-template bool igl::example_fun<double>(const double& input);
-template bool igl::example_fun<int>(const int& input);
-#endif
-```
-
-
-### Avoid static "helper" functions
-
-Strive to encapsulate sub-functions that could possibly be useful outside of
-the implementation of your current function. This might mean abstracting the
-interface a bit. If it doesn't dramatically effect performance then create a
-new pair of .h/.cpp files with this sub-function.
-
-#### Lambda functions
-
-If encapsulation in a separate file is not possible or does not make sense,
-then avoid crowding the namespace by creating lambda functions within the
-function implementation.
-
-These lambda functions must still be documented with clear [input and output
-arguments](#headerdocumentation). Avoid using full capturing of all automatic
-variables: do not use `[&]` or `[=]`. Rather specify each captured variable
-individually.
-
-### Avoid "helper" classes
-
-Libigl is built around the high-performance paradigm of "struct of arrays"
-rather than "array of structs". The way we achieve this is to avoid classes and
-pass "basic types" directly. The price we pay is long function interfaces, but
-this increases code reuse dramatically. A "basic type" in our context is a
-Eigen type, stl type, or basic C type.
-
-## Header Documentation
-
-Each function prototype should be well documented in its corresponding .h
-header file. A typical documentation consists of four parts:
-
-```cpp
-// [A human readable description of what the function does.]
-//
-// Inputs:
-//   [variable name of first (const) input]   [dimensions and description of
-//     this input variable]
-//   [variable name of second (const) input]   [dimensions and description of
-//     this input variable]
-//   ...
-// Outputs:
-//   [variable name of first output ]   [dimensions and description of this
-//     output variable]
-//   [variable name of second output ]   [dimensions and description of this
-//     output variable]
-//   ...
-// Returns [description of return value]
-```
-
-### Example
-
-For example the header `barycenter.h`
-
-```
-// Computes the barycenter of every simplex
-//
-// Inputs:
-//   V  #V by dim matrix of vertex coordinates
-//   F  #F by simplex_size  matrix of indices of simplex corners into V
-// Output:
-//   BC  #F by dim matrix of 3d vertices
-//
-```
-
-## Const inputs
-
-All input parameters should be demarcated `const`. If an input is also an
-output than consider exposing two parameters (one `const`) or be sure to list
-the variable under both `// Inputs:` and `// Outputs:` in the header comments.
-
-## Reference parameters
-
-All but simple types should be passed by reference (e.g. `Matrix & mat`) rather
-than pointers (e.g. `Matrix * mat`) or value (e.g. `Matrix mat`).
-
-
-## Returns vs output parameters
-
-All functions should be implemented with at least one overload that has a
-`void` or simple return type (e.g. `bool` on success/failure). With this
-implementation its then possible to write an overload that returns a single
-output. Please see [Templating with Eigen](#templatingwitheigen).
-
-For example:
-
-```cpp
-template <typename Atype>
-void adjacency_matrix(const ... & F, Eigen::SparseMatrix<AType> & A);
-
-template <typename Atype>
-Eigen::SparseMatrix<Atype> adjacency_matrix(const ... & F);
-```
-
-## Templating with Eigen
-
-Functions taking Eigen dense matrices/arrays as inputs and outputs (but **not**
-return arguments), should template on top of `Eigen::MatrixBase`. **Each
-parameter** should be derived using its own template.
-
-For example,
-
-```cpp
-template <typename DerivedV, typename DerivedF, typename DerivedBC>
-void barycenter(
-  const Eigen::MatrixBase<DerivedV> & V,
-  const Eigen::MatrixBase<DerivedF> & F,
-  const Eigen::MatrixBase<DerivedBC> & BC);
-```
-
-The `Derived*` template encodes the scalar type (e.g. `double`, `int`), the
-number of rows and cols at compile time, and the data storage (Row-major vs.
-column-major). 
-
-Returning Eigen types is discouraged. In cases where the size and scalar type
-are a fixed **and matching** function of an input `Derived*` template, then
-return that `Derived*` type. **Do not** return
-`Eigen::PlainObjectBase<...>` types. For example, this function scales fits a
-given set of points to the unit cube. The return is a new set of vertex
-positions so its type should _match_ that of the input points:
-
-```cpp
-template <typename DerivedV>
-void DerivedV fit_to_unit_cube(const Eigen::PlainObjectBase<DerivedV> & V);
-```
-
-To implement this function, it is **required** to implement a more generic
-output-argument version and call that. So a full implementation looks like:
-
-In `igl/fit_in_unit_cube.h`:
-
-```cpp
-template <typename DerivedV, typename DerivedW>
-void fit_to_unit_cube(
-  const Eigen::MatrixBase<DerivedV> & V,
-  Eigen::PlainObjectBase<DerivedW> & W);
-template <typename DerivedV>
-void DerivedV fit_to_unit_cube(const Eigen::PlainObjectBase<DerivedV> & V);
-```
-
-In `igl/fit_in_unit_cube.cpp`:
-
-```
-template <typename DerivedV, typename DerivedW>
-void fit_to_unit_cube(
-  const Eigen::MatrixBase<DerivedV> & V,
-  Eigen::PlainObjectBase<DerivedW> & W)
-{
-  W = (V.rowwise()-V.colwise().minCoeff()).array() /
-    (V.maxCoeff()-V.minCoeff());
-}
-
-template <typename DerivedV>
-void DerivedV fit_to_unit_cube(const Eigen::MatrixBase<DerivedV> & V)
-{
-  DerivedV W;
-  fit_to_unit_cube(V,W);
-  return W;
-}
-```
-
-Notice that `W` is declared as a `DerivedV` type and **not**
-`Eigen::PlainObjectBase<DerivedV>` type.
-
-**Note:** Not all functions are suitable for returning Eigen types. For example
-`igl::barycenter` above outputs a #F by dim list of barycenters. Returning a
-`DerivedV` type would be inappropriate since the number of rows in `DerivedV`
-will be #V and may not match the number of rows in `DerivedF` (#F).
-
-## Function naming conventions 
-
-Functions (and [thus also files](#filefunction)) should have simple,
-descriptive names using lowercase letters and underscores between words. Avoid
-unnecessary prefaces. For example, instead of `compute_adjacency_matrix`,
-`construct_adjacency_matrix`, `extract_adjacency_matrix`,
-`get_adjacency_matrix`, or `set_adjacency_matrix` just call the function
-`adjacency_matrix`.
-
-## Variable naming conventions
-
-Libigl prefers short (even single character) variable names _with heavy
-documentation_ in the comments in the header file or above the declaration of
-the function. When possible use `V` to mean a list of vertex positions and `F`
-to mean a list of faces/triangles.
-
-## Class naming conventions 
-
-Classes should be avoided. When naming a class use CamelCase (e.g.
-SortableRow.h).
-
-## Enum naming conversion
-
-Enums types should be placed in the appropriate `igl::` namespace and should be
-named in CamelCase (e.g. `igl::SolverStatus`) and instances should be named in
-ALL_CAPS with underscores between words and prefaced with the name of the enum.
-For example:
-
-```cpp
-namespace igl
-{
-  enum SolverStatus
-  {
-    // Good
-    SOLVER_STATUS_CONVERGED = 0,
-    // OK
-    SOLVER_STATUS_MAX_ITER = 1,
-    // Bad
-    SOLVER_STATUS_ERROR = 2,
-    NUM_SOLVER_STATUSES = 3,
-  };
-};
-```
-
-### Exception for file IO
-
-For legacy reasons, file reading and writing functions use a different naming
-convention. A functions reading a `.xyz` file should be named `readXYZ` and a
-function writing `.xyz` files should be names `writeXYZ`.
-
-## `using namespace ...` in global scope
-
-Writing `using namespace std;`, `using namespace Eigen;` etc. outside of a
-global scope is strictly forbidden. Place these lines at the top of each
-function instead.
-
-
-## Namespaces and external dependencies
-
-Functions in the main library (directly in `include/igl`) should only depend on
-Eigen and stl. These functions should have the `igl::` namespace.
-
-Functions with other dependencies should be placed into
-appropriate sub-directories (e.g. if `myfunction` depends on tetgen then create
-`igl/copyleft/tetgen/myfunction.h` and `igl/copyleft/tetgen/myfunction.cpp` and give the function
-the namespace `igl::copyleft::tetgen::myfunction`.
-
-### copyleft subdirectory/namespace 
-
-Dependencies that require users of libigl to release their projects open source
-(e.g. GPL) are considered aggressively "copyleft" and should be placed in the
-`include/igl/copyleft/` sub-directory and `igl::copyleft::` namespace.
-
-## Assertions
-
-Be generous with assertions and always identify the assertion with strings:
-
-```cpp
-assert(m < n && "m must be less than n");
-```
-
-## ifndef include guard
-
-Every header file should be wrapped in an `#ifndef` compiler directive. The
-name of the guard should be in direct correspondence with the path of the .h
-file. For example, `include/igl/copyleft/tetgen/tetrahedralize.h` should be
-
-```cpp
-#ifndef IGL_COPYLEFT_TETGEN_TETRAHEDRALIZE_H
-#define IGL_COPYLEFT_TETGEN_TETRAHEDRALIZE_H
-...
-#endif
-```
-
-## Spaces vs. tabs indentation
-
-Do not use tabs. Use 2 spaces for each indentation level.
-
-## Max line length
-
-Limit lines to 80 characters. Break up long lines into many operations (this
-also helps performance).
-
-## Include order
-
-`#include` directives at the top of a .h or .cpp file should be sorted
-according to a simple principle: place headers of files most likely to be
-edited by you first. This means for
-`include/igl/copyleft/tetgen/tetrahedralize.cpp` you might see
-
-```cpp
-// [Includes of headers in this directory]
-#include "tetrahedralize.h"
-#include "mesh_to_tetgenio.h"
-#include "tetgenio_to_tetmesh.h"
-// [Includes of headers in this project]
-#include "../../matrix_to_list.h"
-#include "../../list_to_matrix.h"
-#include "../../boundary_facets.h"
-// [Includes of headers of related projects]
-#include <Eigen/Core>
-// [Includes of headers of standard libraries]
-#include <cassert>
-#include <iostream>
-```
-
-## Placement of includes
-
-Whenever possible `#include` directives should be placed in the `.cpp`
-implementation file rather than the `.h` header file.
-
-## Warnings
-
-Code should compile without firing any warnings.
-
-### An Exception
-
-The only exception is for the use of the deprecated
-`Eigen::DynamicSparseMatrix` in core sub-routines (e.g. `igl::cat`). This class
-is still supported and faster than the standard, non-deprecated Eigen
-implementation so we're keeping it as long as possible and profitable.

+ 0 - 1
tutorial/tutorial.md.REMOVED.git-id

@@ -1 +0,0 @@
-e2184ba78f39359a00bd4bc8cdf90f6a185d955e