Solid inside another solid

What exactly are you trying to do here?

It looks like you want to place a collection of rectangles inside another rectangle, without overlaps and without changing orientation. Anything beyond this?

Do you know how in advance the set of shapes to place and want to find the smallest container, or you know the container and want to fit as many in as possible?

It would be fairly simple to add something to CurveCollide to check for containment (also some general pointers - when using a physics approach to packing it can help to start with a large container and gradually shrink it to squeeze everything in. Also starting with everything neatly stacked might be more likely to lead to jams than a randomised starting configuration), but I’d like to understand the aim more first - this might not be somewhere where a physical approach is the right one at all.

If it’s purely a fixed orientation nesting problem then you might be better of with something like

:+1:

“It looks like you want to place a collection of rectangles inside another rectangle, without overlaps and without changing orientation. Anything beyond this?”
That’s pretty much it, the rectangles self intersect during the process and sometimes, for a few of them, stay in place inside another rectangle.
It needs to be physical because the user needs to move (grab) things around and reorganize as they wish.
I was wondering if there could be a way to check for that problem at the tail end of the simulation.
I don’t care about fitting as many as possible or getting the smallest container.
It’s just for architectural programming purposes. We need to organize those rectangles (Spaces) inside a predefined boundary (subject to future changes) so we can decide which organization makes the most sense.
But the fact that rectangles can penetrate each other(sometimes) is a little problem.

@DanielPiker ?

No updates ? Too bad. This penetration check would be really appreciated and seems to be indispensable for large simulations.

I would really try this:

connect the outer-container rectangle to a scale component, with scaling point referenced to its own area centroid, then connect it to a slider with range [1.000, 3.000]
this bigger version of the rectangle should replace the previous one, so take core of reconnecting it to the different Kangaroo components

set the scaling slider to 3.000 reset and restart the Kangaroo simulation
slowly drag the slider from 3 to 1, giving time to the inside-shapes to gently hit each other and accomodate their positions

it might hapen that many big rectangles just align on each other horizontally or vertically: in that case you can add a Drag component to Kangaroo so you can move those by hand, or change the seed of the initial distribution of the shapes, in such a way that hard-alignment does not happen

each time you reset the simulation, remember to drag back the slider to 3

Not a practical solution in my case, I pick up shapes that have already been created, they are physically removed from the boundary, usually.
The penetration happens regardless of the boundary scale after that.
We really need a check penetration code in the curve collide component. Any other solution would be time and resource consuming.
Grabbing also reintroduces the penetration problem.

How did you manage to get the mod’s author attention ?

Happy holidays to all !

Any chance of an update to include penetration ?