Grasshopper freezing - eating all of my RAM!

Hello, relatively new user. I am trying to write a script using circle packing with spheres instead of circles. every time i plug in the values from kangaroo solver to the sphere component grasshopper freezes while using all/most of my RAM. I have deleted my MRU list but that didnt help. I have also tried rewriting the script to simplify it but that doesnt seem to help. I am on an intel i9 with 32gb of DDR5 RAM and a 4080 graphics card. while on the screenshot the RAM usage isnt maxed out its still climbing and every other time ive tried it goes up to 31.7 ish. Right after taking the screenshot it is ar 29.6. I cant believe its a hardware limitation as the script isnt that complex.

Any help will be much appreciated!


segmented_3.gh (8.6 KB)

You published an old version of your script

i had to force quit it as it froze and wouldnt let me save. that was my last save as i wanted to make sure i can return to the file. I can emulate it and lock it if that would help at all.

send file, i will open it locked

Alright mate thanks for the help ill do it once i get home!

1 Like

segmented_3.gh (21.4 KB)

Here is as far as i am able to get as if i try and open it regularly rhino and GH both freeze.

missing
(not critical)

So this is a Kangaroo problem. ImageCircles generates 11 goals, one per surface / mesh, and I assume Kangaroo will hang if I enable it?

Did you see this thread two days ago?

Caveat: I don’t really know what I’m doing with Kangaroo. Still, I managed to get something reasonable by integrating Daniel Piker’s code from the other thread with yours.


segmented_3_2023Sep28a.gh (21.5 KB)

1 Like

Here’s a simpler version and much lighter to calculate.
spheres_on_meshes.gh (19.7 KB)

As mentioned in that other thread ImageCircles is something for use with coloured meshes, so not applicable here.

Also - there’s no need to remesh if the aim is to distribute points on the original shapes. By remeshing the simple shapes to ones with hundreds of faces it makes pulling points onto those meshes much more computation than it needs to be, as finding the closest point involves finding the correct face to pull to first.

1 Like

missing

1 Like

I cobbled together something that works but don’t know if it’s cirrect?


spheres_on_meshes_2023Sep28a.gh (23.9 KB)

I was aiming to add a coloured mesh since my goal was to have a variety of radii, but i just couldnt because it would freeze. Rhino and gh also froze when trying to open your “segmented 3” edited file. I havent really used any kangaroo plugins i was following a youtube tutorial so I assumed this was an efficient way to do it, i guess not. But is it normal to have gh freeze even when trying to open your initial file?(segmented_3_2023…)

The spheres on meshes technique should do it though, so ill just copy that on my original file and play with it. Thanks for the help!

That will do the trick and seems much simpler, thank you!