Sphere Packing

Has anyone been able to transfer 2D circle packing to 3D sphere packing? Surface tension may be more Cotonou? But I’m interested in solid sphere packing where the spheres stay spherical?

Caveat : various sizes

Look at kangaroo. It has examples for that.

Here’s one example:
https://github.com/Dan-Piker/Kangaroo-examples/blob/master/collisions_and_packing/multiradius_spherecollide.gh

1 Like

Thanks,

Can you drop spheres of various radii into a container like this?

Then I’m looking to do something I did with circles, that is use gravity to sort sizes out - so that you are left with smaller bubbles (Spheres) at the bottom and larger at the top? (Or vice versa): In my ideal world, using attractor surfaces in the containers walls, so that you get a bunch of spheres that are larger toward the centre of the mass, and smaller at the surfaces? (then even further desired, the container is actually a complex collection of NURBS surfaces… or even a closed NURBS surface with point and line attractors pulling the various radii?)>

I don’t want for much? But an indication, of how far off Kangaroo is from this? Would be great info… I could then: Get on it…!". so to speak.

J

spheresmesh

spheremeshtest.gh (17.3 KB)

Collisions between spheres of different radii is possible with the ‘collider’ goal.
I realised though that there wasn’t really anything in there for collisions between spheres of different radii and meshes (you could kind of do it by offsetting the mesh for each different radius, but that would be rather slow)…
So I put together a new goal for this. You’ll need to set the assembly reference location when you open it.
I’ll include this as a standard goal in the next release.
I’ve also made some small improvements to the ‘collider’ object for the next release that might help here.

9 Likes

I’m looking for script like this but it’s not working on lastest Rhino and Kangaroo versions. Any idea how to solve these errors?

Hi,
You need to make sure the referenced KangarooSolver.dll from the scripted component is the same one being loaded by Grasshopper. If you are in Rhino 6 this will be somewhere like:
C:\Program Files\Rhino 6\Plug-ins\Grasshopper\Components
whereas if you are in Rhino 5 it will probably be:
C:\Users\ You \AppData\Roaming\Grasshopper\Libraries

Thanks! It’s working now. I had KangarooSolver.dll in both file paths.

Hi thank you for sharing the code, I have the same problem and I don’t where I should find to change the .dll . You mean in the C# component? If yes,I appreciate it if you tell me the location I’m naive in coding.

Woah, thanks for that.