Grasshopper Notes 2 – Data Trees

Week 06 | Introduction to Grasshopper: Data Trees & 3D Grids

GOAL: To add mild complexity to Grasshopper and gain exposure to nested parameters; to explain the fundamentals of Grasshopper’s Data Tree organization.

CLASS EXERCISES
| Continuation of GH Notes 1,  Focus on script C in 3.1 WK6 lectures|

Script 3.1C: Simple parametric attractor: create a curve in both Rhino and Grasshopper, create a grid, copy curve to grid cells and alter based on proximity to an object.

  • NOTES | Main components you will need:
    • [Point] Holds 3D point(s) in a list.
    • [Grid] Builds a grid of rectangles.
    • [Distance] Finds length of a line between two points.
    • [Bounds] Finds greatest and least value from a list.
    • [ConstructDomain] Creates a custom bounds/domain.
    • [DeconstructDomain] Separates a domain into two float values.
    • [Remap] Remaps an existing list to a new domain.
    • [Rectangle] Creates a custom rectangle based on 3 lengths.
    • [Move] Moves geometry from one point to another.
    • [Rotate] Rotates a geometry around an axis.
    • [ConstructPoint] Create a 3D point in Grasshopper that will appear in Rhino. 
    • [Slider] A range of numerical values that can be quickly changed.
    • [Line] Creates line between two points.
    • [Panel] View and create custom notes and data.
  • STEP 01: Create a grid
    • Using a Square (SqGrid) component and two sliders, create a grid of rectangles that we will use to array our objects. The purpose of this grid is to set the points that we will duplicate this object to, before adjusting each duplicate based on a specific factor.
  • STEP 02: Construct a domain
    • Using a Distance component, find the distance between a point created in Rhino and the ‘Points’ output from your SqGrid. This will create a list of distances between these endpoints and your movable geometry.
    • Find the domain (closest and farthest distance) of this list of distances with a Bounds component. We can then use two sliders and a Domain component to create a new domain that we will swap for this ‘actual’ one.
    • Create a Remap Numbers component and use the flattened Bounds as the Value input, and the constructed domain as the Target input.
  • STEP 02: Set a geometry
    • Method 01: In Rhino, create a custom shape made of one or more curves. Using a Curve component in Grasshopper, bring the geometry from Rhino by right clicking the Grasshopper Curve component, “Set value,” and select your curve(s) in Rhino.
    • Method 02: In Grasshopper, create a Rectangle, Circle, or Polygon component to substitute for the above custom shape. You can adjust the dimensions and ‘parameters’ of these components using sliders.
  • STEP 03: Move and adjust the geometry
    • Using an Evaluate Curve component or an Area component, find a useful start-point for your Rhino custom geometry or Grasshopper geometry.
    • We will create a vector between this point and the corner points created by our SqGrid component. Plug these two lists of points into a Vector 2Pt component with the custom geometry as the start point, and the grid as the end point.
    • Plug the geometry itself into a Move component, and use the above vector created by the Vector 2Pt component as the movement vector. You should now see your starting geometry copied to the points that make up the grid.
  • STEP 04: Change and bake the geometry
    • The example script has several ways to change the geometry we have created.
    • First, we can use a Rotate component to rotate our moved geometry. If we utilize the distance value we created earlier as the amount to rotate by, each of our geometries will be rotated differently as they are all different distances from the point. You can use a multiplication component to make this slight different more dramatic.
    • Next, we can take our moved and rotated geometry and make it 3D using a loft component.
      • Take our moved / rotated geometry and move it again using a Move component, a Unit Z component, and a our distance value to create variation. This will create a copy of our geometries on the grid floating ‘above’ the original one by a length matching its distance from the point.
      • Now we can graft the start grid geometries and the end grid geometries to make them individual elements instead of a list of multiple elements.
      • Using a loft component we can loft between the start grafted geometry and the end grafted geometry to make ‘pillars’ of a specific height. If the height isn’t dramatic enough then you can multiply the distance value heading in to the Unit Z component.

Deliverable (due at end of class period): a screenshot using Snip & Sketch in Windows or use the command ViewCaptureToFile in Rhino.

| External Forces + Simple Operations (ATTRACTOR BASED ALGORITHMS)|
Script 3.1c: Circles derived from GH square grid, first same radii, then with point-attractor cluster.
Script 3.1d: 3D sub-divided NURBS surface point-attractor.
Deliverable (due at end of class period): a screen capture of your script.

Skip to toolbar