Three Simple Methods to Combine Mathematics with Data in Grasshopper
Learn how to use mathematical operators in Grasshopper to sum up lists of data and select geometry according to a pattern.
The 3 Methods
- Mass Addition
- Math Operators
Method 1 Mass Addition
Step 1 | Set CurvesReference the areas to be calculated as curves.
Step 2 | Calculate the areasCalculate the areas using the area component and place an expression to reduce the units to square metres.
Step 3 | Mass AditionPlace a ‘Mass Addition’ component into your Grasshopper file and connect the list of areas to add up the total floor area for the building.
Method 2 Math OperatorsYou can use mathematical operators to add, subtract or manipulate your data and objects in Grasshopper.
Step 1 | Divide the individual Areas by Total Area
Step 2 | Turn the numbers into PercentagesPlace a ‘Multiply’ component into your Grasshopper file and multiply the percentages (decimal place) by 100.
Method 3 ModulusYou can use the ‘Modulus’ component to select geometry in your Grasshopper file according to a specific pattern.
Step 1 | Setup your componentsPlace a ‘Modulus’, a ‘Series’ and a ‘List Length’ component into your Grasshopper file.
Step 2 | Reference and count your SurfacesReference Surfaces (or another object) from the Rhino file and connect them to the ‘List Length’ component in Grasshopper to count the objects.
Step 3 | Generate a Series ListConnect the number from the List Length output to the Series component to generate a numbered list from 0 to 9.
Step 4 | Setup your ModulusConnect the list into the modulus component and divide by 2. If the number is divisible by 2, the modulus output will be 0.
Step 5 | Find the Modulus of 0Use the Equality component to find the items with a modulus of 0.
Step 6 | Dispatch SurfacesWith the true/false pattern, dispatch the original surfaces.
Step 7 | Custom PreviewsUse a custom preview to highlight the selected pattern.
Digital models are able to use mathematics to perform various operations such as calculating lists of data such as floor areas.
The potential of mathematics in Grasshopper is incredible with it even having the ability to find the combined area of various objects or even select an object according to a defined numerical pattern.
If you would like to share your thoughts on our blog, we’d love to hear from you!
Get in touch with the ArchiStar Academy community via Facebook.
Posted on 28 Mar 2019