This is the implementation and examples of the paper An Eigenanalysis of Angle-Based Deformation Energies. The code is based on the HOBAK project that comes with the SIGGRAPH course Dynamic Deformables: Implementation and Production Practicalities(Now With Code!) by Theodore Kim and David Eberle.
For strands, the F-based bending energies and their derivatives are implemented in src/Hyperelastic/Strand/QUADRATIC_F_BENDING.cpp
and src/Hyperelastic/Strand/TAN_BENDING.cpp
. In the functions STRAND_NET_MESH::computeBendingClampedHessian
and STRAND_NET_MESH::computeBendingForces
in src/Geometry/STRAND_NET_MESH.cpp
, the F-based derivatives are converted into the position-based derivatives to be finally used for the solver.
For shells, the position-based derivatives are directly given in src/Hyperelastic/Shell/QUADRATIC_F_BENDING.cpp
.
There are three projects inside projects/
. The simiulateShell
project runs a shell simulator and shows a bending V strip as an example. The simulateStrand
project runs a net simulation example. The unitTests
project runs a numerical test for the energy derivatives and print out the results.
Follow these steps to build a project:
-
Choose an include_top file according to your system. Inside
projects/
, there are threeinclude_top
files. Choose one and copy it intoinclude_top.mk
. For example, if you are running on Linux, runcp include_top.linux include_top.mk
-
To build a project, go to its directory and run
make depend
. Then runmake
. For example, to build the projectsimulateShell
, at the root directory, run:cd projects/simulateShell make depend make
To run a project, go to the bin/
directory and run the binary. For example, to run the project simulateShell
, after building it, run the following at the root directory:
cd ./bin
./simulateShell
Pressing Esc
will close the OpenGL window. Pressing a
starts or stops the animation. If you have FFMPEG installed, Pressing q
will close the window and write out a video of the simulation in bin/
.