Grasshopper is a visual scripting platform that is included in Rhino 6.
- With Grasshopper, you will write scripts to automate tasks by dragging controls on to a canvas which is its main interface.
- Parameters like the **Number Slider, Graph Mapper, Random **and **Jitter **are used to drive infinite design options.
- The Grasshopper design is immediately previewed in the Rhino’s application without generating geometry.
- When final design is selected the geometry is created by “baking” into the Rhino object.
Note: **Bike Wheel.GH **is included in the models folder. You can also print **Bike Wheels.JPG **and follow along with the exercise.
Exercise 15-1 The Bike Wheel
The Grasshopper Canvas
-
Begin a new model with template Small Objects Inches.
-
Open the Grasshopper canvas by picking Grasshopper button
in the Standard toolbar or typing: **Grasshopper **in the Command line.
-
Double-click on the top title bar of the Grasshopper window to expand and compress it. However, leave it in the open state. (Windows only feature)
The Grasshopper Settings
There are a couple settings that you will use to control the way the Grasshopper interface will look.
-
From the Grasshopper **File **menu, select Preferences.
-
The Grasshopper Settings dialog will appear.
-
In the left pane, highlight Interface.
-
If you are teaching Rhino to younger students, in the right plane, slide the Content Filter to Strict. This will display the Grasshopper icons in way that is acceptable to younger users.
-
Check the option Show obscure components.
-
Pick the “X’ in the upper right corner of the dialog to save and close Grasshopper Settings.
-
On the **Grasshopper **menu, pick Display.
-
From the Display menu, turn on:
Draw Icons
Draw Fancy Wires
The Finder
When you open a completed Grasshopper defintion file, you can trace any component or parameter back to its location on the menu. Grasshopper will display a finder arrow that will mark where the control is located on the **Grasshopper **menu.
- From the Grasshopper **File **menu, select Open.
- Navigate to the files that you downloaded for this training, and open Bike Wheels.GH.
- While hovering over any Grasshopper parameter or component, hold down the Control + Alt keys, while pressing and holding the Left mouse button
. The red finder arrows will appear.
- You will see the arrows while you have the keys and the mouse button pressed. When you let go, the finder arrow will disappear.
Note: Use Command + Alt with Rhino for Mac.
This is a very helpful way to “reverse engineer” a Grasshopper Definition.
Let’s get started with our first simple Grasshopper definition.
Create the Circles
-
On the Grasshopper **File **menu, pick New Document.
-
On the Grasshopper **Curve **menu, drag and drop two **Circle **components on to the Grasshopper canvas.
-
Double-click on the Grasshopper canvas to open a dialog box with the prompt Enter a search keyword.
-
Type Numberand pick Number slider from the menu.
-
A **Number slider **parameter will be added to the canvas.
-
Drag the output connector from the **Number slider **to the input R of the Circle.
-
Now drag the slider and see the radius of the circle in the **Top **view update.
-
To create the second number slider, Double-click on the canvas and type: 24<32<36.
Plug in the **Number slider **output to the input R for the second circle component.
-
Double-click on the **Radius **label on the first number slider. The Slider dialog will appear.
-
Edit the Min and Max values. Set the Min to 1, the Max to 10, and the Rounding to N, Natural number (Integer).
-
Pick the OK button to close the dialog.
-
Drag the first slider to 6.
Divide the Circle
- On the **Curve **menu, under division, select **Divide Curve **and drop two on to the canvas to the right of the circles. Hint: tap the Alt key while dragging a control to copy.)
- Connect the output circle curve to the Curve input on the **Divide Curve **component. Repeat for the second circle.
Connect the Points
By default, the **Divide **component generates 10 divisions or 10 points on each circle. Now you will make a slider to control that number of points and connect the points to a line component.
-
Double-click on the Grasshopper canvas and create a slider by typing 5<10<20. This will create a **Number slider **that is set to 10, and whose domain is between 5 & 20.
-
Connect the output of the **Number slider **to the N of each **Divide **component.
-
Now drag the slider and watch the points increase and decrease.
-
On the Grasshopper **Curve **menu, from the **Primitive **Section, select **Line **and drag and drop it to the canvas to the right of the divide component.
-
Connect the output Points from the first divide component to the Line curve input A.
-
Connect the output Points from the second divide component to the Line curve input B.
Line curves are now connecting the points from both the circle curves
-
Right click on the **Divide **components and pick on **Preview **to disable the preview of points.
Pipe the Curves
The curves will be used to generate surfaces for the wheel and spokes of the wheel.
-
On the Grasshopper **Surface **menu, under Freeform, select **Pipe **and drag and drop two on to the Grasshopper canvas, to the right of the Line component.
-
Connect the output from Lines to the Curve input of the Pipe component.
-
Double-click on the Grasshopper canvas and create a slider by typing .25<1<2. This creates a **Number slider **that is set to 1, and whose domain is between .25 & 2.00.
-
Connect the output from **Circle **curve to the input **Curve **on the second **Pipe **component.
Note: You will need to hold down the Shift key to make two connection to an input.
-
Double-click on the Grasshopper canvas and create a slider by typing .50<1<3. This creates a **Number slider **that is set to 1, and whose domain is between .50 & 3.00.
-
Connect the output of the last **Number slider **to the input of the radius of the second **Pipe **component.
-
Drag the slider bar and watch the radius of the pipe change.
Orienting the Wheel
The wheel needs to be oriented parallel to the front or the XZ CPlane . To do this, you will go back to the circle and provide a plane to orient the circle.
-
On the Grasshopper **Vector **menu, under Plane, select the **XZ CPlane **component and drag two **XZ CPlane **on to the Grasshopper canvas, to the left of the circle component.
-
Connect the **Plane **output from **XZ **plane to the Plane input of the **Circle **component. Repeat for the second circle. The entire wheel design is now oriented in the Front or the XZ CPlane.
-
Next, preview the spokes in another color. On the Grasshopper **Display **menu under Preview, drag and drop a **Custom Preview **component to the Grasshopper canvas to the right of the spoke pipes.
-
On the Grasshopper Params menu under Input, drag and drop a Color Swatch component to the Grasshopper canvas to the left of the Custom Preview. Drag the output from the **Color Swatch **to the input Material override on the **Custom Preview **.
-
Connect the output from P from **Pipes **to the input **Geometry **of the **Custom Preview **component.
-
Double-click on the Color Swatch
-
Select a custom color from the color picker or drag the sliders for Hue, Saturation, Value, and Alpha transparency. Pick **Accept **when the color preview is as you like.
-
Pick **Save **from the Grasshopper File menu, or pick the **Save **icon from the Grasshopper canvas toolbar.
-
Save definition as Wheels.gh.
Bake The Wheel
The geometry is still only being previewed in Rhino. To send the geometry to Rhino for editing, rendering, printing and more, you will need to Bake from certain components. You can Bake and select a target layer and group the geometry at the same time.
-
On the Grasshopper Params menu, under Primitive, select Data. Place to the right of the **Custom Preview **.
The **Data **component will be used to make a copy of the inputs to be used collectively in another operation, like Bake. -
Connect the output from the both of the **Pipe **components to the Input of Data.
-
Right click over **Data **and select **Bake **from the menu.
-
Select Layer 03 and **Yes Please **to **Group **the output.
-
In the upper right corner of the Grasshopper canvas, turn off the preview of the Grasshopper geometry.
-
Double-click on the Grasshopper title bar to compress the canvas.
-
You will now see the model in Rhino.
-
Render the model.
|
Render the model.
|
Custom bike by Julie Pedalino and Pedalino Bicycles, Lenexa, Kansas.
| |
***Note: *design the bike frame and other features of your bike using Rhino.
See Prof. Steve Jarvis’ ART Final Project
https://vimeo.com/172640973
|