Expand and Deform of Spheres

Hi, I am very new to Kangaroo. I’m wondering what kind of command can I use for this type of simulation. When I look up I mostly see the “sphere packing,” which uses the “collider” and “on mesh” command. Here I would like the spheres to expand and deform. Initially they could grow at the same speed to get roughly the same volume toward the end although it would be good to be able to vary the speed as well.
Please give me some suggestion on how to proceed.

Thank you so much.

Here’s an example
balloons_in_container.gh (18.7 KB)

Thank you so much Daniel. Appreciate the fast response.
Have a good day. :slight_smile:

@DanielPiker it remembers me the question from David @DavidRutten 9 years ago.
Time flies!

Hi Daniel,

I am trying to adapt your script for a slightly more complicated Brep and for a slightly different result. I essentially want to squish the spheres into more of a flattened shape.

However, the result I am getting seems to not respect the collision boundaries of the spheres and I end up with lots of overlapping spheres.

Ultimately I want to slice through the middle plane of the spheres and extract a bunch of curves, to get a result as I described in a separate thread:

inflate spheres into brep.gh (24.6 KB)

It looks like approaching it as a 2d problem will work better here than using meshes then slicing them. Something like this:

The result will be more bubble-like and less orthogonal/stepped than the images in your linked thread though. If you do want this effect we might need to add some more goals.
Is the aim here to ultimately generate a pattern like this?

Thanks Daniel, I will have a look at CurveCollide tomorrow.

It does not necessarily have to be that stepped, that first thread was more about working from some existing curves I had but I was thinking it might be better to regenerate those anyway. The goal is to have the effect of some marshmallows squishing together (only in 2D for the time being). So perhaps starting with rectangles rather than circles could be good for resulting in slightly less bubble-like shapes, however I’m not too sure how to preserve the original linearity of a curve while still colliding it.

Hi @DanielPiker, so I’ve played around with the solution in the thread you mentioned and it has effectively solved my problem. I came up with a way of funnelling the curves in from the top to avoid clashes and overlaps and to let them fall more naturally, then changing the constraining mesh to remove the funnel and trap them in, and playing with the area goal to then have them expand to push against all sides of the shape. I also added an angle factor closer to 1 to retain some of the rectangular inputs. Thanks for the help!

Hey Daniel, these square-ish rocks look really cool and I’m wondering if you could share some thoughts on making such patterns. I am aware of some “sci-fi paneling” methods but it seems that those I have read are primarily about randomly placing objects, whereas here the rocks actually fit together like puzzle pieces.