by Tuğrul Yazar | January 2, 2013 12:22
The famous “Deutsch limit” says, “you cannot have more than -say a hundred- components in a visual programming environment, that is why you cannot write an operating system with it.”; so it says, the perceptual and pedagogical advantages of visual programming are limited according to the size of your screen. However, there are two main oppositions to this argument. One of them says “textual programming environments have the same limitation, as you cannot have more than x lines of code on a screen, just scroll down or “pan the canvas” idiot?”. The other one says “even extreme modularity can be achieved in a visual environment just as effective as in textual representation, just make clusters as you write subs in coding, …?”. Since I started working with Grasshopper, I never needed clustering, however, it is an old and effective technique for reducing the visual (not computational) complexity of your definitions. I implemented Sivam Krish’s beautiful explanation (here[1]) to one of my old definitions, the custom Voronoi study:
You can read that post here on how to create custom and variable Voronoi subdivisions.
First, I placed input and output cluster components placed under “params/utils” and replaced the input and outputs of my Voronoi method. In my case, there are two inputs (points and a double number) and one output (the curves).
Now, just select them all and hit “edit/cluster” from the menu.
It is a clean-tidy cluster now. However, you still have to be careful about not exhausting your computer’s resources. As the “pure” dataflow approach originated as hardware research, these could also be used to distribute different parts of the code to your computer’s CPU cores. However I do not have any information about how Grasshopper handles these streams, I think it just “simulates” a concurrent execution of dataflow graphs, (expecting nothing more now).
Anyway, you should re-connect your inputs to this cluster to see it working again. In my case, I have to connect those two inputs again to my points and slider. You can edit the appearance, define an icon, assign a password, and export it to a ghuser file… etc. by right-clicking on it. This is very exciting. Just double-click on the cluster to open it in a “block editor” fashion, indicated by this icon of “box”;
If you modify your cluster, this updates all copies in your Grasshopper definition. I still wonder if it also optimizes your CPU usage. I’ll test that later.
Source URL: https://www.designcoding.net/clustering/
Copyright ©2024 designcoding unless otherwise noted.