Grasshopper File too big and freezes before it starts to run

Hi everyone,

Script description:

I am working on creating perforations on two facades (File#01 and File#02). The script uses circle packing based on a script found in the following link:

An image with varying black and white values is created and placed into the script. The script creates denser areas with smaller circles in the darker regions and vise versa. example:

Example
Two Grasshopper Script Files:

File#01: The script is for a smaller façade (44’x17’). A value of 90,000 is entered to fill the façade with circles (perforations).

File#02: The script is for a larger façade (104’x17’). A value of 260,000 is entered to fill the façade with circles (perforations).


The problem:

The scripts seem to be beyond the capacity of the computer I am using (CPU@ 2.7GHz, RAM: 16.0GB) as the scripts would not respond when entering in the desired number of circles (perforations).

Several services like Google and Amazon WorkSpaces offer the option to connect to a virtual server. There are several virtual server options that offer a wide selection of instance types that have varying combinations of CPU, memory, storage, and networking capacity. There is flexibility to choose the appropriate mix of resources.

We selected a virtual server with the following resources: 96vCPUs, 3.3 GHz, RAM:192 GiB memory. However, the scripts are still having trouble. File#01 takes more than 24 hours to compute while the script for File#02 does not even begin to compute.

Since File#02 (260,000 perforations) does not even begin to compute, what server specifications would allow such a script to run? More processing power? Bigger memory?

Alternatively, is there a way to make the grasshopper file smaller so it could run more smoothly in the server I am currently using?

Attached are Script 02_Larger Façade (File #02) and its corresponding image (which needs to be imported into the script using the Import Image parameter).

Script 02_Larger Facade.gh (133.0 KB)

Any help would be greatly appreciated!

Thanks,

Yeah, Pop2D takes 1.2 minutes for 20,000 points! Surprisingly slow. I won’t bother trying larger values. What’s your plan assuming you have 90K or 260K circles?

Here is an idea for speeding up Pop2D dramatically by splitting the boundary rectangle into smaller pieces (white group). Unfortunately, points (and eventually circles) accumulate along the small rectangle boundaries. More work for the solver and the edge pattern remains visible.

This is 50 rectangles with 400 points each for 20K total.


Larger Facade_2020Dec22a.gh (140.3 KB)

1 Like

Script 01_Smaller Facade.gh (5.8 MB)

Thanks for your response!

I use the second part of the script with Pick and Choose parameters to select circles larger than a certain radius (0.4 in this case). Those circles are then scaled down and reduced to create more solid areas within the façade (absence of circles=absence of perforations)

2 Likes

What I meant was what is your purpose in creating such a pattern? Are you physically building a large perforated panel?

Not that Pick’n’Choose is the slow part (is it?) but can’t you control the circle radius domain earlier in the process?

The thread that @Mahdiyar suggested is definitely worth a look

This is ten subsurfaces with 2000 points each = 20K.

P.S. With 30 subsurfaces at 2K points each I get 60K points in 20 seconds but the solver then becomes the bottleneck, running very slowly.

2 Likes

Yes, the pattern will be physically build into a facade comprised of 4’ wide panels. This particular facade needs to achieve a high degree of transparency and visibility through the facade in certain areas (where the base image is darkest-circled in red) and therefore the perforations need to be really densely packed in those regions.

I will take a look the solutions suggested so far, thanks!

The reason I ask is that you’ll hit another bottleneck using Surface Split to cut more than a few thousand holes. I can’t find the thread at the moment where we explored this but ultimately, the solution was to bake the curves (and surface) and use Rhino instead of Grasshopper to cut the holes.

P.S. Here it is:

Or lower density with bigger holes? Even uniform density (a grid of points) with larger diameter in “transparent” areas and smaller holes in opaque areas?



This model uses the “old school” Image Sampler and a grid of points. It is extremely fast compared to the method you are using. The ‘Resolution’ slider (blue group) affects the total number of points, shown in the third text panel, top right. Reducing the ‘Resolution’ value to 1.25 generates 141K points and circles in only a few seconds. A ‘Resolution’ value of 1 generates 221K points and circles in ~5 seconds!!

The ‘Min/Max’ sliders (white group) define the circle radius domain as a fraction of ‘Resolution’ so it doesn’t need to be changed when using more or less points. The ‘cyan domain’ uses large circles in the dark areas and small circles in the light areas. The ‘yellow domain’ does just the opposite.


Larger Facade_2020Dec22b.gh (2.4 MB)

(Whoa! Big file, I guess the image is included?)

Apart from the fact that you are dealing with an unoptimized file, have you ever produced a perforation in real life? Which production method, will produce 260k circles of different diameter?

26 panels, 4 feet wide by 17 feet tall with 10K holes each? Wow.

You don’t mind having holes at the edges that span two panels? If you want to avoid that, the first method I suggested (splitting the surface into panels) could be modified to cull holes that touch the edges, but then the seams might be noticeable.

I just tested SrfSplit with 10K holes: 3.0 minutes. Not as bad as I expected. But as @TomTom suggests, doing it in “real life” is a different story. Please let us know how it goes?

CNC waterjet? Or plasma but I wonder about how whether you’d have a warping problem with that many holes?

It’d add up to a huge amount of shop time and the 17’ length means it’d likely require a machine with a 20’ long table, which in my experience is not that common. Expensive as hell but totally possible.

Also no need for actually creating surfaces or splitting for producing the work, just for renderings. All the CNC shop needs is the circles.