rigid bodies violently jumping away I'm having some issues with simulating certain rigid bodies. The above gif illustrates what happens and is a simplified version of a large assembly that i need to simulate which is shown here:



As you can see, the spindles around the vertical beams of the lower assembly are simulated correctly, but the central pin that sits in the hole of the upper assembly comes loose although it should not due to the flange on top of the pin. 

I've gone through every fix/workaround I can think of, including:


check objects for holes, degenerate triangles, etc. everything seems fine.
perturbed physics parameters, including 0 friction, 100% bounciness, and vice versa, different mass settings, various damping parameters, etc.
increased solver iterations, reduced gravity, reduced timestep, etc.
fix one object in place using a constraint to a passive cube and remove the floor to eliminate possible problems with floor object
toggled use of collision margin
used trimesh to accurately calculate the center of gravity and mass


This assembly is a reduced version that I need to evaluate for clients, and it's quite important we get it right. I have no idea why this object keeps failing, and other objects seem to have the same problem.

I have prepared a git with all the relevant code and models here:

https://github.com/jochemborges/blender_pathology

The repo does not contain the larger assembly because of copyrights, and the only requirement is the blender module. 

If anyone could have a look and possibly shed some light on this, I'd much appreciate it! 

thanks!

Jochem
The problem is that this simulation is to perform in an automated process where human-designed but random assemblies are put through a physics simulation, so it's impossible to fit the correct collision shapes by hand. Fortunately, I have made some progress. The (at least partial) solution was to do a convex decomposition of the mesh, after chopping the entire thing up into manageable blocks.The whole process is this:

split the mesh into its components (mechanical separate parts)
subdivide those components into 3x3x3 blocks
split those blocks up into isolated parts
perform an approximate convex decomposition on those parts.
finally, assemble all the convex hulls into groups that approximate the original components

Although it requires a lot of processing, the results are quite stunning. You can now interactively manipulate one of the more complex assemblies in the set. I haven't tested this on other production models yet, but at least there is some real improvement in the quality of the simulation.