Complex Shapes "Layering" over the top of one another?

I'm having a Box2D issue with complex polys. I am dragging a non "body" object into my "world" and dropping it. Once it drops "onRelease" I am using addBody (Corona) to insert it into the world. This works fine except for when using complex objects.

Here is the complex breakdown of my shape:

Image

I am using a jsfl script to get my vertices, and it seems to work out ok:

[[[40, 40], [28.25, 11.7], [80, -40], [80, 40]], [[28.25, 11.7], [0, 0], [80, -40]], [[0, 0], [-28.3, 11.7], [-80, -40], [80, -40]], [[-28.3, 11.7], [-40, 40], [-80, 40], [-80, -40]]]

When I view this inside of the world the debug version looks perfect:

Image

But when I drag a few over the top of each other, they just "layer" whereas when I do this with a simple shape like a rectangle it will force the other bodies out of the way.

Image

Any ideas?

Thank you so much in advance!
I'm not seeing your images. You can attach them if they are small enough.
Erin Catto wrote:
I'm not seeing your images. You can attach them if they are small enough.

Sorry just posted the images, thank you!
I think the problem is that the compound shape you have does not try to correct the overlapping state as a whole - the individual pieces within the shape (a total of eight in this case) are all individually trying to push away from each other. With a certain arrangement of shapes, some of these 'pushings' can cancel each other out and you get a point of equilibrium where the simulation will not move from.
irresistible force wrote:
I think the problem is that the compound shape you have does not try to correct the overlapping state as a whole - the individual pieces within the shape (a total of eight in this case) are all individually trying to push away from each other. With a certain arrangement of shapes, some of these 'pushings' can cancel each other out and you get a point of equilibrium where the simulation will not move from.

Would it help if I made these all separate shapes but used a joint to keep them acting as one body? Also is it better to overlap the shapes a bit when using a joint in this way?
So I have simplified my shape to see if I can further debug what I'm doing. Please see the attached images. I think my problem here is that I am "dropping" these or "inserting" these objects into my world at x,y points already filled by another object. When I do this with a simple shape it is simply forcing the existing shape out of the way, but on complex shapes they are "layering".

Unfortunately the point of my game is to be able to drop objects anywhere into the world so I don't think I have a way to make sure I am only dropping them in an "open" area. Any suggestions on how I might solve this while still using complex shapes?

Thank you again for your assistance.
Your best bet is to make the shapes overlap. The upper rectangle in your last image would extend to the sides, overlapping the side rectangles.
I have the same problem and I can't find any decision for 2 weeks 🙄 (description in my topic: http://box2d.org/forum/viewtopic.php?f=4&t=5923)
And did you try extending your shapes?
Erin Catto wrote:
And did you try extending your shapes?

Yes I tried overlapping but that didn't seem to help. So far I've had no luck. I even tried multiple shapes with weld joints but experienced the same issue.

Original thread: https://box2d.org/forum/viewtopic.php?t=5908