GS Script. Boolean Circle Extrusions
by vlad_molch in Design > 3D Design
15 Views, 0 Favorites, 0 Comments
GS Script. Boolean Circle Extrusions
A Grasshopper study that reads circle radii, tests them against a variable condition, and separates the circles into two groups for further processing. Each group is then extruded to a different height in the Z direction.
Supplies
- Laptop or desktop computer
- Rhino 8
- Grasshopper
- Algorithms-Aided Design: Parametric Strategies Using Grasshopper by Arturo Tedeschi
Evaluate Component
With the "Evaluate" component we can test simple expressions that produce Boolean values like "True" and "False". Start with "x > 5" and one number slider, then test multiple values through adding "Merge" component, then test two variables with an expression such as "x + y = 6". Each evaluation returns a Boolean result: True when the condition is met and False when it is not.
Cull Pattern Component
Draw circles with different radii in Rhino. In Grasshopper, add a Curve parameter, right-click it, choose Set Multiple Curves, and select the circles. Deconstruct Arc reads each radius as data sets. Evaluate tests them with x > 8, then Cull Pattern keeps the selected group for extrusion.
Dispatch Component
To make "Dispatch" instead of "Cull Pattern" to process both Boolean results. The "True" circles go to List A and the "False" circles go to List B. Connect each list to its own "Unit Z" and "Extrude" component to give the two groups different heights.
Concatenate Component Test
Concatenate joins text fragments into one expression from two panel components for "The sun" and "is in the sky" to one complete sentence. The Boolean expression part "x >" when combined with a Number Slider creates a live condition such as "x > n" at the output. This replaces a fixed number in the Evaluate component with an adjustable threshold.
Concatenate Component Addition
"Concatenate" component combines the equation "x >" in the panel with a Number Slider to create a live expression, such as x > n. Connect this result with "Evaluate Function" component of the existing script. Moving the slider changes the radius domain of extruded curves, which updates the Dispatch pattern from the list of all curves and their extrusion heights.
Combined File
The final script combines three circle sets and produces different extrusion results through the coordinated use of Evaluate, Cull Pattern, Dispatch, and Concatenate. The complete Grasshopper file is attached for testing and modification.