Official implementation for the paper:
Stabler Neo-Hookean Simulation: Absolute Eigenvalue Filtering for Projected Newton
Honglin Chen1, Hsueh-Ti Derek Liu3,4, David I.W. Levin2,5, Changxi Zheng1, Alec Jacobson2,6
> 1Columbia University, 2University of Toronto, 3Roblox Research, 4University of British Columbia,
5NVIDIA, 6Adobe Research
> SIGGRAPH 2024 (Conference Track)
To build the code, please run
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j8
To run the code with our absolute eigenvalue projection strategy, please run, e.g.,
sh ../scripts/micky_teaser/abs.sh
We provide several examples in scripts/
.
To run the same example with the eigenvalue clamping strategy, run clamp.sh
under the same folder (or add --clamp
option after the command in abs.sh
):
sh ../scripts/micky_teaser/clamp.sh
The default eigenvalue clamping algorithm uses 0 as the clamping threshold. To use a different clamping threshold (e.g., a small positive number), add --epsilon [threshold]
option after the command.
For more options, please see
./example --help
As a research prototype, we choose to make minimal modifications in TinyAD when adding our new projection method.
We clone TinyAD to the project folder,
and comment out and change lines 71-75 in TinyAD/include/TinyAD/Utils/HessianProjection.hh
to:
if (_eigenvalue_eps < 0) {
// project to absolute value if the eigenvalue threshold is set to be less than 0
if (D(i, i) < 0)
{
D(i, i) = -D(i, i);
all_positive = false;
}
}
else {
// project to epsilon otherwise
if (D(i, i) < _eigenvalue_eps)
{
D(i, i) = _eigenvalue_eps;
all_positive = false;
}
}
Thus we simply use eps < 0
as a flag for absolute eigenvalue projection.
Our method can also be verified by modifying the code of Hobak [Kim and Eberle 2020].
-
Git clone Hobak in a different folder.
-
Implement our abs eigenvalue projection: Change lines 139-141 in
src/Hyperelastic/Volume/SNH.cpp
to:
for (int i = 0; i < 9; i++)
if (eigenvalues(i) < 0.0)
eigenvalues(i) = -eigenvalues(i);
- Increase the Poisson's ratio to roughly 0.495: Change line 54 in
src/Scenes/QUASISTATIC_STRETCH.h
to:
_hyperelastic = new VOLUME::SNH(1.0, 100.0);
- Create a large initial deformation: Change lines 80-84 in
src/Scenes/QUASISTATIC_STRETCH.h
to:
if (_frameNumber < 1)
{
_kinematicShapes[0]->translation()[2] -= 0.5;
return;
}
Feel free to try an even larger deformation. :)
- Uncomment line 287 in
projects/simulateScene/simulateScene.cpp
to choose the quasistatic test:
scene = new QUASISTATIC_STRETCH();
- Run
make mac
ormake linux
to run the test (see HOBAK's readme).
- Note: HOBAK doesn't include a line search but our method seems to often work fine without one.
Our method stabilizes and accelerates the optimization of stable Neo-Hookean energy when the energy landscape is highly nonconvex. In other words, our absolute eigenvalue projection usually achieves more speedup when the Poisson's ratio is high, the volume change is large and the mesh resolution is high, as each of them will increase the nonconvexity of the stable Neo-Hookean energy (see Sec.6 of our paper). For other cases where the energy landscape is almost convex, our method may slightly damp the convergence (see Sec.8).
@inproceedings{chen2024abs_eval,
title={Stabler Neo-Hookean Simulation: Absolute Eigenvalue Filtering for Projected Newton},
author={Honglin Chen and Hsueh-Ti Derek Liu and David I.W. Levin and Changxi Zheng and Alec Jacobson},
booktitle = {ACM SIGGRAPH 2024 Conference Proceedings},
year = {2024}
}