Tackling more complex geometries
In the previous blog, we looked at how you can add a stream filter to toggle between a sphere & a box; then we calculated the area. In today’s post we will be staying on the topic of stream filters but we will be looking at what happens when you have more than two geometries. By default, the Stream Filter has two input streams, but you can add as many more as you need.
Step 1: Set up a vertical line with the following geometries ‘box’, ‘sphere’, ‘cylinder’ and ‘pyramid’. By default, the Stream Filter has two input streams, but you can add as many more as you need.
Step 2: Add a ‘stream filter’ to the right of these geometries, like we did last time.
Step 3: Now we will need to add more streams by clicking the plus button at the bottom of the ‘stream filter’.
Step 4: Now we will connect the geometries to the ‘stream filter’. Box should correspond to Stream 0, Sphere should correspond to Stream 1, Cylinder should correspond to Stream 2 and Pyramid should correspond to Stream 3.
Step 5: For the gate input, instead of using a ‘Boolean toggle’, you can simply use a number that refers to the stream you want to choose. Here we add a slider ranging from 0 to 3 which represents all the possible streams.
This helps you to add more logic to the geometry you have chosen: like calculating the area, changing the colour or continuing to model with the chosen geometry.
We also have a video over on our YouTube channel about stream filters as part of our 'Grasshopper Explained' playlist. Alternatively, you can read our previous blog post "How to add a stream filter in Grasshopper in 7 steps" or sign up to our platform here to put your Grasshopper models online and share them.