Softbody explodes depending on node positions #3885
Replies: 2 comments
-
Unfortunately, the deformable code is an unsupported internship project. Not more we can do then just turn it into a discussion. |
Beta Was this translation helpful? Give feedback.
-
Ok, I found the reason, in btSoftbody::initializeDmInverse() the formula for calculating the tetra volume is missing the fabs(). The variable is called m_element_measure. |
Beta Was this translation helpful? Give feedback.
-
Hello,
there seems to be a problem with btDeformableNeoHookeanForce and btDeformableLinearElasticityForce. Depending on the position of the nodes OR the order of the nodes in the tetra, the softbody grows exponentially in Volume. I modified the "VolumetricDeformable.cpp" sample file to reproduce the issue using a softbody consisting of 4 nodes and a single tetra.
Replace the "create volumetric softbody"-part of the "initPhysics()" function with the following:
`
// create volumetric soft body
{
// btSoftBody* psb = btSoftBodyHelpers::CreateFromTetGenData(getDeformableDynamicsWorld()->getWorldInfo(),
// TetraCube::getElements(),
// 0,
// TetraCube::getNodes(),
// false, true, true);
//
const int numNodes = 4;
btAlignedObjectArray x;
x.resize(numNodes);
Use the following lines to switch between working and exploding behavior:
psb->appendTetra(0, 1, 2, 3); //explodes
//psb->appendTetra(3, 1, 2, 0); //works
Alternatively switch the position of node 0 and 3 before the softbody creation.
With btDeformableNeoHookeanForce it explodes in the air, with btDeformableLinearElasticityForce it explodes when it hits the ground. Either way, I suspect forces being applied in the opposite direction.
btDeformableMassSpringForce does not have this problem.
Beta Was this translation helpful? Give feedback.
All reactions