Skip to content

Three Simple Methods to Combine Mathematics with Data in Grasshopper

Looking to gather data and analysis from your Rhino model?

Learn how to use mathematical operators in Grasshopper to sum up lists of data and select geometry according to a pattern.

The 3 Methods

  1. Mass Addition
  2. Math Operators
  3. Modulus

Method 1 Mass Addition

You can use Mass Addition in Grasshopper to sum up and calculate lists of data.

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

Place a ‘Division’ component into your Grasshopper script and connect the referenced curve areas and the total curve areas.

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.
Gathering data from a CAD model is becoming increasingly popular within the design and construction industry with digital models being used as a valuable source of information.

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



ArchiStar Office   |   Mezzanine, Levels 1-3, 388 George Street   |   Sydney NSW 2000, Australia   |   Phone: +61 2 9899 5247   |   Contact us

© 2018 ArchiStar Academy   |   Terms of use   |   Privacy of Use   |   FAQ