Using Dispatch to Create Random Variation – Example 1.5
The previous examples were a little abstract when it comes to direct application to a Landscape Architecture project, but this one is a very concrete example of how a simple script in Grasshopper can make a routine design task much quicker.
A common task of an intern Landscape Architect at a first job might be to design a paving pattern. Lets say an evil boss comes to you and knows he wants a random mixture of light and dark pavers on a project, but is not sure if he wants 15% dark, 50% dark, or 90% dark. He assigns you the task to show him the variations. If you don’t know grasshopper, you might do this by randomly filling in cells with a paint bucket in Photoshop, but then it might not be truly random, the proportions might be off, and might take quite a long time and be incredibly boring.
A simple 5 minute solution is to do this task in Grasshopper. You can also give your boss variations for 30%, 35%, 80% dark… and so forth. Although later we’ll try and come up with more innovative applications of this principle, the principle remains the same. One of the most obvious advantages of a parametric generative system is to test numerous scenarios quickly, but also to look at the range of potential variations on each scenario (the factor of indeterminacy.
But first, to setup the task.
Step One – Setup a rectangular grid
This is done just like in the last Example 1.4. You can go ahead and hook up the “Cull Pattern” component as well.
Step Two – Cull Pattern with Random True and False Values
Instead of typing “True” and “False” values into a panel, we will have a random number generator generate a list of random numbers in the range from 0.0 to 1.0. The number of Random numbers should be equal to the number of pavers in our pattern, so we use the list length to measure this. Not to convert the results of this random number test into True/False values, we use one of the “Boolean” operations components, specifically the “Larger Than” component. This will be a very frequent script pattern going forward. What this will do is test our list of random values against another constant. You can see right now the constant is set to .50 In this case, approximately half the values in our random list will be above .50 (50%) and half will be below. The component returns a “True” for these values. The other half will get a false. Now if we change this constant to .20 (20%), then only 20% of the values (approximately) will pass the test. Here we give the pavers that pass the test a color. But what about the ones that failed the test? Well, they are gone…forever. This is one of the weaknesses of the “Cull” method. A better and much more frequent method, is to not “Cull” the geometry, but to run a dispatch.
Dispatch
Dispatch is a very useful and much more versatile component than “Cull pattern”, and can generally completely replace the functions of “Cull Pattern”. Instead of having one set of output, Dispatch sorts geometry into two groups. The geometry that passes “The Test” will get put into group “A” while the failures are not sent into the Black Hole. Instead, they are sent to another pile, group “B”. So all the geometry is still present, it is only sorted into two groups.
Here I gave the geometry in group A a lighter shade, while geometry in group B gets a darker shade. If I wanted to, I could run another test and another dispatch on either group A or group B to have 3 categories of geometry, but balancing the proportions gets a bit more complicated.
Variations
So now that the random paver generator is set up, I can quickly test variations by changing the threshold required to pass the Dispatch test.
In the nine examples above, the first row is variations with 15% darkness, the second 50%, and the third 90%. The three potential variations for each range are created by changing the random number seed. These could be seen as potential outcomes for a random process, which the construction of this particular pavement pattern might imply. If the contractor buys 15% dark stones and 85% light stones, mixes them together, and then lays them out sequentially, the exact pattern cannot be foreseen but potential variations can be. If all the acceptable variations of the random number seed are acceptable, the project can move forward. If not, additional rules may need to be specified.
Before moving on from this topic, I just wanted to show a couple of images of this script in application. This cropped up a lot in designs from the past few years. These are two images from the winning competition entry for the Quito airport by Ernesto Xavier Bilbao Paredes Arquitectos for the quito Airport. Looks like they used this for both the paving pattern and the canopy structure….
Click Here to Download GH File
Is there a way to do this with more than one color?
LikeLike
Yes, there is. You would just need to do a second dispatch after the first one.
LikeLike
How would you dispatch a combination of three colors?
LikeLike
Since dispatch can only make two lists based on True/False values, the easiest way is to do two dispatches in a row. Another Option is to use the “Sift Pattern” component where you can have more than 2 Outputs, but then you need to be smarter in how you create your sift pattern input.
LikeLike
Why did you use the Bounds component before the custom preview?
LikeLike
that’s the “boundary surface” component, not bounds. It creates a surface that you can color.
LikeLike
I want to create a gradient in random variation.
Please tell me how to do it.
LikeLike
I’m not sure exactly what you want to do but a few of the practical examples at the end might help, especially https://generativelandscapes.wordpress.com/2015/05/19/kobmagergade-copenhagen-karres-en-brands-case-study-3/
LikeLike