|
@@ -16,6 +16,39 @@ resides in the [`igl::spectra::` namespace](./namespaceigl_1_1spectra.html).
|
|
|
Functions which depend on external code under a copyleft license reside in the
|
|
Functions which depend on external code under a copyleft license reside in the
|
|
|
[`igl::copyleft::` namepsace](file:///Users/alecjacobson/Repos/libigl/dox/namespaceigl_1_1copyleft.html).
|
|
[`igl::copyleft::` namepsace](file:///Users/alecjacobson/Repos/libigl/dox/namespaceigl_1_1copyleft.html).
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+Most libigl functions are templated over the Eigen matrix inputs and outputs.
|
|
|
|
|
+Callers can choose their own scalar types (e.g., `double`/`float`) and storage
|
|
|
|
|
+orders (`Eigen::ColMajor`/`Eigen::RowMajor`). Libigl can be used as a:
|
|
|
|
|
+
|
|
|
|
|
+ - **header only library** (via CMake, make sure
|
|
|
|
|
+ `LIBIGL_USE_STATIC_LIBRARY=OFF`) and insure that `IGL_STATIC_LIBRARY` is
|
|
|
|
|
+ _not_ defined_ when compiling --- easiest if you're new to libigl, or
|
|
|
|
|
+ - **static library** (`LIBIGL_USE_STATIC_LIBRARY=ON` → `IGL_STATIC_LIBRARY` is
|
|
|
|
|
+ defined) --- speeds up repeated compilation.
|
|
|
|
|
+
|
|
|
|
|
+The libigl static library is filled with _explicit template instantiations_ for
|
|
|
|
|
+common Eigen inputs and outputs. If the library doesn't contain your types, you
|
|
|
|
|
+may get some form of linker error (e.g., `Undefined symbols for architecture`,
|
|
|
|
|
+`undefined reference to` or `unresolved external symbol`).
|
|
|
|
|
+
|
|
|
|
|
+You can fix this by:
|
|
|
|
|
+
|
|
|
|
|
+1. Switching to header only mode for your project,
|
|
|
|
|
+2. Making a file in your project to compile the missing templates. E.g., `my_templates.cpp`
|
|
|
|
|
+```cpp
|
|
|
|
|
+#ifdef IGL_STATIC_LIBRARY
|
|
|
|
|
+#undef IGL_STATIC_LIBRARY
|
|
|
|
|
+#endif
|
|
|
|
|
+#include <igl/per_vertex_normals.h>
|
|
|
|
|
+template void igl::per_vertex_normals<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
|
|
|
|
|
+```
|
|
|
|
|
+3. [Submit a PR](https://github.com/libigl/libigl/pulls) containing your missing template to the development branch of libigl
|
|
|
|
|
+4. Change your input/output types to match existing templates (e.g., `Eigen::MatrixXd`).
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
https://libigl.github.io/
|
|
https://libigl.github.io/
|
|
|
|
|
|
|
|
https://github.com/libigl/libigl/
|
|
https://github.com/libigl/libigl/
|