|
11 years ago | |
---|---|---|
.. | ||
101_FileIO | 11 years ago | |
103_DrawMesh | 11 years ago | |
104_Events | 11 years ago | |
105_Colors | 11 years ago | |
106_Overlays | 11 years ago | |
107_Matlab | 11 years ago | |
201_Normals | 11 years ago | |
202_GaussianCurvature | 11 years ago | |
203_CurvatureDirections | 11 years ago | |
501_HarmonicParam | 11 years ago | |
502_LSCMParam | 11 years ago | |
503_ARAPParam | 11 years ago | |
504_NRosyDesign | 11 years ago | |
505_MIQ | 11 years ago | |
cmake | 11 years ago | |
images | 11 years ago | |
shared | 11 years ago | |
CMakeLists.shared | 11 years ago | |
compile_example.sh | 11 years ago | |
compile_example_xcode.sh | 11 years ago | |
compile_macosx.sh | 11 years ago | |
readme.md | 11 years ago | |
style.css | 11 years ago |
css: style.css html header:
TODO
All examples depends on glfw, glew and anttweakbar. A copy of the sourcecode of each library is provided together with libigl and they can be precompiled using:
Alec: Is this just compiling the dependencies? Then perhaps rename compile_dependencies_*
sh compile_macosx.sh (MACOSX)
sh compile_linux.sh (LINUX)
compile_windows.bat (Visual Studio 2012)
Every example can be compiled by using the cmake file provided in its folder. On Linux and MacOSX, you can use the provided bash script:
sh ../compile_example.sh
By default, libigl is a headers only library, thus it does not require
compilation. However, one can precompile libigl as a statically linked library.
See ../README.md
in the main directory for compilations instructions to
produce libigl.a
and other libraries. Once compiled, these examples can be
compiled using the CMAKE
flag -DLIBIGL_USE_STATIC_LIBRARY=ON
:
../compile_example.sh -DLIBIGL_USE_STATIC_LIBRARY=ON
This chapter illustrates a few discrete quantities that libigl can compute on a mesh. This also provides an introduction to basic drawing and coloring routines in our example viewer. Finally, we construct popular discrete differential geometry operators.
Gaussian curvature on a continuous surface is defined as the product of the principal curvatures:
$k_G = k_1 k_2.$
As an intrinsic measure, it depends on the metric and not the surface's embedding.
Intuitively, Gaussian curvature tells how locally spherical or elliptic the surface is ( $k_G>0$ ), how locally saddle-shaped or hyperbolic the surface is ( $k_G<0$ ), or how locally cylindrical or parabolic ( $k_G=0$ ) the surface is.
In the discrete setting, one definition for a ``discrete Gaussian curvature'' on a triangle mesh is via a vertex's angular deficit:
$k_G(vi) = 2π - \sum\limits{j\in N(i)}θ_{ij},$
where $N(i)$ are the triangles incident on vertex $i$ and $θ_{ij}$ is the angle at vertex $i$ in triangle $j$. (Alec: cite Meyer or something)
Just like the continuous analog, our discrete Gaussian curvature reveals elliptic, hyperbolic and parabolic vertices on the domain.
The two principal curvatures $(k_1,k_2)$ at a point on a surface measure how much the surface bends in different directions. The directions of maximum and minimum (signed) bending are call principal directions and are always orthogonal.
Mean curvature is defined simply as the average of principal curvatures:
$H = \frac{1}{2}(k_1 + k_2).$
One way to extract mean curvature is by examining the Laplace-Beltrami operator applied to the surface positions. The result is a so-called mean-curvature normal:
$-\Delta \mathbf{x} = H \mathbf{n}.$
It is easy to compute this on a discrete triangle mesh in libigl using the cotangent Laplace-Beltrami operator (Alec: cite Meyer):
#include <igl/cotmatrix.h>
#include <igl/massmatrix.h>
#include <igl/invert_diag.h>
...
MatrixXd HN;
SparseMatrix<double> L,M,Minv;
igl::cotmatrix(V,F,L);
igl::massmatrix(V,F,igl::MASSMATRIX_VORONOI,M);
igl::invert_diag(M,Minv);
HN = -Minv*(L*V);
H = (HN.rowwise().squaredNorm()).array().sqrt();
Combined with the angle defect definition of discrete Gaussian curvature, one can define principal curvatures and use least squares fitting to find directions (Alec: cite meyer).
Alternatively, a robust method for determining principal curvatures is via quadric fitting (Alec: cite whatever we're using). In the neighborhood around every vertex, a best-fit quadric is found and principal curvature values and directions are sampled from this quadric. With these in tow, one can compute mean curvature and Gaussian curvature as sums and products respectively.
This is an example of syntax highlighted code:
#include <foo.html>
int main(int argc, char * argv[])
{
return 0;
}