FOR VERSION 0.6.0007 BY ANDREW PAYNE & RAJAA ISSA
4 For plugin version 0.6.0007fold or unfold the dialog. This is a great way to switch between the plug-in and Rhino because it minimizes the Editor w
94 For plugin version 0.6.0007• Run time message: for errors and warnings. • Disconnect and Disconnect All. Work the same as other Grasshopper comp
95For plugin version 0.6.0007 You may use this menu to open input manager and change parameters names, add new ones or delete as shown in the image.
96 For plugin version 0.6.0007 13.4 Out Window and Debug Information Output window which is called “out” by default is there to provide debug info
97For plugin version 0.6.0007 13.5 Inside the Script Component To open your script component, double click on the middle of the script component
98 For plugin version 0.6.0007 B: Grasshopper_Custom_Script Class Grasshopper_Custom_Script class consists of three parts:
99For plugin version 0.6.0007 1. Members: This includes two references; one to the current rhino application (app) and the other to the active do
100 For plugin version 0.6.0007 Visual Basic DotNET 14.1 Introduction There are plenty of references about VB.NET available over the Internet
101For plugin version 0.6.0007 Assigning meaningful variable names that you can quickly recognize will make the code much more readable and easier
102 For plugin version 0.6.0007Keep in mind that arrays in VB.NET are zero based, so when you declare an array size to be (9) that means that the arr
103For plugin version 0.6.0007 14.5 Operators There are many built-in operators in VB.NET. They operate on one or more operands. Here is a table o
5For plugin version 0.6.0007 11. Cluster exploder (turn all selected clusters into loose objects) Cluster objects are not finished yet and are more
104 For plugin version 0.6.000714.6 Conditional Statements You can think of conditional statements as blocks of code with gates that get executed on
105For plugin version 0.6.0007 [ Continue For ] ‘optional: to skip executing the remaining of the loop statements. [ other statements]
106 For plugin version 0.6.0007 [ other statements] ‘While loop body ends here ‘Go back to the start of the loop to check if the con
107For plugin version 0.6.0007 14.9 Subs and Functions RunScript is the main function that all script components use. This is what you see when
108 For plugin version 0.6.0007 Sub… End Sub: Are keywords that enclose function block of code “RunScript”: is the name of the sub “(…)”: Parentheses
109For plugin version 0.6.0007 separate in an external sub and probably reuse in future code. Here is a re-write of the grid example using external
110 For plugin version 0.6.0007 14.10 Recursion Recursive functions are special type functions that call themselves until some stopping condition
111For plugin version 0.6.0007 Recursive solution. Note that inside the “DivideAndRotate” sub there are: • Stopping condition to exit the sub. •
112 For plugin version 0.6.0007 This is the same functionality using iterative solution using a “while” loop:
113For plugin version 0.6.0007 14.11 Processing Lists in Grasshopper Grasshopper script component can process list of input in two ways: 1. Proce
6 For plugin version 0.6.0007G: UI Widgets Currently, the only UI widget available is the Compass, shown in the bottom right corner of the Canvas. T
114 For plugin version 0.6.0007In the following, we input the list of numbers. You can do that by right mouse click on the input parameter and check
115For plugin version 0.6.0007 B: If “List” only is checked, then the component is called three times in each time, a list of divide points of one c
116 For plugin version 0.6.000714.13 File I/O There are many ways to read from and write to files in VB.NET and many tutorials and documents are ava
117For plugin version 0.6.0007
118 For plugin version 0.6.0007 Rhino .NET SDK 15.1 Overview Rhino .NET SDK provides access to OpenNURBS geometry and utility functions. The
119For plugin version 0.6.0007 Control points Control points of a NURBS curve is a list of at least (degree+1) points. The most common way to chang
120 For plugin version 0.6.0007 Evaluation rule The evaluation rule uses a mathematical formula that takes a number and assigns a point. The formula
121For plugin version 0.6.0007 The surface on the left is untrimmed. The one on the right is the same surface trimmed with an elliptical hole. Note
122 For plugin version 0.6.0007 OnPolylineCurve OnArcCurve OnNurbsCurve OnCurveOnSurface OnCurveProxy • OnBrepTrim • OnBrepEdge o OnSurface
123For plugin version 0.6.0007 15.4 Class structure A typical class (which is a user-defined data structure) has four main parts: • Constructor:
7For plugin version 0.6.0007 Viewport Preview Feedback: A) Blue feedback geometry means you are currently picking it with the mouse. B) Green ge
124 For plugin version 0.6.0007You can use the “New” function if available Dim new_pt as New On3dPoint new_pt.New( input_pt ) There is also a “Set”
125For plugin version 0.6.0007 Vector Subtraction: Dim subtract_vector As New On3dVector = v0 – v1 Vector between two points: Dim dir_vector As Ne
126 For plugin version 0.6.000715.7 OnNurbsCurve In order to create a nurbs curve, you will need to provide the following: - Dimension, which is t
127For plugin version 0.6.0007 Clamped vs periodic NURBS curves Clamped curves are usually open curves where curve ends coincide with end control
128 For plugin version 0.6.0007Note that the periodic curve turned the four input points into seven control points (4+degree)” and while the clamped
129For plugin version 0.6.0007 Weights Weights of control points in a uniform nurbs curve are set to 1, but this number can vary in rational nurbs c
130 For plugin version 0.6.0007Divide NURBS curve Dividing a curve into a number of segments involves the following steps: - Find curve domain whic
131For plugin version 0.6.0007 representation hat is easier to understand than NURBS and are typically more light-weighted. It is relatively easy t
132 For plugin version 0.6.000715.9 OnNurbsSurface Similar to what we discussed for OnNurbsCurve class, to create a OnNurbsSurface you will need to
133For plugin version 0.6.0007 Another common example is to divide a surface domain. The following example divides surface domain into a equal n
8 For plugin version 0.6.0007 Grasshopper Objects* Grasshopper Definition Objects A Grasshopper definition can consist of many different
134 For plugin version 0.6.0007 OnSurface class has many functions that are very useful to manipulate and work with surfaces. The following exampl
135For plugin version 0.6.0007 Using the previous example, we will calculate normal vector of the start and end points of the pulled curve. Here
136 For plugin version 0.6.0007 This is the component picture showing output of parameter value at the end points using both functions. Notice that
137For plugin version 0.6.0007 15.10 Surface Classes not Derived from OnSurface OpenNURBS provides surface classes not derived from OnSurface. The
138 For plugin version 0.6.000715.11 OnBrep Boundary representation (B-Rep) is used to unambiguously represent objects in terms of their boundary su
139For plugin version 0.6.0007 OnBrep member variables OnBrep Class member variables include all 3d and 2d geometry and topology information. Once
140 For plugin version 0.6.0007 The following diagram shows OnBrep member variables and how they reference each other. You can use this infor
141For plugin version 0.6.0007 Here is another more detailed diagram of how brep parts are hooked together and how to get from one part o the othe
142 For plugin version 0.6.0007This is an example to create a brep box from corner points. Navigate OnBrep data The following example shows how to
143For plugin version 0.6.0007 The following example shows how to get the number of geometry and topology parts in a brep box (faces, edges, trims,
9For plugin version 0.6.0007 F) A component containing errors. Similar to warnings, it is not possible to see where the error was generated in a com
144 For plugin version 0.6.0007 Other OnBrep member functions OnBrep class has many other functions that are either inherited from a parent class o
145For plugin version 0.6.0007 Another area that is useful to know about is the mass properties. OnMassProperties class and few of its functions
146 For plugin version 0.6.0007There are few functions that start with “Is” that usually retunes a Boolean (true or false). They inquire about the br
147For plugin version 0.6.0007 15.12 Geometry Transformation OnXform is a class for storing and manipulating transformation matrix. This includes,
148 For plugin version 0.6.0007 15.13 Global utility functions Aside from member functions that come within each class, Rhino .NET SDK provides g
149For plugin version 0.6.0007 OnUtil Here a summary of functions available under OnUtil that is related to geometry: OnUtil intersections ON_In
150 For plugin version 0.6.0007IOnPlane with IOnPlane OnLine IOnLine with IOnPlane Parameter t (Double) IOnLine with IOnLine Parameters a & b
151For plugin version 0.6.0007
152 For plugin version 0.6.0007RhUtil Divide curve It is possible to divide a curve by number of segments or length on curve using the utility funct
153For plugin version 0.6.0007 RhUtil Curve through points (interpolate curve) RhinoInterpCurve: Function name. 3: curve degree pt_array: points
10 For plugin version 0.6.0007Using Context Popup Menus All objects on the Canvas have their own context menus that expose most of the features for t
154 For plugin version 0.6.0007RhUtil Create edge surface The input in the following example is a list of four curves and the output is an edge surf
155For plugin version 0.6.0007 Help Where to find more information about Rhino DotNET SDK There is a lot of information and samples in McNe
156 For plugin version 0.6.0007Notes
157For plugin version 0.6.0007
11For plugin version 0.6.0007 Persistent Data Management* Types of Data Parameters are only used to store information, but most parameters c
12 For plugin version 0.6.0007Once you click on either of these menu items, the Grasshopper window will disappear and you will be asked to pick a vec
13For plugin version 0.6.0007 Volatile Data Inheritance* Data Inheritance Data is stored in parameters (either in Volatile or Persistent for
The Grasshopper Primer, Second Edition – for version 0.6.0007 Copyright 2009 All Rights Reserved
14 For plugin version 0.6.0007 We can do the same for the "Y" parameter of the PtGrid component and the "A" and "B" p
15For plugin version 0.6.0007 Note that we can make connections both ways. But be careful, by default a new connection will erase existing connect
16 For plugin version 0.6.0007 You can also disconnect (but not connect) sources through the parameter menu:
17For plugin version 0.6.0007 Grasshopper also has the capability to transfer information wirelessly through the use of a receiver, found under the
18 For plugin version 0.6.0007 Data Stream Matching* Data matching Data matching is a problem without a clean solution. It occurs when a comp
19For plugin version 0.6.0007 Imagine we have a point component which inherits its x, y and z values from remote parameters which contain the follow
20 For plugin version 0.6.0007 "Cross Reference" will connect all values in X with all values in Y and Z, thus resulting in 10×5×2 = a hu
21For plugin version 0.6.0007 Scalar Component Types Scalar Component Types are typically used for various mathematical operations and consi
22 For plugin version 0.6.0007o Upper limit: 100.0 o Value: 50.0 (note: this value is arbitrary and can be modified to any value within the upper a
23For plugin version 0.6.0007 7.2 Conditional Statements You probably noticed that there were a few components under the Operators subcategory of th
Introduction Welcome to the wonderful new world of Grasshopper. This is the second edition of this primer and it wouldn't have been possible wi
24 For plugin version 0.6.0007also has an output that determines the absolute value distance between the two input lists. C) Larger Than component w
25For plugin version 0.6.0007 7.2 Range vs. Series vs. Interval The Range, Series, and Interval components all create a set of values between two n
26 For plugin version 0.6.0007set to 10, the final output values defined in the series shows 10 numbers, that start at 1 and increase by 10 at each s
27For plugin version 0.6.0007 7.3 Functions & Booleans Almost every programming language has a method for evaluating conditional statements. In
28 For plugin version 0.6.0007action. The Dispatch component works by taking a list of information (in our example we have connected the numeric sli
29For plugin version 0.6.0007 7.4 Functions & Numeric Data The Function component is very flexible; that is to say that it can be used in a vari
30 For plugin version 0.6.0007• Logic/Script/F1 - Drag and drop a single variable Function component onto the canvas • Right-click the F-input of t
31For plugin version 0.6.0007 • Curve/Spline/Curve - Drag and drop a Curve component onto the canvas • Connect the Point-Pt output to the Curve-V
32 For plugin version 0.6.00077.5 Trigonometric Curves We have already shown that we can use Function components to evaluate complex formulas to crea
33For plugin version 0.6.0007 • Select the third slider and set the following parameters: o Name: Frequency o Slider Type: Integers o Lower Limi
Table of Contents Introduction Table of Contents 1 Getting Started 1 2 The Interface 2
34 For plugin version 0.6.0007 • Params/Special/Slider - Drag and drop another number slider onto the canvas • Right-click on this new
35For plugin version 0.6.0007 We have shown how to create a sine wave curve, however you can generate other sinusoidal curves, like a Cosine or Tan
36 For plugin version 0.6.0007 The Garden of Forking Paths In all versions of Grasshopper released prior to version 0.6.00xx, data inside a p
37For plugin version 0.6.0007 branch (or level 4 branch) is a terminus branch, meaning they don't subdivide any further. Each data item is thu
38 For plugin version 0.6.0007However, since we now know that Grasshopper has the capabilities to incorporate paths and branches, we can now use that
39For plugin version 0.6.0007 You can also simplify this definition by flattening your structure inside the Polyline component, and by-passing the F
40 For plugin version 0.6.00078.1 Lists & Data Management It's helpful to think of Grasshopper in terms of flow, since the graphical interfa
41For plugin version 0.6.0007 To start, we have created a Series component, with a starting value of 0.0, a step value of 1.0, and a count of 10. T
42 For plugin version 0.6.0007Shift-S input. We have set the numeric slider type to integers so that the shift offset will occur in whole numbers.
43For plugin version 0.6.0007 8.2 Weaving Data In the last section, we explained how we can use a number of different components to control how list
14 Visual Basic DotNET 100 14.1 Introduction 100 14.2 Comments 100 14.3 Variables 100 14.4
44 For plugin version 0.6.0007 • Open the Input Manager and select the green plus button to add an additional list to the compone
45For plugin version 0.6.0007 • Params/Primitive/String - Drag and drop a String component onto the canvas • Right-click on the String component a
46 For plugin version 0.6.00078.3 Shifting Data We discussed in section 8.1 how we can use the Shift component to move all values in a list up or dow
47For plugin version 0.6.0007 To create the definition from scratch: • Curve/Primitive/Circle CNR - Drag and drop a Circle CNR (Center, Normal, and
48 For plugin version 0.6.00078.4 Exporting Data to Excel There are many instances where you may need to export data from Grasshopper in order to imp
49For plugin version 0.6.0007 To export the list of data from the Post-it Panel, simply right-click on the panel and select Stream Contents. When p
50 For plugin version 0.6.0007 Step 2 of the Text Import Wizard allows you to set the which types of Delimiters will define how your data is separat
51For plugin version 0.6.0007 Step 3 of the Text Import Wizard allows you to tell Excel how you would like to format your data within Excel. Genera
52 For plugin version 0.6.0007Switch back to Microsoft Excel and under the Data Tab, you will see another button that says Refresh All. Select this
53For plugin version 0.6.0007 Vector Basics From physics, we know that a vector is a geometric object that has a magnitude (or length), dir
54 For plugin version 0.6.0007In the example above, we start by creating a point at the origin 0,0,0 using the Point XYZ component (Vector/Point/Poin
55For plugin version 0.6.0007 9.1 Point/Vector Manipulation Grasshopper has an entire group of Point/Vector components which perform the basic opera
56 For plugin version 0.6.00079.2 Using Vector/Scalar Mathematics with Point Attractors (Scaling Circles) Now that we know some of the basics behind
57For plugin version 0.6.0007 To create the definition from scratch: • Params/Special/Numeric Slider - Start by dragging and dropping three numeric
58 For plugin version 0.6.0007 The first step of our definition should look like the screenshot above. If we hover our mouse over each Dist
59For plugin version 0.6.0007 o Lower Limit: 0.0 o Upper Limit: 30.0 o Value: 5.0 • Connect the Falloff slider to the Minimum-B inputs • Curve/
60 For plugin version 0.6.0007 We need to assign another point attractor to our definition... but of course, to do this we need to make another po
61For plugin version 0.6.0007 9.3 Using Vector/Scalar Mathematics with Point Attractors (Scaling Boxes) We’ve already shown how we can use vector an
62 For plugin version 0.6.0007Step 1: Begin by creating a three dimensional point grid • Params/Special/Numeric Slider – Drag and drop 2 sliders ont
63For plugin version 0.6.0007 If you look at the Rhino scene, you will notice that our points don’t necessarily look much like a three dimensional c
1For plugin version 0.6.0007 Getting Started Installing Grasshopper To download the Grasshopper plug-in, visit http://grasshopper.rhino3d.co
64 For plugin version 0.6.0007• Scalar/Operators/Division – Drag and drop a Division component onto the canvas • Connect the Distance-D output to t
65For plugin version 0.6.0007 The List Length component will tell us how many entries are in our list. We can input this information into another L
66 For plugin version 0.6.0007S: Input defines the Shininess of the shader; where a value of 0 means the shader has no shininess, and value of 100 ha
67For plugin version 0.6.0007 Curve Types Since curves are geometric objects, they possess a number of properties or characteristics which
68 For plugin version 0.6.0007Now in Grasshopper, Open the file Curve Types.ghx in the Source Files folder that accompanies this document. You will
69For plugin version 0.6.0007 In our example, we have connected a numeric slider to the Curve-D input to define the degree of our NURBS curve. By
70 For plugin version 0.6.0007resultant curve will actually pass through these points, regardless of the curve degree. In the NURBS curve component,
71For plugin version 0.6.0007 will define the boundaries of each line segment that make up the polyline. The C-input of the component defines wheth
72 For plugin version 0.6.000710.1 Curve Analytics It would be quite difficult to create a tutorial that would utilize all of the analytic tools avai
73For plugin version 0.6.0007 Curve/Utility/Flip Flip the direction of a curve using an optional guide curve Curve/Utility/Offset Offset a curve
2 For plugin version 0.6.0007 The Interface* The Main Dialog Once you have loaded the plug-in, type "Grasshopper" in the Rhino comma
74 For plugin version 0.6.0007 Surface Types* Apart from a few primitive surface types such as spheres, cones, planes and cylinders, Rhino su
75For plugin version 0.6.0007 Grasshopper chooses to handle surface in two ways. The first, as we have already discussed, is through the use of NUR
76 For plugin version 0.6.000711.1 Surface Connect The following example, created by David Fano from Design Reform, is an excellent tutorial that sho
77For plugin version 0.6.0007 To create the definition from scratch: • Surface/Freeform/Sweep2Rail - Drag and drop a Sweep 2 Rails component onto t
78 For plugin version 0.6.0007 You should now see a new surface that is offset 10 units (or whatever value you have set for your Surface Offset sl
79For plugin version 0.6.0007 11.2 Paneling Tools McNeel recently released an excellent free plug-in for Rhino called Paneling Tools. The plug-in,
80 For plugin version 0.6.0007To create the definition from scratch, we’ll first need a set of curves in which to Loft the tower surface. In Rhino,
81For plugin version 0.6.0007 surface will not subdivide correctly if it is not reparameterized into an interval between zero and one. • Scalar/Int
82 For plugin version 0.6.0007o Name: V Interval o Slider Type: Integers o Lower Limit: 5.0 o Upper Limit: 30.0 o Value: 10.0 • Connect the U I
83For plugin version 0.6.0007 the Bounding Box as a reference Brep for the BoxMorph component which we will discuss in a moment. • Right-click
3For plugin version 0.6.0007 C. Component Panels This area exposes all component categories. All components belong to a certain category (such as &q
84 For plugin version 0.6.000711.3 Surface Diagrid We’ve already shown how we can use the Paneling Tools definition to create façade elements on a su
85For plugin version 0.6.0007 Let’s start the definition from scratch: • Params/Geometry/Curve – Drag and drop two Curve components onto the canvas
86 For plugin version 0.6.0007 Our definition, so far, should look like the image above. We have essentially subdivided our surface into smaller sub
87For plugin version 0.6.0007 surfaces, and now that we have them separated, we can connect opposing points with a line to create our diagrid. • Cu
88 For plugin version 0.6.0007 The last part of your definition should look like the image above. This definition will work on any type of single su
89For plugin version 0.6.0007 11.4 Uneven Surface Diagrid We showed in the last example how we can subdivide a surface to create a uniformly spaced
90 For plugin version 0.6.0007In the last definition, we connected the Divide Interval component to the Isotrim component. We will start our definit
91For plugin version 0.6.0007 Mapper component to the V0 and V1 lists and control the V subdivisions in the same manner. Now, all we need to do
92 For plugin version 0.6.0007 An Introduction to Scripting Grasshopper functionality can be extended using scripting components to write code
93For plugin version 0.6.0007 The Scripting Interface 13.1 Where to find the Script Components VB DotNet Script component is found under lo
Comments to this Manuals