Grasshopper Notes 1

How to Install Grasshopper
Go to the Grasshopper site and select Download > Latest Version from the navigation bar. Input your email address, download the file and execute it. Or you can click this link.

Introduction to Grasshopper
Grasshopper is a visual scripting editor for the Rhinoceros environment (i.e. a plugin). It allows for greater functionality, geometric control and data processing. For all intents and purposes, you can consider the geometry created in Grasshopper “fake” – it is merely a preview until it is “baked” into Rhino. More on this in a following tutorial.

Almost all Grasshopper components (capsules) are functions that have both input(s) and output(s). These transfer information to each other with wires, literally plugging into other components.


Topic_01: Grid + Number Slider

  1. In the ribbon, select the Vector Tab>Grid> Square (Square Grid)
  2. A small grey component appears with 4 imputs (left side: P, S, Ex, Ey) and 2 outputs (right side: C, P) Zoom in and hover your mouse over each individual imputs/outputs to see exactly what they represent.
  3. In the ribbon, select the Params Tab>Input>Number Slider. Essentially the number slider can be seen as a component that allows you to modify specific numeric inputs.
  4. In the case of our square grid, it allows us to parametrically modify the number of cells in the x and y direction. (Ex, Ey inputs from the Square Grid)
  5. In the number slider component, play with moving the slider from left to right. Notice that currently the number values are set to “real numbers” (i.e 0.250, 0.564) Since we are looking to adjust the number of cells in the x and y direction, we whole numbers or “integers” (i.e. 1, 2, 10, 24)
  6. To change this we’ll need to right click on the number slider and in the menu that appears select Edit.
  7. In the slider Slider Section>Rounding notice currently the “R” (Floating Point Numbers) is highlighted. Instead select the “N” (Integers)
  8. In the Numeric Domain>Min/Max notice the “min” is currently set to 0. In this case it is okay since we cannot have a negative number define the number of cells in any given direction.
  9. We’ll need to however update the “max” value as it currently is set to 1. Double clicking the number allows you modify this value. We’ll change this to a numeric value of To save the numeric value click the green check mark.
  10. Click Okay to close the window
  11. Select the number slider you just modified; copy and paste it (Now you have two!!!)
  12. Next connect one of the number sliders to the “Ex“ input of the Square Grid; Connect the other number slider to the “Ey” input of the Square Grid
  13. Play with the sliders to see how the different inputs affect the grid.

Topic_02: Image Sampler

  1. In the ribbon, select the Params Tab>Input>Image Sampler (Image). A component appears with an exclamation mark in the center (Because currently there is no image set)
  2. Double click the near the exclamation mark, a window appears.
  3. In the File Path section in the window select the “” button. A new window appears prompting you to specify an image from your computer. Navigate to your desktop and select the “Mt. Hood” image that you downloaded from the server earlier. Once you have selected the image, you’ll see a preview of the image to the left.
  4. In the Channel section notice that there are 8 different icons and if you hover over them highlight their specific function (i.e RGBA Colours, Red Channels, Green Channels, etc) The far right icon is labeled “Colour Brightness” Ensure it is selected, by clicking on it.
  1. In the Channel section ensure that the “Interpolate” option is checked
  1. In Tiling section click the double dropdown menu which is currently set to “Tile” and change it to “Clamp”
  1. Next we’re going to have to change the X-Domain and Y-Domain which both are currently set to “0.0 to 1.0” since earlier we changed our number slider to input numeric values up to 1000 well go ahead and change the X-Range to “0 to 150.0” and the Y-Range to “1.0 to 100.0” (Think of this in a way of pixel count in the x/y direction of an image.)
  1. Click Okay
  1. Connect the “P” output of the Square Grid to the input of the Image Sampler

Topic_03: Circles + Multiplication Factor

  1. In the ribbon, select the Curves Tab>Primitive>Circle (circle defined by base plane and radius). There a number of other ways to construct a circle, ensure you select the correct one. A component appears
  2. Again notice the inputs P and R (Plane, Radius) and the output C (resulting Circle)
  3. Connect the “P” (Points) output of the Square Grid to the “P” (Plane) input of the Circle.
  4. Connect the output of the image sampler to the “R” (Radius) input of the
  5. Notice our circles are overlapping (They are too big)

Week 06 | Introduction to Grasshopper: Primitive Geometry + Data Tree (LINES FROM POINTS)

GOAL: To learn the basics of Grasshopper and its relationship to Rhino by creating lines from points; to explain the fundamentals of Grasshopper’s Data Tree organization.

CLASS EXERCISES
Tuesday, May 05, 2015
| Introduction to Grasshopper: interface + components (types, uses, etc.)

Script 3.1a: single line from points: create points in both Rhino and Grasshopper, create line, preview on/off, bake

  • NOTES: Components You Will Need
    • [Point] Holds 3D point geometry
    • [ConstructPoint] Create a 3D point in Grasshopper
    • [Slider] A range of numerical values
    • [Line] Creates line between two points
    • [Panel] Custom notes and data
  • STEP 01: Create two points
    • Method 01: First,  create two points in Rhino. Reference these points in individual [Point] capsules. Hover over the component > right click > “Set One Point” > select the Rhino 3D point.
    • Method 02: Retrieve a [ConstructPoint] component and three [Slider] components. Use these sliders for the X, Y, Z inputs.
  • STEP 02: Create line (curve)
    • Retrieve a [Line] component. Plug output of points into input of the line.

Script 3.1b: multiple lines from points, graft/flatten (Data Trees)

  • NOTES: Components You Will Need
    • [Point] Holds 3D point geometry
    • [ConstructPoint] Create a 3D point in Grasshopper
    • [Slider] A range of numerical values
    • [Line] Creates line between two points
    • [Panel] Custom notes and data
    • [Move] Move geometry in a direction
    • [DivideCurve] Divide curves into equal length segments
    • [ParamViewer] Visualize data structure
    • [ListItem] Access a specific item from a list
    • [GraftTree] Removes all branches (condenses list)
    • [FlattenTree] Adds branch (level of hierarchy)
  • STEP 01: Copy previous script
    • use Ctrl+C, Ctrl+V to do this
  • STEP 02: “Copy” line
    • use [Move] component to “copy” the initial line
  • STEP 03: Divide lines
    • use [DivideCurve] to create equal number of points on each line
  • STEP 04: Create lines between points
    • use the previously created points in conjunction with the [Line] component to create lines between them
    • Use the [GraftTree] and [FlattenTree] components to understand underlying data structure

Deliverable (due at end of class period): “print screen”

Thursday, May 07, 2015 | 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): “print screen”

LAB SESSIONS: Image Sampler
Script 3.1e: simple image sampler (circles varying radii based on referenced image)

Skip to toolbar