Intro to Grasshopper
Running Grasshopper
Grasshopper should already be installed on the all the IDeATE Windows laptops.
- In Windows start box select Rhinocerous 6 (64-bit).
- After Rhino starts up, close both RhinoCam tabs and minimize the
help pane on the right.
- In the Rhino command box, type "Grasshopper" and hit Enter.
- Accept the license terms.
- Resize the Rhino and Grasshopper windows so they are next to each
other and don't cover each other.
Making a Spiral Array
- To make a number slider, double click in the canvas to call up a
search box and type "0 < 1 < 10".
- Make another number slider as "0 < 0.1 < 0.5". Put it below the first one.
- Make a third number slider as "1 < 50 < 200".
- Click on the Sets tab.
- Find the Sequence palette, and click on the down-arrow to reveal
the entire palette.
- Click and drag a Series component on the canvas.
- Go to the Display pulldown menu and turn on Draw Icons and
Draw Fancy Wires. Tun off Draw full Names. Try toggling the Draw Icons
and Draw Full Names settings to see their effect.
- Hover over the S, N, and C labels (not the nodes) to get pop-up help.
- Connect the first slider to the series component's S (starting
value) input by clicking on the slider's output node and dragging the
mouse to the series component's S input node.
- Connect the second slider to the N (step size) input.
- Collect the third slider to the C (count) input.
- Replacing a connection: connect the first slider to the C input
node and this replaces the connection from the third slider to the C
input. (If you want to keep the old connection around, use
shift-click when drawing the new connection.)
- Deleting a connection: put the mouse on the source node (watch
the mouse pointer change shape), hold down the Control button, and
draw the connection you want to eliminate.
Using a Panel to View Data
- Hover over the series component's S output label and observe the
data.
- Go tothe Params tab, and from the Input Palette, drag a Panel component on the canvas. Put it to the right of and below the Series component.
- Connect the Series component's S output to the Panel component's input. use the scoll bar to view the data.
Navigating the Canvas
- The right mouse button translates.
- The scroll wheel (or
Control-right button) zooms.
- The little navigation aide in the bottom right corner points
toward your model.
Points On A Circle
- Go to the Maths tab, and form the Trig palette insert a Cos
component and a Sin component to the right of the Series component.
Stack them one above the other.
- Connect the output of the series component to the inputs of the
Cos and Sin components.
- Hover over the "y" output labels to see the values.
- Go to the Vector tab, and from the Point palette select a
Construct Point component (first icon). Place it to the right of the
Cos and Sin components.
- Connect the Cos component to the X input and the Sin component to
the Y input. Leave the Z input unconnected.
- Hover over the Pt output and observe the values.
- Look in the Rhino window and you will see the points displayed.
They form roughly 3/4 of a circle.
- Move the Count slider and observe the effect. Set the count to 20.
- Move the Step slider and observe the effect.
- Double click on the Step slider and type in the value 0.045.
- Right click on the Step slider and drag the "number of digits"
slider from 1 to 2 digits.
- Set the slider parameters back to 1 / 0.1 / 50.
Making a Spiral
- Go to the Maths tab and from the Operators palette, insert a Multiply component.
- Connect the Pt output of the Construct Point component to the A
input of the Muliply component.
- Connect the S output of the Series compnent to the B input of the Multiply component.
- Look in the Rhino window and you'll see two sets of points.
- Click on a componen in the Grasshopper window; when the component
turns green, so do its points. Points belonging to other components
are shown in red.
- Right click on the Construct Point box and disable Preview to hide its points.
- Go to the Curve tab and from the Spline palette select Interpolate. Put
the component to the right of and below the Multiply component.
- Connect the output R of the Multiply component to the vertices
input (V) of the interpolate component.
- Observe the result in Rhino.
- Insert a Curve > Primitive > Line component above the Interpolate
component.
- Connect the outputs of the Construct Point and Multiply
components to the A and B inputs of the line component, respectively.
- Observe the result in Rhino.
- Increase the Count slider from 50 to 100 and observe the result.
Making the Ellipses
- Disable preview for the Line component.
- Go to the Curve > Primitive palette and open the pulldown menu
to see the full palette. Insert an Ellipse component.
- Connect the output R of the Multiply component to the point (P) input of the Ellipse component.
- Observe the result in Rhino.
- Hover over the E, F1, and F2 output labels of the ellipse to see the data.
Scaling the Ellipses
- Inser a Maths > Polynomials > Square Root component below
and to the left of the Ellipse component.
- Connect the Series component's S output to the input of the Square Root.
- Insert a Maths > Operators > Multiply component to the left
of and below the Ellipse component. You may need to move things
around to make room.
- Double click on the canvas and insert a number slider "0 < 0.40
< 1" above the Multiply component.
- Connect the number slider's output to the A input of the Multiply.
- Connect the Square Root component's output to the B input of the Multiply.
- Connect the output of the Multiply to the R1 input of the Ellipse.
- Observe the effect in Rhino.
- Create a second number slider "0 < 0.20 < 1".
- Insert another Multiply and connect the output of the new slider to the A input of the Multiply.
- Connect the output of the Square Root to the B input of the new Multiply.
- Connect the R output of the multiply to the R2 input of the Ellipse.
- Move the sliders to observe the effects in Rhino. Then set the
slider values back to 0.4 and 0.2.
Rotating the Ellipses
- Go to the Transform tab, and from the Euclidean palette's
pulldown menu insert a Rotate Direction component. Chose
the fourth Rotate component: the one with no yellow plane in
the icon.
- Connect the Ellipse component's E output to the geometry (G) input
of the Rotate component.
- Connect the output of the point Multiply component to the center
of rotation (C) input of the Rotate component.
- Also connect the point Multiply output to the final direction (T)
input of the Rotate component.
- Final slider settings: 6 / 0.2 / 180.
A More Tightly Packed Spiral
- The spiral we created scales up to any size because the ellipses grow at a rate proportional to the square root
of their distance from the center. However, we can get a more esthetically pleasing effect if we allow the ellipses
to grow more quickly.
- Bypass the Square Root component by connecting the output of the Series component directly to the two
Multiply components that were formally fed by Square Root.
- Change the ellipse R1 and R2 scale factors to 0.1 and 0.05.
- Change the Step slider to 3 digits of precision, and then adjust the slides to 6 / 0.265 / 150.
- The result is a more tightly packed ellipse pattern, but if we increase the number of ellipses further
they will start to overlap, so this pattern does not scale up infinitely.
Saving As a DXF File
- Try clicking on an ellipse in the Rhino display. You can't select it.
- In Grasshopper, right click on the Rotate component and select Bake.
Turn on the option to group the results.
- Now clicking on an ellipse in Rhino selects the entire array.
- Go to File > Export Selected and select the spiral.
- Hit enter to finish the selection.
- Save the file in AutoCAD DXF format as spiral.dxf. You may need to click on "Options" and
change the scheme to "R12 Natural".
Dave Touretzky
Last modified: Wed Apr 5 20:31:55 EDT 2017