Sei sulla pagina 1di 12

ParametricTruss

UW ARCH (-% Grasshopper Introduction Tutorial

Tutorial Description : This tutorial is meant as an introduction to working with Grasshopper. An attempt has been made to
make the definition and this tutorial as simple to follow as possible. Those who already have some experience with Grass-
hopper will likely be able to create the definition from the descriptions that appear on the overview page for each process.
A process is being defined as a set of operations that complete a particular task. It is often helpful to breakdown a defini-
tion in this way so that they can be more easily understood by others viewing your definition as well as for editing and mak-
ing later substitutions.

The end product of this tutorial will be a parametric truss that is generated from a single curve, imported from Rhino. The
depth, number of diagonals, and cross-sections can all be easily changed once the definition is complete. With a few modi-
fications, this definition is capable of taking a list of multiple lines and turning each one into a truss. These lines could be
generated from another Grasshopper definition that intersects a list of planes with a surface, creating a list of lines which
could be then attached to this definition.

A major limitation of this definition in its current form is the fact that it is built off of a line which simplifies many of the geo-
metric relationships that must take place to create the truss. For instance, to apply this definition to an arc the vectors and
planes would need to be extracted from the curve geometry because the interpolated curve can not be used as a vector. Or
if a set of radial lines were being used then a process would need to be developed that creates vectors and planes specific
to each line.

This definition was built using Grasshopper 0.8.0004.


Overview
Parametric Truss
Offset Top Curve and Create Subcurve

Divide Curves and Create Diagonal lines between top crv pt0 to bottom crv pt0, etc, and top crv pt1 to bottom crv pt0.

Create pipes from the top and bottom chord centerlines, and a set of pipes of a smaller radius for the diagonal members.
Process1
Parametric Truss
Offset Top Curve - The top curve is a straight
line sampled from Rhino. In order to get the bot-
tom chord of the truss, the top curve is moved in
the negative Z direction.

Extract Subcurve - A subcurve is extracted from


the bottom curve, allowing the ends of the bot-
tom chord to be pulled in from top. To create the
subcurve a new domain for that curve must be
created that is less than the original domain

Preview of Geometry
Offset Top Curve - The top curve is a straight line imported from Rhino. In order to get the bottom chord of the truss,
the top curve is moved in the negative Z direction.

Components
Needed:

Curve / Params Tab - Place two of the curve components on the canvas. You will notice that they are initially
orange. This orange color signifies that they contain no data. All of the components in the Geometry and
Primitive Categories under the Params Tab are initially empty. Think of these components as buckets that can
either sample information from Rhino or can have information passed through them. They will only accept
a certain type of information, but in some cases they are capable of converting information. For example if a
planar surface is connected to a Plane component, the component will create a plane that matches the orien-
tation of the planar surface.

The first Crv component is used to sample a line from Rhino which will be the center line of the truss’ top
chord. To sample the curve from Rhino, right-click (hereafter RMC) the first Crv component and ‘Set One
Curve’. This will make the Rhino interface active and in the command line you’ll see that it asks for you to pick
one curve. Select the curve that you want to sample and the Grasshopper Interface will return.

Plug the first Crv component into the second Crv component. RMC the second curve component and in the
top of the menu where you see ‘Crv’ click and type in ‘Top Crv’. Documentation like this is a good practice to
get into, and makes it easier to manage future definitions that get more complicated. The reason for setting
up this second Crv component is to make it easier to substitute different curves into the definition without hav-
ing to redo all of the connections that branch out from the Top Crv component to the rest of the definition

Move / XForm Tab - The next thing that must be done is to create the center line of the bottom chord. To do
this we’ll move the top chord down, along a Z vector. Place the Move component after the two curve compo-
nents. Hovering the mouse over the inputs of the Move components displays that a geometry input (G) and a
vector input (T) are needed. Attach the ‘Top Crv’ component to the G input of the Move component. The Move
component remains orange because all of its inputs have not been satisfied.

Unit Z / Vector Tab - The Unit Z component corresponds to the world axes within Rhino and will allow us
to move the centerline curve vertically. Attach the Unit Z component to the T input of the Move component.
You’ll notice that the top chord centerline has been moved vertically but in the positive direction. Next we’ll
attach a slider to the Unit Z component so that we can control the amount and direction of the offset.

Slider / Params Tab - Place the Slider component to the left of the Unit Z component. RMC the slider and set
the name to ‘Truss Depth’. Double-click the slider, set the Digits to 1, set the lower limit to -3 and the upper
limit to 3, then click back on the GH canvas. Attach the slider to the F input of the Unit Z component and test
what happens when you adjust the slider.

At the end of this page your definition should have the following components.
Extract Subcurve - A subcurve is extracted from the bottom curve, allowing the ends of the bottom chord to be pulled in
from top. To create the subcurve a new domain for that curve must be created that is less than the original domain

Subcurve / Curve Tab - Before creating the diagonals between the top and bottom curves, the bottom curve
needs to be trimmed so that its endpoints are pulled in from those of the top curve. The Subcurve component
trims a curve by creating a new domain that is less than the original domain.

Place the Subcurve component on the canvas, RMC the component and change the name to ‘Bottom Crv’.
Notice that the input C requires a curve and input D requires an domain. Plug the output of the Move compo-
nent into the C input of the Subcurve component.

Domain / Math Tab - Place the Domain component on the canvas to the left of the D input of the Subcurve
component. The domain requires inputs of a start (A) and end (B). These values can either represent the
units of the model or they can in proportion to the overall length of the curve in which case the curve that the
domain is being applied to must be Reparameterized. RMC the C input of the Subcurve component and notice
at the bottom of the list that you have the option to Reparameterize the curve.
Actual Units
0 1.4 2.8 4.2 5.6
Domain Domain
Start End
0 0.25 0.5 0.75 1
Reparameterized

Slider / Params Tab - The domain will be created using the actual units of the curve. The lower limit will be
established using a slider. Place the slider on the canvas, RMC and set name to ‘Truss Chord Trim Length’,
then double click and set the range as 0 to 3 with the Digits set to 1. The upper limit will be set by subtracting
the value of the slider from the curve’s length.

Length / Curve Tab - Attach the output of the Move component to the C input of the Length component. This
will return the length of the top chord which will be used in the next component.

Subtraction / Math Tab - Place the Subtraction component on the canvas to the left of the domain B input. At-
tach the Truss Chord Trim Length Slider to the B input of the Subtraction component and attach the output of
the Length component to the A input. Notice here that although the Subtraction component’s inputs call for a
number they will also accept certain types of other inputs. Here a curve’s length is used as the number. This
is something that you have to get use to with Grasshopper. Sometimes it’ll work and sometimes it won’t in
which case the component will turn red. Now attach the Subtraction component to the B input of the Domain
Component.

Disable Preview / Canvas Toolbar - To see the Subcurve, turn off the preview of the Move component either
by RMC the Move component and uncheck Preview or select the move component and then click on the dis-
able preview icon on the Canvas Tool bar. This button is especially useful for turning off the preview for a large
number of components at one time. Shift-Ctrl-Q will also disable preview. Ctrl-Q enables the preview.

At the end of this page you should have added these components
Process 2
Parametric Truss
Divide Curves - The top and bottom curves are
divided into a number of equal length segments.
The top curve will be divide into the number of
segments specified on the slider but the bottom
curve will have one less segment so that the Create Diagonal Lines - A line component is
diagonals can be created. then used to connect the lists of points.

Display Pt Numbers - The Point List component


displays the order of point list. For one set of
diagonal lines the two lists of points can be used
as is, matching up pt0 to pt0, 1-1, 2-2, etc. For
the other set of diagonals, the top point list will
have to be shifted one value so that pt1 to pt0,
2-1, 3-2, etc.

Preview of Geometry
Divide Curves - The top and bottom curves are divided into a number of equal length segments. The top curve will be
divide into the number of segment specified on the slider but the bottom curve will have one less number of segments so
that the diagonals can be created.

Divide / Curve Tab - Place two copies of the Divide component on the canvas to the right of the rest of the
definition. The Divide component requires as inputs at least one Curve (C), a number of segments (N), and a
boolean value for whether or not to split the curve at kinks (K). For now, ignore K because we have a line with
no kinks. (A kink would be the transitions between line segments in a polyline. If split at kinks were set to
True then it would first split the curve into its basic segments and then divide each of those segments)

Attach the top chord centerline to one Divide component’s C input, and the bottom chord centerline (use sub-
curve version) to the other Divide component’s C input. There should now be a number of points distributed
evenly along each curve. Hover over the N of the Divide component and notice that by default N is set to 10 as
the number of segment. Next hover over the P output of the Divide component and notice that there are 11
points, or 1 more than the number of segments (N+1).

Slider / Params Tab - To control the number of segments create another slider. RMC the Slider component
and change the name to ‘# of segments’. Double click the slider and set the range as 1-15 and the Rounding
as Integer. Attach the slider to only the N input of the top chord’s Divide component. The bottom chord needs
to have one less point in order to be able to create the correct diagonal relationships between the two curves.

top chord

bottom chord

Subtraction / Math Tab - Place the Subtraction component on the canvas to the left of the bottom chord’s
divide component. Attach the ‘# of segments’ slider to the A input of the Subtraction component.

Panel / Params Tab - Place the panel component to the left of the B input of the Subtraction component.
Double click the Panel component and type ‘1’ and hit enter (do not type the quotes). Attach the Panel compo-
nent to the B input of the Subtraction component, then attach the Subtraction component to the N input of the
Divide component.

There are many different ways that the subtraction process can take place. This version is the most clear
while learning Grasshopper because it keeps everything out in the open but it is also possible to complete
these operations within the inputs of each component by setting an expression.

Point / Params Tab - Attach each Divide component to its own Point component. Similar to the earlier reason
for using two Crv components, this will allow for easy substitution later should it be decided that a different
Divide component should have been used.

At the end of this page you should have added these components
Display Pt Numbers - The Point List component displays the order of point list. For one set of diagonal lines the two
lists of points can be used as is, matching up pt0 to pt0, 1-1, 2-2, etc. For the other set of diagonals, the top point list will
have to be shifted one value so that pt1 to pt0, 2-1, 3-2, etc.

Point List / Vector Tab - This component will number the list of points, and will aid in understanding how to
create the diagonal lines. This is not a necessary step and the output of the Point List component can not be
used anywhere else in Grasshopper (jagged edge on right side of Point List component).

Place two copies of the Point List Component to the right of the Point components. Attach each Point compo-
nent to the P input of its own Point List component. The numbers are likely not visible because the S input or
font size has not been set. RMC the S input of the Point List Component, goto Set Number and enter .5 then
click Commit changes. The numbers should now be more visible, if not increase the S input until you can see
the numbers.

Create Diagonal Lines - A line component is used to connect the two lists of points.

Line / Curve Tab - Place two copies of the Line component to the right of the Point components. Connect
the output of the top chord Point component to the A input of one Line component and connect the output of
the bottom chord Point component to the B input of that same Line component. RMC the center of that Line
component and select shortest List, which will limit the Line operation to whichever of its inputs has a shorter
number of values. If it is left set at Longest List, then there will be an additional line created from the last
point of the top chord list to the last point of the bottom chord list. There should now be a set of diagonal lines
similar to the ones shown below in blue.

In order to create the set of green lines in the below diagram, the pt1 of the top chord point list must be
matched up with the pt0 of the bottom chord point list.

Shift / Sets Tab - The Shift component changes which item of the list is the first item, but without changing
the sequence between items. A shift in the positive direction with move to the next higher number, while a
shift in the negative will work in the other direction. This number is specified with the S input, the Shift Index.
The other input (W) controls whether or not to wrap a list of values. If W is set to True then a list will wrap and
be treated as a loop. If it is set to False then the list is linear and items will be lost in the shifting process.

Place the shift component to the right of the top chord points, and attach the points to the L input of the Shift
component, the List that needs to be shifted. By default the Shift Index (S) is set to 1 which is what we want,
and Wrap Values is set to False which is also what we want. Attach the L output of the Shift component to the
A input of the other Line component and the bottom chord points to the B input of that Line component. There
should now be the set of lines shown as green in the above diagram.

At the end of this page you should have added these components
Process 3
Parametric Truss

Create Pipe from Truss Wireframe - This step


uses the wireframe of the truss to create a series
of pipes with one radius for the top and bottom
chords, and a different radius for the diagonals.
The ends of the pipes are closed using the Cap
components.

Change Preview of Finished Truss - All ge-


ometry that moves through Grasshopper is
previewed as either red (deselected) or green
(selected). The preview component can be used
to change the preview settings for the output of a
component, but these settings can not be passed
further along in the definition.
Create Pipe from Truss Wireframe - This step uses the wireframe of the truss to create a series of pipes with one ra-
dius for the top and bottom chords, and a different radius for the diagonals. The ends of the pipes are closed using the
Cap components.

Pipe / Surface Tab - This component creates a pipe around a centerline curve. Place two copies of the Pipe
component on the canvas. Attach the top and bottom chords to the C input of one Pipe component and the
diagonals to the C input of the other Pipe component. The R input of the Pipe component controls the radius
of the pipe which is set to 1 by default. The E input controls the end cap. RMC the E input and set to 1 which
will bput a flat end cap on the pipe.

Slider / Params Tab - Place two copies of the Slider component on the canvas. Attach one to the each Pipe
components. RMC the Slider component attached to the top and bottom chord and change its name to ‘radius
of chord pipes’. Name the other Slider component ‘radius of diagonal pipes’.

Change Preview of Finished Truss - All geometry that moves through Grasshopper is previewed as either red (deselect-
ed) or green (selected). The preview component can be used to change the preview settings for the output of a compo-
nent, but these settings can not be passed further along in the definition.

Custom Preview / Params Tab - Attach the output from the two Cap components to the Custom Preview
component. Be sure to turn the preview off for the Cap and Pipe components in order to not create a display
conflict.

Colour Swatch / Params Tab - The default color of the Preview component is yellow, but this can be changed
using the Colour Swatch component. Attach a Colour Swatch component to the S input of the Preview compo-
nent. RMC the Colour Swatch component and set the color.

At the end of this page you should have added these components
Additional Steps
Parametric Truss
Now that you have completed the basic geometry of the truss try to complete the
following three additional steps:

1. Establish a span to depth ratio which sets the depth of the truss as 1/20 of the
length of the top chord.

2. Create a curve using Grasshopper that you can input into the beginning of the
beginning of the definition. Did everything work as expected? If not can you fix it?

3. Create a trichordal truss which has two top chords and a single bottom chord.
For those of you who found this easy try to complete one of these other processes:
1. Build the truss from a single arc or curve.
2. Build multiple trusses from multiple lines without copying and pasting the
entire definition.
3. Create a proportional relationship between the Z value of each point on the
bottom chord and that point’s distance to the end points of the truss.

In order to build these you will have to use components that were not covered in
this tutorial. First, come up with a hypothetical set of process for how you think
you might achieve these forms. Then begin exploring the components in the vari-
ous tabs for ones that might help.

Potrebbero piacerti anche