Soft body metallic grid simulation problems

Eaglegor
Posts: 9
Joined: Tue Jun 18, 2013 2:20 pm
Location: Russia, Samara

Soft body metallic grid simulation problems

Post by Eaglegor »

Hi everyone!

I need to implement a grid made of stiff wires (let's say metal).
It must be something like this
Image

I decided to try to use soft body for this purpose. I created a flat square soft body (like cloth). For better stiffness of this soft body I used :

Code: Select all

generateBendingConstraints( 2 );
Without gravity it behaves good enough for me, has sufficient stiffness, bends like real grid.
But it had problems with collisions. I created the thin soft body instead of flat plane. There is a model:
Image

I've tried to use clusters (CL_RS) and SDF (SDF_RS) for collision detection and "Velocities" and "Positions" solvers for dynamics. But none of combination gives good enough behavior.

Here are the parameters:

Code: Select all

m_cfg.kDP = 0; // Damping coefficient [0,1]
m_cfg.kPR = 0; // Pressure coefficient [-inf,+inf]
m_cfg.kDF = 1; // Dynamic friction coefficient [0,1]
m_cfg.kCHR = 1; // Rigid contacts hardness [0,1]
m_cfg.kKHR = 1; // Kinetic contacts hardness [0,1]
m_cfg.kSHR = 1; // Soft contacts hardness [0,1]
m_cfg.kSRHR_CL =  1; // Soft vs rigid hardness [0,1] (cluster only)
m_cfg.kSKHR_CL = 1; // Soft vs kinetic hardness [0,1] (cluster only)
m_cfg.kSSHR_CL = 1; // Soft vs soft hardness [0,1] (cluster only)
m_cfg.viterations = 0; // Velocities solver iterations
m_cfg.piterations = 8; // Positions solver iterations
m_cfg.diterations = 16; // Drift solver iterations (used with "Velocities" solver mode)
Fixed timestep is 0.016, max subiterations number is 10.

All rigid bodies are static (i.e. mass = 0, and btCollisionObject::CF_STATIC_OBJECT flag is set).

When I run the simulation with CL_RS flag, it behaves so:
http://youtu.be/wwg9RDK3Lcc

I tried to change viterations to 4 and call setSolver(eSolverPresets::Velocities)
Then the collision was even worse:
http://youtu.be/zlEnYwMKdBw

If I change collision flags to SDF_RS, it lies almost still on the ground, but there is not many vertices and the collision with other objects is bad:
http://youtu.be/nyJ9DPpnUoM

I need this grid to be placed around the tube (it has convex collision shape now) like this:
Image

Could anyone help me to understand in what direction I could think to solve this problem?
Eaglegor
Posts: 9
Joined: Tue Jun 18, 2013 2:20 pm
Location: Russia, Samara

Re: Soft body metallic grid simulation problems

Post by Eaglegor »

One question more. I've set debug draw to draw clusters. I see this on a softbody with slit:
Image

If I understand the basics right, the left half of a body would react if I touch the right half.
Is it OK to have clusters be generated like this without attention to slit?
Eaglegor
Posts: 9
Joined: Tue Jun 18, 2013 2:20 pm
Location: Russia, Samara

Re: Soft body metallic grid simulation problems

Post by Eaglegor »

Well, what about "bad" cluster, I divided it into two and my body doesn't explode anymore.