Grasshopper Primer - 090121
Grasshopper Primer - 090121
Grasshopper Primer - 090121
I have to be honest. Some of the information and many of the tutorials were created by
other great designers, and I cite my sources as needed. Often, there are links at the end
of a tutorial to an online video that should be used as a complement to this manual. The
first 20 pages or so came straight from the RhinoWiki page, which is a wonderful
resource and should be consulted early and often in your search for more information
about the plugin. Another great source of information is the Grasshopper Forum. Here,
you’ll find a growing online community dedicated to furthering this tool by sharing their
questions, concerns, solutions, and definitions to help others out there just like you. I
would encourage each person who reads this primer to join the group and post your
questions online, as there is almost always someone willing to share a solution to your
problem. To learn more, visit http://www.grashopper.rhino3d.com
One of the greatest things about this software is that it is always evolving. The
developers often make changes and add new features, which may or may not conflict
with older definitions. It can make it frustrating and even difficult to keep up with the
speed at which things are moving. This primer was written to work with Grasshopper
version 0.5.0099, which was released in December 2008, and I have no doubt that in
even just a few short weeks it will be outdated. However, I will continue to try to keep
this primer as up to date as possible and add more tutorials as time allows.
It is my hope that this manual will help beginners get a better understanding of the
software, but I by no means expect it to become the Grasshopper Bible. There may very
well be some small errors, here or there, within the primer and I would ask that you bring
those to my attention should you see any inconsistencies in the material. It will only help
the manual become more robust and in turn help others out there as well. That’s about
it. I believe it’s time to jump into the material.
Andy Payne
LIFT architects
www.liftarchitects.com
Copyright 2009 All Rights Reserved
Table of Contents
Introduction
Table of Contents
1 Getting Started 1
2 The Interface 2
3 Grasshopper Objects 8
4 Persistent Data Management 11
5 Volatile Data Inheritance 13
6 Data Stream Matching 17
7 Scalar Component Types 20
7.1 Operators 20
7.2 Range vs. Series vs. Interval 22
7.3 Functions & Booleans 24
7.4 Functions & Numeric Data 26
7.5 Trigonometric Curves 29
8 Lists & Data Management 32
8.1 Shifting Data 35
8.2 Exporting Data to Excel 37
9 Vector Basics 42
9.1 Point/Vector Manipulation 44
9.2 Using Vector/Scalar Mathematics with Point Attractors (Scaling Circles) 45
9.3 Using Vector/Scalar Mathematics with Point Attractors (Scaling Boxes) 49
10 Curve Types 55
10.1 Curve Analytics 60
11 Surface Types 62
11.1 Surface Connect 64
11.2 Paneling Tools 67
11.3 Surface Diagrid 71
1 Getting Started
Installing Grasshopper
To download the Grasshopper plug-in, visit http://grasshopper.rhino3d.com/. Click on
the Download link in the upper left hand corner of the page, and when prompted on the
next screen, enter your email address. Now, right click on the download link, and
choose Save Target As from the menu. Select a location on your hard drive (note: the
file cannot be loaded over a network connection, so the file must be saved locally to your
computer’s hard drive) and save the executable file to that address.
Select Run from the download dialogue box follow the installer instructions. (note: you
must have Rhino 4.0 with the SR4b patch already installed on your computer for the
plug-in to install properly)
This interface contains a number of different elements, most of which will be very familiar
to Rhino users:
C. Component Panels
This area exposes all component categories. All components belong to a certain
category (such as "Params" for all primitive data types or "Curves" for all curve related
* Source: RhinoWiki
http://en.wiki.mcneel.com/default.aspx/McNeel/ExplicitHistoryPluginInterfaceExplained.html
The toolbar panels themselves contain all the components that belong to that category.
Since there are a potentially large number of these, it only shows the N most recently
used items. In order to see the entire collection, you have to click on the bar at the
bottom of the Panel:
This will pop up the category panel, which
provides access to all objects. You can
either click on the objects in the popup list,
or you can drag directly from the list onto
the canvas. Clicking on items in the
category panel will place them on the
toolbar for easy future reference. Clicking
on buttons will not add them to the
Canvas! You must drag them onto the
Canvas in order to add them:
You can also find components by name, by double-clicking anywhere on the canvas;
launching a pop-up search box. Type in the name of the component you are looking for
and you will see a list of parameters or components that match your request.
The canvas toolbar exposes the following tools (from left to right):
E) Component. A component which contains at least 1 error. The error can come either
from the component itself or from one of its input/output parameters. We will learn more
about Component Structures in the following chapters.
All selected objects are drawn with a green overlay (not shown).
G: UI Widgets
Currently, the only UI widget available is the Compass, shown in the bottom right corner
of the Canvas. The Compass widget gives a graphic navigation device to show where
your current viewport is in relation to the extents of the entire definition. The Widgets
can be enabled/disabled through the View menu.
The Remote panel also provides basic preview, event and file-switching controls. You
can enable the panel through the View menu of the Main window, or through the
_GrasshopperPanel command.
• Parameters
• Components
Parameters contain data, meaning that they store stuff. Components contain actions,
meaning that they do stuff. The following image shows some of the possible objects you
are likely to encounter in a Grasshopper definition:
A) A parameter which contains data. Since there is no wire coming out the left side of
the object, it does not inherit its data from elsewhere. Parameters which do not contain
errors or warnings are thin, black blocks with horizontal text.
B) A parameter which contains no data. Any object which fails to collect data is
considered suspect in an Explicit History Definition since it appears to be wasting
everyone's time and money. Therefore, all parameters (when freshly added) are orange,
to indicate they do not contain any data and have thus no functional effect on the
outcome of the History Solution. Once a parameter inherits or defines data, it will
become black.
D) A regular component.
* Source: RhinoWiki
http://en.wiki.mcneel.com/default.aspx/McNeel/ExplicitHistoryPluginObjectsExplained.html
8 For plugin version 0.5.0099
F) A component containing errors. Similar to warnings, it is not possible to see where the
error was generated in a component. You'll need to use the context menu (see below).
Note that a component which contains both warnings and errors will appear red, the
error color takes precedence over the warning color.
Component Parts
A component usually requires data in order to perform its actions, and it usually comes
up with a result. That is why most components have a set of nested parameters, referred
to as Input and Output parameters respectively. Input parameters are positioned along
the left side, output parameters along the right side:
A) The three input parameters of the Division component. By default, parameter names
are always extremely short. You can rename each parameter as you please.
B) The Division component area (usually contains the name of the component)
When you hover your mouse over the individual parts of a Component object, you'll see
different tooltips that indicate the particular type of the (sub)object currently under the
mouse. Tooltips are quite informative since they tell you both the type and the data of
individual parameters:
Here you see the main component menu, with the cascading menu for the "R" input
parameter. The menu usually starts with an editable text field that lists the name of the
object in question. You can change the name to something more descriptive, but by
default all names are extremely short to minimize screen-real-estate usage. The second
item in the menu (Preview flag) indicates whether or not the geometry produced/defined
by this object will be visible in the Rhino viewports. Switching off preview for components
that do not contain vital information will speed up both the Rhino viewport framerate and
the time taken for a History Solution (in case meshing is involved). If the preview for a
parameter or a component is disabled, it will be drawn with a faint white hatch. Not all
parameters/components can be drawn in viewports (numbers for example) and in these
cases the Preview item is usually missing.
The context menu for the "R" input parameter contains the orange warning icon, which in
turn contains a list (just 1 warning in this case) of all the warnings that were generated
by this parameter.
(The exception here are output parameters which can neither store permanent records
nor define a set of sources. Output parameters are fully under the control of the
component that owns them.)
Persistent data is accessed through the menu, and depending on the kind of parameter
has a different manager. Vector parameters for example allow you to set both single and
multiple vectors through the menu.
But, let's back up a few steps and see how a default Vector parameter behaves. Once
you drag+drop it from the Params Panel onto the canvas, you will see the following:
The parameter is orange, indicating it generated a warning. It's nothing serious, the
warning is simply there to inform you that the parameter is empty (it contains no
persistent records and it failed to collect volatile data) and thus has no effect on the
outcome of a history solution. The context menu of the Parameter offers 2 ways of
setting persistent data: single and multiple:
* Source: RhinoWiki
http://en.wiki.mcneel.com/default.aspx/McNeel/ExplicitHistoryPersistentDataRecordManagement.html
Once you have defined all the vectors you want, you can press Enter and they will
become part of the Parameters Persistent Data Record. This means the Parameter is
now no longer empty and it turns from orange to black:
At this point you can use this parameter to 'seed' as many objects as you like with
identical vectors.
Connection management
Since Parameters are in charge of their own data sources, you can get access to these
settings through the parameter in question. Let's assume we have a small definition
containing three components and two parameters:
At this stage, all the objects are unconnected and we need to start hooking them up. It
doesn't matter in what order we do this, but lets go from left to right. If you start dragging
near the little circle of a parameter (what us hip people call a "grip") a connecting wire
will be attached to the mouse:
Once the mouse (with the Left Button still firmly pressed) hovers over a potential target
Parameter, the wire will attach and become solid. This is not a permanent connection
until you release the mouse button:
* Source: RhinoWiki
http://en.wiki.mcneel.com/default.aspx/McNeel/ExplicitHistoryVolatileDataInheritance.html
If the "ADD" cursor is active when you release the mouse button over a source
parameter, that parameter will be added to the source list. If you specify a source
parameter which is already defined as a source, nothing will happen. You cannot inherit
from the same source more than once.
By the same token, if you hold down Control the "REM" cursor will become visible, and
the targeted source will be removed from the source list. If the target isn't referenced,
nothing will happen.
As you can see there are different ways in which we can draw lines between these sets
of points. The Grasshopper plug-in currently supports three matching algorithms, but
many more are possible. The simplest way is to connect the inputs one-on-one until one
of the streams runs dry. This is called the "Shortest List" algorithm:
The "Longest List" algorithm keeps connecting inputs until all streams run dry. This is
the default behavior for components:
This is potentially dangerous since the amount of output can be humongous. The
problem becomes more intricate as more input parameters are involved and when the
volatile data inheritance starts to multiply data, but the logic remains the same.
* Source: RhinoWiki
http://en.wiki.mcneel.com/default.aspx/McNeel/ExplicitHistoryDataStreamMatchingAlgorithms.html
X coordinate: {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0}
Y coordinate: {0.0, 1.0, 2.0, 3.0, 4.0}
Z coordinate: {0.0, 1.0}
If we combine this data in the "Shortest List" fashion, we get only two points since the "Z
coordinate" contains only two values. Since this is the shortest list it defines the extent of
the solution:
The "Longest List" algorithm will create ten points, recycling the highest possible values
of the Y and Z streams:
Every component can be set to obey one of these rules (the setting is available in the
menu by right clicking the component icon).
Note the one big exception to this behavior. Some components EXPECT to get a list of
data in one or more of their input fields. The polyline component, for example, creates a
polyline curve through an array of input points. More points in the input parameter will
result in a longer polyline, not in more polylines. Input parameters which are expected to
yield more than one value are called List Parameters and they are ignored during data
matching.
7.1 Operators
As was previously mentioned, Operators are a set of components that use algebraic
functions with two numeric input values, which result in one output value. To further
understand Operators, we will create a simple math definition to explore the different
Operator Component Types.
Note: To see the finished version of this definition, Open the file Scalar_operators.ghx
found in the Source Files folder that accompanies this document. Below is a screen
shot of the completed definition.
Note: To see the finished version of the following examples, Open the file
Scalar_intervals.ghx found in the Source Files folder that accompanies this document.
The Range component creates a list of evenly spaced numbers between a low and a
high value called the domain of numeric range. In the example above, two numeric
sliders are connected to the input values of the Range component. The first slider
defines the numeric domain for the range of values. In this example, the domain has
been defined from zero to one, since the slider is set to 1. The second slider defines the
number of steps to divide the domain, which in this case has been set to 10. Thus, the
output is a list of 11 numbers evenly divided between 0 and 1. (note: The second slider,
set to 10, is defining the number of divisions between 0 and 1, which ultimately creates
11 numbers, not 10)
The Series component creates a set of discreet numbers based on a start value, step
size, and the number of values in the Series. The series example shows three numeric
sliders connected to the Series component. The first slider, when connected to the
Series-S input defines the starting point for the series of numbers. The second slider,
set to 10, defines the step value for the series. Since, the start value has been set to 1
and the step size has been set to 10, the next value in the series will be 11. Finally, the
third slider defines the number of values in the series. Since this value has also been
The Interval component creates a range of all possible numbers between a low and high
number. The Interval component is similar to the numeric domain which we defined for
the Range component. The main difference is that the Range component creates a
defualt numeric domain between 0 and whatever input value has been defined. In the
Interval component, the low and the high value can be defined by the A and B input
values. In the example below, we have defined a range of all possible values between
10 and 20, set by the two numeric sliders. The output value for the Interval component
now shows 10.0 To 20.0 which reflects our new numeric domain. If we now connect the
Interval-I output to a Range-D input, we can create a range of numbers between the
Interval values. As was the case in the previous Range example, if we set the number
of steps for the Range to 10, we will now see 11 values evenly divided between the
lower Interval value of 10.0 and the upper Interval value of 20.0. (Note: There are
multiple ways to define an interval, and you can see several other methods listed under
the Scalar/Interval tab. We have merely defined a simple Interval component, but we
will discuss some of the other interval methods in the coming chapters)
The piece of code first looks at an object and determines a single boolean value for
whether or not it is a curve. There is no middle ground. The boolean value is True if the
object is a curve, or False if the object is not a curve. The second part of the statement
performs an action dependant on the outcome of the conditional statement, in this case,
if the object is a curve, then delete it. This conditional statement is called an If/Else
statement; If the object meets certain criteria, do something; else, do something else.
Grasshopper has the same ability to analyze conditional statements through the use of
Function components.
In the example above, we have connected a numeric slider to the x-input of a single
variable Function component (Scalar/Expressions/F1). Additionally, a conditional
statement has been linked to the F-input of the Function, defining the question, “Is x
greater than 5?” If the numeric slider is set above 5, then the r-output for the Function
shows a True boolean value. If the numeric slider drops below 5, then the r-output
changes to a False value.
Note: To see the finished version of the circle boolean test example, Open the file
CircleBooleanTest.ghx found in the Source Files folder that accompanies this
document.
In the following example, we will create a mathematical spiral similar to the example
David Rutten provided in his Rhinoscript 101 manual. For more information about
Rhinoscript or to download a copy of the manual, visit
http://en.wiki.mcneel.com/default.aspx/McNeel/RhinoScript101.html
Note: To see the finished version of the mathematical spiral example, Open the file
Function_spiral.ghx found in the Source Files folder that accompanies this document.
Below is a screen shot of the completed definition.
In the following example, we will create a sinusoidal wave form, where the number of
points on the curve, the wavelength, and the frequency can be controlled by a set of
numeric sliders.
Note: To see the finished definition used to create the sine curve below, Open the file
Trigonometric_curves.ghx found in the Souce Files folder that accompanies this
document.
Your definition should look like the image above, where we have now created two lists of
data; the first is a range of evenly divided numbers from 0 to 10, and the second is a list
of evenly divided numbers ranging from 0 to 12.
Note: To see a video tutorial of this example, please visit David Fano's blog at:
http://designreform.net/2008/06/01/rhino-3d-sine-curve-explicit-history/
Below is an example of how to control a list of numeric data using a variety of list
components.
Note: To see the finished definition seen below, Open the file List Management.ghx
found in the Source Files folder that accompanies this document.
Note: The Post-it panel's default setting is to show the list index number before the
numeric data, so that each panel entry actually looks like:
These can be toggled on/off by right-clicking on the Post-it panel and changing the Entry
Numbers preview to either on or off. However, we will leave the Entry Numbers turned
on for this example, as it will allow us to see exactly what list index number is assigned
to each value.
A) The numeric data is then fed into a List Item component (Logic/List/List Item), which
is used to retrieve a specific entry within the list. When accessing individual items in a
list, one has to use an index value. The first item in any list is always stored at location
zero, the second item at location 1 and so on and so forth. Typically, if you start to
access a list at index -5, an error will occur since no such location exists. We have
connected the Series-S output into the List Item-L input. Additionally, we fed an integer
into the List Item-i input, which defines which list index number we would like to retrieve.
Since we have set this value to 5.0, the List Item output will show the numeric data
associated with the 5th entry number, which in this case is also 5.0.
C) We can invert the order of the list by using a Reverse List component
(Logic/List/Reverse List). We have input an ascending list of numbers into the Reverse
List component, whereby the output shows a descending list from 9.0 to 0.0.
D) The Shift component (Logic/List/Shift List) will either move the list up or down a
number of increments dependent on the value of the shift offset. We have connected
the Series-S output into the Shift-L input, while also connecting a numeric slider to the
Shift-S input. We have set the numeric slider type to integers so that the shift offset will
occur in whole numbers. If we set the slider to -1, all values of the list will move down by
one entry number. Likewise, if we change the slider value to +1, all values of the list will
E) The Cull Nth component (Logic/Sets/Cull Nth) will remove every Nth data entry from
the list, where N is defined by a numeric integer. In this example, we have connected a
numeric slider to the Cull Nth-N input. We have set our slider to 2.0, such that the Cull
Nth component will remove every other entry from the list. The Cull Nth-L output reveals
a new culled list where every odd entry has been deleted: 0.0, 2.0, 4.0, 6.0, and 8.0. If
we change the numeric slider to 3.0, the Cull Nth component will remove every third
number from the list so that the output would be: 0.0, 1.0, 3.0, 4.0, 6.0, 7.0, and 9.0.
F) The Cull Pattern component (Logic/Sets/Cull Pattern) is similar to the Cull Nth
component, in that it removes items from a list based on a defined value. However, in
this case, it uses a set of boolean values that form a pattern, instead of numeric values.
If the boolean value is set to True, the data entry will remain in the list; whereas a false
value will remove the data entry from the set. In this example, we have set the boolean
pattern to: True, True, False, False. Since there are only 4 boolean values and our list
has 10 entries, the pattern will be repeated until it reaches the end of the list. With this
pattern, the output list will look like: 0.0, 1.0, 4.0, 5.0, 8.0, and 9.0. The Cull Pattern
component kept the first two entries (0.0 and 1.0) and then removed the next two values
(2.0 and 3.0). The component continued this pattern until reaching the end of the list.
Note: To see the finished definition of the following example, Open the file Shift
Circle.ghx found in the Source Files folder that accompanies this document. Below is a
look at the finished definition needed to generate the shifted circle example.
Note: To see the finished definition of the following example, Open the file Stream
Contents_Excel.ghx found in the Source Files folder that accompanies this document.
Since the Graph Mapper type is set to Linear, the output list (shown in the Post-it Panel)
displays a set of numeric data that ascends from 0.0 to 10.0 in a linear fashion.
However, if we right-click on the Graph Mapper component and set the Graph Type to
Square Root, we should see a new list of data that represents a logarithmic function.
We can now import the data into Microsoft Excel 2007. First launch the application and
select the Data tab. Select the Get External Data from Text under this tab and find the
Stream_Contents.csv file you saved on your hard drive. You will now be guided through
the Text Import Wizard where you will be asked a few questions on how you would like
to import the data. Make sure that the Delimited radial button is marked and select Next
to proceed to Step 2.
You will now be prompted as to which cell you would like to use to begin importing your
data. We will use the default cell value of A1. You will now see all 101 values in the A
column that correspond to the values within the Grasshopper Post-it Panel. The
Grasshopper definition is constantly streaming the data, so any change we make to the
list data will automatically update the CSV file. Go back to Grasshopper and change the
Graph Mapper type to Sine. Note the list data change in the Post-it Panel.
Now select cells A1 through A101 (select A1, and while holding the shift button, select
A101) and click on the Insert Tab at the top. Choose the Line Chart type and select the
first 2D line chart icon.
In Rhino, vectors are indistinguishable from points. Both are represented as three
doubles, where each double (or numeric variable which can store numbers with
decimals) represents the X, Y, and Z coordinate in Cartesian space. The difference is
that points are treated as absolutes, whereas vectors are relative. When we treat and
array of three doubles as a point, it represents a certain coordinate in space. When we
treat the array as a vector, it represents a certain direction. Vectors are considered
relative because they only indicate the difference between the start and end points of the
arrow, i.e. vectors are not actual geometrical entities, they are only information.
This means that there is no visual indicator of the vector in Rhino, however we can use
the vector information to inform specific geometric actions like translation, rotation, and
orientation.
Note: To see the finished definition of the example above, Open the file Unit
Vectors.ghx found in the Source Files folder that accompanies this document.
Note: To see the finished definition of this example, Open the file
Attractor_2pt_circles.ghx found in the Source Files folder that accompanies this
document. Above is a look at the finished definition needed to generate the series of
scaled circles below.
The first step of our definition should look like the screenshot above. If
we hover our mouse over each Distance-D output, we will see a list of
numbers which correspond to how far each grid point is from the attractor
point. We will use these values to determine each circle's radius, but first
we must scale these numbers down to give us more appropriate radius
dimensions.
Note: To see a video tutorial of this example, please visit David Fano's blog at:
http://designreform.net/2008/07/08/grasshopper-patterning-with-2-attractor-points/
Note: To see the finished definition of this example, Open the file Color Boxes.ghx
found in the Source Files folder that accompanies this document.
Grasshopper also has a set of tools to express Rhino’s more advanced curve types like
nurbs curves and poly curves. Below, is an example that will walk us through some of
Grasshopper’s Spline Components but first we will need to create a set of points that
will define how our curves will act.
The NURBS Curve-V input defines the curve control points, and these can be
described implicitly by selecting points from within the Rhino scene, or by inheriting
volatile data from other components. The NURBS Curve-D input sets the degree of the
curve. The degree of a curve is always a positive integer between and including 1 and
11. Basically, the degree of the curve determines the range of influence the control
points have on a curve; where the higher the degree, the larger the range. The table on
the following page is from David Rutten’s manual, Rhinoscript 101, and illustrates how
the varying degrees define a resultant NURBS curve.
C) Kinky Curves
(Curve/Spline/Kinky Curve)
Despite its risqué name, a
kinky curve is no more than
a glorified Interpolated
Curve. It has many of the attributes of
the Interpolated Curve method mentioned
in subsection B, with one small
difference. The kinky curve component
allows you the ability to control a specific
angle threshold where the curve will
transition from a kinked line, to a smooth
interpolated curve. We have connected a
numeric slider to the A-input of the Kinky
Curve component to see the threshold
change in real-time. It should be noted
that the A-input requires an input in
radians. In our example, there is an expression in the A-input to convert our numeric
slider, which specifies an angle in degrees, into radians.
Curve/Division/Divide
Divide a curve into a equal length segments
Curve
Curve/Utility/Split with
Split a curve with one or more Breps
Brep(s)
Grasshopper handles NURBS surfaces similarly to the way that Rhino does because it is
built on the same core of operations needed to generate the surface. However, because
Grasshopper is displaying the surface on top of the Rhino viewport (which is why you
can’t really select any of the geometry created through Grasshopper in the viewport until
you bake the results into the scene) some of the mesh settings are slightly lower in order
to keep the speed of the Grasshopper results fairly high. You may notice some faceting
in your surface meshes, but this is to be expected and is only a result of Grasshopper’s
drawing settings. Any baked geometry will still use the higher mesh settings.
The Brep can be thought of as a three dimensional solid or similarly to the polysurface in
Rhino. It is still made up of a collection of NURBS surface, however they are joined
together to create a solid object with thickness, whereas a single NURBS surface
theoretically has no thickness. Since Breps are essentially made up of surfaces that are
joined together, some of the standard NURBS surface analysis components will still
work on a Brep, while others will not. This happens because Grasshopper has a built in
translation logic which tries to convert objects into the desired input. If a component
wants a BRep for the input and you give it a surface, the surface will be converted into a
BRep on the fly. The same is true for Numbers and Integers, Colors and Vectors, Arcs
and Circles. There are even some fairly exotic translations defined, for example:
• Curve →
Number (gives the length of the curve)
• Curve →
Interval (gives the domain of the curve)
• Surface →
Interval2D (gives the uv domain of the surface)
• String →
Number (will evaluate the string, even if it's a complete
expression)
• Interval2D → Number (gives the area of the interval)
There are more auto-conversion translations and whenever more data types are added,
the list grows. That should be enough background on surface types to begin looking at a
few different examples.
Note: To see the finished definition of this example, Open in Grasshopper the file
SurfaceConnect.ghx also found in the Source Files folder.
To find out more about the Paneling Tools plug-in, please visit:
http://en.wiki.mcneel.com/default.aspx/McNeel/PanelingTools.html.
Below is a screen shot of the definition needed to copy a geometric pattern, such as a
window mullion system, across the surface of a high-rise tower.
Note: To see the finished definition of this example, in Grasshopper Open the file
Paneling Tool.ghx found in the Source Files folder that accompanies this document.
Note: To see the finished definition of this example, in Grasshopper Open the file
Surface Diagrid.ghx found in the Source Files folder that accompanies this document.
• Logic/Lists/List Length – Drag and drop a List Length component onto the
canvas
• Connect the Brep Components-V output to the List Length component
• Logic/Sets/Series – Drag and drop four Series components onto the canvas
• Right-click on the first Series component and set the following:
o S-input: 0.0
o N-input: 4.0
• Right-click on the second Series component and set the following:
o S-input: 1.0
o N-input: 4.0
• Right-click on the third Series component and set the following:
o S-input: 2.0
o N-input: 4.0
• Right-click on the fourth Series component and set the following:
o S-input: 3.0
o N-input: 4.0
• Connect the List Length-L output to each of the four Series-C inputs
Those of you who often pay attention to the fine details probably noticed
that we have four components whose start value increases by one for
each new Series. There’s a specific reason for this, but let’s create a
simple hypothetical situation to explain what’s really going on. Let’s say
we have a surface where we have set the subdivisions to 2 in each
direction, so that there are actually 4 sub-surfaces created. Each sub-
surface will have 4 corner points, so we have a list of 16 points.
However, we need to know how those 16 points are arranged in the list in
order to make specific diagonal connections. Luckily for us, the Brep
Components creates the list in order… meaning, it starts at the first sub-
surface and evaluates the position of the four corner points first (let’s say
it goes in a clockwise direction) before moving to the second sub-surface
and doing the whole procedure all over again. So, if we wanted the lower
left hand point of each sub-surface, we would need to retrieve every
fourth point from the lists (index numbers: 0, 4, 8, and 12). Likewise,
since the Brep Components created the list going in a clockwise direction,
if we wanted the upper left point of each sub-surface, we would need to
retrieve every fourth point from the list but with a different start value
(index numbers: 1, 5, 9, and 13). The same process works for the entire
set of points. The four Series component we just created will create a list
The last part of your definition should look like the image above. This definition will work
on any type of single surface and you can replace the Loft part of the definition at the
beginning with more complicated surface generation methods.