libshell
libshell copied to clipboard
[WIP] Implement neohookean bending
I've implemented the formulas for the neo-hookean bending energy, gradient and hessian.
I've checked the derivatives against finite elements and they seem accurate, however there is a problem with how the energy is defined I think.
I wrote J (the square root of the third invariant) as J = sqrt(det(abar_inv * (b - bbar) + identity))
but this matrix is not guaranteed to have a positive determinant (and indeed in real life cases it has often a negative determinant), but I don't know how to replace this by a well-defined quantity...