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
- Modulus
Method 1 Mass Addition
Step 1 | Set Curves
Reference the areas to be calculated as curves.Step 2 | Calculate the areas
Calculate the areas using the area component and place an expression to reduce the units to square metres.Step 3 | Mass Adition
Place 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 Operators
You 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 Percentages
Place a ‘Multiply’ component into your Grasshopper file and multiply the percentages (decimal place) by 100.Method 3 Modulus
You can use the ‘Modulus’ component to select geometry in your Grasshopper file according to a specific pattern.Step 1 | Setup your components
Place a ‘Modulus’, a ‘Series’ and a ‘List Length’ component into your Grasshopper file.Step 2 | Reference and count your Surfaces
Reference 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 List
Connect the number from the List Length output to the Series component to generate a numbered list from 0 to 9.Step 4 | Setup your Modulus
Connect 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 0
Use the Equality component to find the items with a modulus of 0.Step 6 | Dispatch Surfaces
With the true/false pattern, dispatch the original surfaces.Step 7 | Custom Previews
Use 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 [dev] community via Facebook.
Posted on 09 Oct 2023