Question regarding packing objects on a sphere or hemi-sphere

Hello, I am a metal sculptor and have been using rhino for many years to design and layout my sculpture projects. Recently I started playing with Grasshopper to help develop new concepts. I have caught on to the basics of grasshopper, but am a long way off from fully understanding it. I am trying to find a script/algorithm to pack the surface of a sphere with objects, like circle packing. I found this script on the forum and have used it with moderate success, but I’ll admit that I am fairly naïve when it comes to understanding how some of the individual commands in the script work. Things seem to go a bit wonky when I try to turn the hemisphere into a sphere. I think I can still get the results I want by mirroring an acceptable hemisphere model if I have to though.

I have 3 questions:

  1. Is there a way to manipulate this script to make a spherical surface work as opposed to a hemisphere? When I try to bypass the “SplitBrep” at the beginning I get a sphere as the surface, but the “Solver” towards the end stops working.

  2. Through the use of the sliders it looks like you can control the “Min” and “Max” radii of the circles being packed. It there a way to define say 4-6 set radii and the algorithm uses those 4-6 sizes to pack the surface as opposed to what seems like infinite possibilities between the min and max?

  3. Finally, can one define a flat, closed curve or surface as the “circles” and use those to pack the surface of the sphere or hemisphere? Say hexagons, stars, or maybe even a leaf shape?

I’ve attached the GH file. It was downloaded off of this forum and was originally labeled “Circles_gravity_boundary.GH”
Original source of GH file

Here is the GH file. I added notes to the areas that I think I having issues with.

Circle packing on a dome_Cirlces_gravity_boundary_With notes.gh (16.3 KB)

Hi @jaketrix2

  1. When using a full sphere you don’t want the SphereCurveCollide component, because in the dome definition this was handling the boundary, and for the sphere you no longer have a boundary, so that goal can be deleted.

  2. Yes, you can use a number of set radii by creating a list then choosing random items from it like this
    sphere_circles_setradii.gh (18.0 KB)

  3. It depends a bit on what you mean here.
    You could use the packed circle locations and radii to place and scale other 2d shapes. This could give a distribution of those shapes over the sphere, but it would not result in a really dense packing with the shapes fitting into each other.
    You could treat the edges of the shapes as cylinders to collide, and keep the shapes rigid with RigidPointSet. This will generally be more computationally intensive, so there will be a limit to the number of shapes and their complexity it is practical for. It could be used with simple shapes directly, or for more complex shapes a simplified version could be used for the packing, then the complex shape mapped to the result.

1 Like

Thank you very much Daniel! I have a deadline for a proposal that I’ve been putting insane hour into the past couple days, but I will give these solutions a try on Friday. I’ll let you know how it goes!