# Space Frame

## Introduction

Expected Time: 45 min

In this tutorial we will look at how to generate a spaceframe. Although the beginning is quite straight forward , the difficulty arises when the bottom frame has to be defined. It tackles a typical problem with Grasshopper , the list and tree editing. Due to the fact that Grasshopper doesn't store object names but defines the geometry in an indexed list makes the selection of objects sometimes quite arduous.

## The Design

Before we start building the grasshopper model we should determine some of its basic properties. We will start with a one curved surface in Rhino, which represents our roof. Our roof will be divided in a grid of sub surfaces, forming the basis of the bottom grid of the space frame. This sub surface will dictate the width and length of the grid elements and will help to define the nodes of the upper grid of the space frame. By generating line information from the sub surfaces and the lowered center point of the bottom part of the space frame

So our variables/parameters are:

• The length and width of our bottom grid
• Height of the spaceframe
• The thickness of the frame elements.

## Building the grasshopper model

### Step 1 - Preparing the Rhino scene

First of all we need to define our roof in Rhino. We do this by creating a curve and extruding it to get our surface.

• Create a curve in Rhino Curve » Free-Form » Interpolate Points

Now we will extrude this surface in a straight line.

• Extrude the curve Surface » Extrude Curve » Straight

Our surface should look something like the following illustration. This will be our starting point for the Grasshopper model.

### Step 2 - Starting the Grasshopper model

Add a surface parameter to the canvas and set the Rhino surface to the parameter.

• Add a surface parameter to the canvas Params » Geometry » Surface
• Set the Rhino surface to the Grasshopper parameter RMB on surface parameter » Set one surface

Now we need to divide the surface in sub surfaces. These sub surfaces will be the base of our spaceframe grid. We will use the isotrim component to divide the surface using a U and V count.

• Divide the surface using the isotrim component Surface » Util » Isotrim

With the Isotrim option we can define a part of a surface. This will mean that we have to define a two dimensional area on the surface. A segment in the U direction and a segment in the V direction. To do this we have to define between which coordinates in the U direction to define the surface in the U direction and the same in the V direction. Defining an area like this can be done with a domain.

Define the domain for the isotrim Domain input using the Divide Domain2 component. Specify a U and V count using a Number Slider. As input for the Domain of the Divide Domain2 node, you can use the original surface. Grasshopper is able to transform the surface data to UV coordinate data.

• Connect a Divide Domain2 component to the Isotrim Domain input Maths » Domain » Divide Domain2
• Connect the Surface to the Divide Domain2 Domain input
• Specify U and V count using a Number Slider Params » Input » Number Slider

### Step 3 - Generating the top and middle grid

We have now the basis for the generating a space frame. We can use the data of the subframes as basis for the tubes which will make up the frame. If we use the Deconstruct Brep component we can extract the corner points , the edges and the faces from the sub frames. The points and edges we can use as a basis for the tubes of the grid.

• Deconstruct the sub surfaces Surface » Analysis » Deconstruct Brep

If you now connect a curve parameter to the edge output, you can see that we now extracted all the bottom curves we need for the spaceframe. In a later stage, we will transform these curve into pipes.

Next, we need to extract the center of each subsurface and the normal. To extract the center, you could use the Area component, but this would not give us the normal. Therefore we use the Evaluate Surface node. This component uses the surface as input and a UV-point (Do not input a standard point!).

• Evaluate the sub surfaces Surface » Analysis » Evaluate Surface

The center of a surface in UV-space can be described as U = 0.5 and V = 0.5 when both lengths are 1. Therefore we need to reparametrize the sub surface.

• Reparametrize the sub surfaces RMB on Evaluate Surface input » Reparametrize

An easy method to add a UV point to the Point input is to use the MD Slider. The standard value of the MD Slider is 0.5 ; 0.5. This is exactly what we need.

• Connect an MD Slider to the Point input Params » Input » MD Slider

Next, we have to define the height of the space frame. By connecting an Amplitude to the Normal output, we can specify how far the center should move in the normal direction. This, in fact, also defines the height of the spaceframe.

• Connect an Amplitude to the Normal output Vector » Vector » Amplitude
• Define the Amplitude value with a Number Slider Params » Input » Number Slider

Now, using the Amplitude Vector, we move the sub surface center point.

• Move the sub surface center points in the direction of the Amplitude output Transform » Euclidian » Move

We have now two sets of points. The corner points of each subsurface and the points of our bottom grid. This is enough information to generate a line. Use a line component and connect the vertices output of the Deconstruct Brep component and the Moved point with the Line component. Make sure you first graft the Geometry output. Otherwise, the centers will not connect to the right branch of vertices.

• Graft the Geometry output RMB on Move Geometry output » Graft
• Create a line between the sub surface corners and the moved centers Curve » Primitive » Line

As you can see, we now have all the diagonal parts of our spaceframe.

If you want the spaceframe flipped, add a negative number to the Amplitude input.

### Step 4 - Generating the bottom grid

Now we get to a tricky part of the creation of the grid. The information of the grid consists of a list of points. We have to organize them in such a way that we can select a row/column of points and generate a polyline between them. By connecting a Partition List component to the Geometry output, we can restructure our data in sub lists with a specific size. Since we want to partition the data as one list, first flatten the List input.

• Add a Partition List component to the canvas Sets » List » Partition List
• Flatten the List input RMB on List input » Flatten
• Connect the Geometry output to the List input

Since the length of our columns in the grid is defined by the amount of V segments, we can connect the Number Slider of the V count to the Partition List Size input.

• Connect the V Count Number Slider to the Size input

Since we now have all the columns of points, we can connect a Polyline component to the chunks output.

• Connect a polyline component to the chunks output Curve » Spline » Polyline

As you can see in the viewport, we now have the first set of bottom curves of the space frame.

Next, we need to get the rows of bottom center points. By simplifying the Chunks output, we get a data structure where the branches are defined as single values, for example {0}. Therefore we can now use the Flip Matrix component so that branches become indices and indices become branches.

• Simplify the Chunks output RMB on Chunks output » Simplify
• Connect a Flip Matrix component to the Chunks output Sets » Tree » Flip Matrix

By connecting a polyline to the Flip Matrix output, you will see that we now have polylines perpendicular to the previous ones.

• Connect a polyline component to the Data output Curve » Spline » Polyline

### Step 5 - Pipe all space frame parts

Finally we can convert all lines to real spaceframe elements. First we merge all component into one set of elements.

• Merge all space frame elements Sets » Tree » Merge

It would be cleaner to first make sure that all lists have the same structure, but since it doesn’t influence our final result, we will skip this part for now.

Connect a pipe component to the merge output. Define the radius of the pipes using a Number Slider.

• Pipe your components Surface » Freeform » Pipe
• Define the radius with a Number Slider Params » Input » Number Slider

Finalize your model with a Geometry parameter. Your model is now finished!

The final model!

In practice, it would make sense to give the different components of the space frame different thicknesses. In this case, you would have to skip the merge component and connect al components to separated pipe components.

The result now looks like the following illustration.