Rhino+Grasshopper: Repetition based on input data
In some cases of using Rhino+Grasshopper, it would be necessary to repeat the same process.
If that repeated process is limited to less than 10 times, it would be done in manual clicking with Grasshopper, but over 20 times or each process would take longer than 10 minutes, repetition based on input data would much easier.
This is guide of how to setup repetition based on input data.
In this repetition process, addon “Anemone” is necessary.
Since Grasshopper opens a door of add-on without limitation of authorization by McNeel group, one of the most important thing about using Grasshopper is using add-ons.
Summerizing addon “Anomone” could be in single word: “LOOP”
Basically, Anemone setups loop between certain areas (start to end), and that looped cycle would repeat until fit to required condition/limitation.
Let’s see a single simple example of the Repetition work process in Grasshopper.
This simple example is creating Facade geometry based on floor drawing in separated Rhino files.
In view of the concept of the ideal “BIM” condition, the 3D models would be created prior, and based on that 3D model, the 2D drawings should be created. But in the case of practical work, it is often to the request to create a 3D model based on a 2D drawing (Floor Plan, Elevation).
Even though Grasshopper is visual-coding, it would be hard to understanding without description. Adding some scribble would be more comprehensible like the following example ;
As you see, INPUT DATA part is inserting data that need to be repeated.
Just below that part, COUNT QUANTITY OF INPUT DATA is counting how many data that need to be repeated, and minor modification based on that quantity.
Subtraction of Length is a necessary part of Grasshopper because in Grasshopper logic, all lists start with “0” not “1”.
So, in this Example Anemone sequence,
1. READING INPUT DATA,
2. COUNTING HOW MANY REPEATING SEQUENCE based on INPUT DATA
3. Setting START OF LOOP condition, END OF LOOP, and COUNTING PARAMETER.
4. LOOP PROCESS repeats until that COUNTING PARAMETER number fits the last COUNTING number
In this LOOP PROCESS, only INPUT DATA changes. So it is like you insert file#1, then next with file#2, goes with final file#5.
Some people would think that instead of this LOOP PROCESS, input them in the same code and run them all at single-click in Grasshopper could be done with the same result. But some Grasshopper work like exporting data with different sizes, data structure couldn’t be easily done parallelly done by single work of Grasshopper.
For that reason, “Repetition” is needed. Repeating the same logic/code, but result in seperated data.
Of course, This “Repetition” could be diverse to the “Evolutional” method if you control this Anemone carefully. That would be the topic of the next post.