Hi I would appreciate some help with soft bodies. I’m new to bullet so apologies for any newbie speak in this question.
I’m hoping to use to bullet to model the deformation of a soft-body that has variable stiffness across its volume. So some parts of the volume will deform easily whilst other will be almost rigid.
I have generated some meshes using tetgen and been able to load these in bullet using CreateFromTetGenDataI’ve had a look though past submissions on this forum and the question “how do I make my soft body more/less stiff” seems to be asked quite often, with the answer “change the values of m_kLST, m_kAST, & m_kVST”. As I mentioned above I want the values of stiffness to vary throughout the volume, but I have also tried to set a constant value throughout the soft-body. I’ve changes the values using “b->m_nodes.m_material->m_kAST= val;” where “b” is a pointer to the soft body, & “i” is a loop over the nodes in the body. However changing these values does not appear to have the effect I would expect on the deformation of the soft-body. Setting the values of “m_kLST, m_kAST, & m_kVST” to 1 should as I understand it make body as rigid as possible whereas what I’m seeing is a very deformable object. Varying the values of “m_kLST, m_kAST, & m_kVST” across the body also does not seem to produce variable deformation.
Why does varying the values of “m_kLST, m_kAST, & m_kVST” across the body not produce a body with variable deformation?
Thanks for any help.
My Code is below
btSoftBody* box=btSoftBodyHelpers::CreateFromTetGenData(world->getWorldInfo(),
elements,
0,
nodes,
false,true,true);
world->addSoftBody(box);
box->setTotalMass(10);
for (int i=0;i<box->m_nodes.size();i++) {
float a,b,c;
a = box->m_nodes.m_x.getX();
b = box->m_nodes.m_x.getY();
c = box->m_nodes.m_x.getZ();
if (b<-0.98) { // Fix the base of the box
box->setMass(i,0);
}
if (abs(b)>0.5) {
box->m_nodes.m_material->m_kLST=1.0;
box->m_nodes.m_material->m_kAST=1.0;
box->m_nodes.m_material->m_kVST=1.0;
} else {
box->m_nodes.m_material->m_kLST=0.5;
box->m_nodes.m_material->m_kAST=0.5;
box->m_nodes.m_material->m_kVST=0.5;
}
Softbody With Variable Stiffness
-
- Posts: 2
- Joined: Mon Apr 15, 2013 2:16 pm
Re: Softbody With Variable Stiffness
Hi I’ve decided to ask for some more general advice. I I’m hoping to use to bullet to model the deformation of a soft-body that has variable stiffness across its volume. So some parts of the volume will deform easily whilst other will be almost rigid.
My approach for doing this has been to create the mesh using tetgen that contains the boundaries that I require and then to create soft body from this using CreateFromTetGenData. The stiffness is then varied across the volume by setting the values of “m_kLST, m_kAST, & m_kVST” to values that vary between 0 and 1, as I require. The soft body is then deformed by applying forces to it.
Is this the best approach? Would I be better using clusters of soft bodies, or perhaps putting rigid bodies within the soft body to represent areas that do not deform? Or is this just something that bullet is not very good at doing?
Any general advice on the best approach would be great.
Thanks
My approach for doing this has been to create the mesh using tetgen that contains the boundaries that I require and then to create soft body from this using CreateFromTetGenData. The stiffness is then varied across the volume by setting the values of “m_kLST, m_kAST, & m_kVST” to values that vary between 0 and 1, as I require. The soft body is then deformed by applying forces to it.
Is this the best approach? Would I be better using clusters of soft bodies, or perhaps putting rigid bodies within the soft body to represent areas that do not deform? Or is this just something that bullet is not very good at doing?
Any general advice on the best approach would be great.
Thanks