Questions about Constraints and Compounds

Post Reply
scorpion81
Posts: 11
Joined: Sun Apr 08, 2012 10:01 am

Questions about Constraints and Compounds

Post by scorpion81 »

Hello,

i am using btFixedConstraints to connect fracture shards of a rigidbody. In order to do this, i iterate over each shard and create constraints to other shards within a certain search radius. This is calculated between shard centroids. I also take care not to create doubled constraints, means if 2 bodies are already connected, i dont make another connection between them.
You can see this behavior in the Blender Fracture Modifier (i am the developer of this :) )

Sources are here....
https://developer.blender.org/diffusion ... _modifier/

Builds can be downloaded here...
http://df-vfx.de/fracturemodifier/

Now my questions:

1) Why does there still exist some "wobbling" or "jiggling" between those shards despite all 6 DOFs being locked ? Say if a fractured object falls down and hits the ground, it doesnt quite retain its shape, even if the shards should not break off yet. Instead, shards move against each other.

2) I also tried a completely different approach, using compound shapes and constraint info to build them and destroy them (instead of making an N^2 iteration over all manifolds to find adjacent pairs). There no wobbling happens, but its very hard to control how and when the shards should break off.
Are there maybe ways to mimic either fixed constraint simulation behavior within a compound or make fixed constraints "really bombproof" means, they stick together as if they were welded together until they shall break ?
I already posted here regarding this topic, but i also see its a rather complex one....

More details here:
http://www.bulletphysics.org/Bullet/php ... 12&t=10883

3) Can i also re-set the "constraint rest pose" (as i call it) mid-simulation ? means if say an angle of 5 degrees is exceeded between 2 connected rigidbodies (again based on location, rotation data of centroid) the constraint wont jiggle back to the start position, but snaps to that angle as new rest position ? This would allow to simulate plasticity / deformation between shards (i think)

So all in all i try to achieve to get really "fixed" constraints and maybe for other use cases something like plastic deformation.

Hope anybody can give me some hints or pointers, would really appreciate :)

scorpion81
Ehsanizadi
Posts: 72
Joined: Mon Dec 02, 2013 4:13 pm

Re: Questions about Constraints and Compounds

Post by Ehsanizadi »

Hi,
1) The jittering behaviour might be due to one of the following reasons:
a) the size of the shards are extremely large or extremely small. With extremely small shards, you get an explosive behaviour and with extremely large ones, you may observe jittering.
b) the time step you've chosen is relatively large
c) increasing collision margin can help.

-----------------
2) Based on my experience the second approach is rather complex and needs more hacking of the source code. I'd suggest try to avoid it.

-----------------
3) Why dont you try 'setBreakingThreshold'? This perfectly simulates the plastic behaviour. If the impulse imposed on the shards exceeds the 'breakingthreshold' X (sum of the attached shards masses), it will breaks.
But based on what you described, you want to simulate a plastic behaviour based on what you see for 'deformable' materials.
For example, you put some force on a material (lets say eraser!) and the eraser undergoes deltaL deformation. if you remove the load, the eraser will compensate 70% of deltaL, but 30% of deltaL would remain permanent. This 30% of deltaL, is plastic deformation.
I am afraid this sort of behaviour is not relevant in a pack of rigid bodies such as shards, and even if you manage o simulate such behaviour, it does not correspond to the reality.
You can apply this to the softbodies instead which is more meaningful.
I hope I understood your question well!

Wish u luck.
Ehsan
Post Reply