Sphere packing Inside volume with high density


Hello evryone. I was working on 3d spheres packing in order to create a random 3d spheres inside a box with high density without getting theme intersected or overlaped, let’s say more than 70% inside the box volume. I would like to control the spheres radius, number and I want it to be random distribution. this is my try’s I would really appreciate your help.
you can find my try’s down here on a grasshooper file that i found here but it didnt work so i tried to creat my on file but also not yet working.
sphers test.gh (13.3 KB)
circlenestpuzzle-modification.gh (17.4 KB)

this could be a starting point, it uses a custom Kangaroo goal found in this topic:

the trick is to slowly increase diameter multiplier from 0 to 1


multiradius_spherecollide_in_mesh_re.gh (20.3 KB)

if you apply som sort of gravity, then small particles will accumulate on the bottom

2 Likes

hello @inno its impressive what u did there but what I want is to control the radius of the spheres so I tried to change the radius randomness number to 3 and the kangaroo component gives me an error, its seems like it work only when I use the same number of spheres also don’t want the small particles to accumulate down the box. I want all the spheres to be random distributed. the final thing I want is to have the results as solids not meshes, I can turn theme to polysurfaces after getting theme as meshes but I would be happy if the script generates the spheres as solids.

you can change variables (sphere radius, number of sphere, random seeds) only when the Kangaroo simulation is off (False), then you should reset it, put slider for radius multiplier to 0 (or any low value) turn on kangaroo and slide it up again

if then you want to change something, again stop the simulation ecc etc

if you don’t want particles to accumulate on the bottom, then gravity = False (or just delete that part completely if you’ll never need it)

to get Breps instead of meshes you can just replace the Mesh Sphere component with a Sphere component, but because Sphere is many many times slower than Mesh Sphere, I’d keep using meshes for simulation (then when you get what you want with meshes, maybe go Brep)

one thing you can do is to first generate your list with all the different diameters you want to use in the simulation, then generate as many random points as the amount of diameters

1 Like

dear @inno
am still trying with Ur code file but I can’t get high density of spheres is there any help u could provide
sincerely

assuming the info and reference density values in the link are correct, I think your target density is a little bit too high :slight_smile: Sphere packing - Wikipedia