Surface Manipulation

From TOI-Pedia

Introduction

LEVEL: INTERMEDIATE
Expected Time: 45 min
Possible final result

Using Grasshopper as a parametric design tool gives us the ability to study different design solutions. In this tutorial we will create a Grasshopper model that gives us the ability to study the openings in a curved roof. By changing the a slider the size of the openings either decreases or increases.

The Design

The design of this tutorial

Before we start building the grasshopper model we should determine some of its basic properties. We will start with a single curved surface in Rhino, which represents our roof. Our roof needs several openings to let light through. The openings are created by raising the middle of a line straight up creating a arc from one side to the other through this raised point. The aspects we want to study are how many openings we should have and how large they should be.

So our variables/parameters are:

  • number of openings
  • height at the middle of the openings


Step 1 - Preparing the Rhino scene

Drawing a curved line

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 Rhino » Curve » Free-Form » Interpolate Points


Create the curve in the right viewport

It is probably easiest to draw the curve in “Right”-view.

Extrude the surface

Now we will extrude this surface in a straight line.

  • Extrude the curve Rhino » Surface » Extrude Curve » Straight


Using the front viewport for the extrusion

It's probably easiest to extrude the curve in “Front”-view.

The created surface in Rhino

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

Step 2 - Starting the Grasshopper model

Create a surface parameter

First we have to define the surface we created in Rhino. Therefore we create a Surface parameter.

  • Create a Surface parameter Params » Geometry » Surface


Set the Rhino surface to the Grasshopper parameter

Now we have the Surface component we can connect our Rhino surface.

  • Set one surface on the Surface parameter

RMB on Surface parameter » Set one surface » Select Rhino surface

Deconstruct the surface

Now we need to deconstruct the surface in faces, edges and corners. There are several ways to divide a surface, but in this case using the Deconstruct Brep would be a good solution.

  • Connect a Deconstruct Brep to the surface Surface » Analysis » Deconstruct Brep

As you can see, the Deconstruct Brep component outputs three items: the surface face, edges and vertices.

Retrieve specific edges of the surface

The surface has four edges and we only need to use two of them. So we somehow need to identify those two edges. If we hover with our mouse over the E of the Brep Components it shows us that the output is a list of four curves. With the function List Item, we can specify specific items in a list. We need to identify two edges, so we make two List Items. Note that computers start to count with zero, so the edges are 0, 1, 2 and 3.

  • Retrieve specific edges by using the List Item component Sets » List » List Item


Click on the plus icon of the list item

Without setting a specific index, the List Item component will retrieve the first item of the list, which is index 0. By zooming in on the component, you will see that several plus icons will appear. By clicking twice on the lowest plus, we will also get the second item (index 1) and the third item (index 2) of the list.

  • Add two item to the List Item output Zoom in on List Item component » LMB on lowest plus


Divide curve 0 and curve 2

Now that we have the two edges identified, we can divide them.

  • Divide the edges using the Divide Curve component Curve » Division » Divide Curve


Add a number slider for the number of panels

As we want to set the number of divisions for the curve, we create a Number Slider to control this.

  • Add a number slider to the count Params » Input » Number Slider


Create a line between the points

The next step is that we need lines from the division points on one side to the division points on the other side.

  • Connect the points with a line Curve » Primitive » Line


Wrong direction of the lines

The only problem is we don't get the result we wanted. The lines are linked in a crossing pattern.


Reverse one of the point lists

We need to reverse one of the lists of division points.

  • Reverse on of the point lists Sets » List » Reverse List


The correct direction of the lines

Now the curves are correct.


Step 3 - Creating the second set of curves

Find the middle of the created lines

We want to get the middle of the lines so we use the Middle Curve node.

  • Get the middle of the line Curve » Analysis » Curve Middle


Move the middle in the z-direction

Now that we have identified the middle, we want to be able to move it in the Z-direction to create the openings in the roof. Add a move component with a Z unit-vector to move the middle points up.

  • Move the middle points up Transform » Euclidian » Move
  • Add a Z unit-vector to the direction Vector » Vector » Unit Z


Control the height with a Number Slider
  • Add a Number Slider to control the size of our openings Params » Special » Number Slider


Create an Arc between three points

Now that we have the raised midpoint of the curves, we can create arcs going from one side through the raised midpoint to the other side.

  • Add an 3pt Arc to the canvas Curve » Primitive » Arc 3Pt
  • For point A: use the original division points of the first curve;
  • For point B: use the moved middle points of the created lines;
  • For point C: use the reversed list of the division points of the second curve.


Current view in Rhino

We now have an arc between above every created line on the surface.

Step 4 - Creating the surfaces

Cull one Arc and one Line

We now have two sets of curves, and we want to create a loft from the first arc to the second straight line. We could do this in several ways, but in this tutorial we will clean the list of curves by removing the curves we don't need. This means we will delete the first straight curve and the last arc.

  • Add a cull component to the created Arcs and the lines that divide the surface Sets » Sequence » Cull Index


Set 0 as cull index for the Arcs

We need to specify which items from the list we want to delete. Removing the first item of a list isn't very complicated, because we know the first item always has the index number 0.

  • Remove the first Arc RMB on the I of the Cull Index » select “Set Integer” and set it to 0


Set -1 as cull index for the Lines

Removing the last item from a list can be done by entering the number -1. Grasshopper will know that you want to remove the last item from the list.

  • Remove the last line RMB on the I of the Cull Index » select “Set Integer” and set it to -1


Check the list structure of the lines and Arcs

We now have the right items in the two lists, but if we try to loft the outputs of the two lists it won't give us the desired result. It just makes one loft going through all the arcs and one loft going through all the straight lines. This happens because the two lists are structured in a way that Grasshopper combines all the items in one list to make the loft instead of combining one value of the first list with one value of the second list.

If we look at the data in the list by using a panel, we can clearly see different structures in both lists. Pay special attention to the darker yellow lines. We can see different numbers of zeros between the accolades. To be able to combine two lists, we need to get this structure identical in both lists.

Graft the two lists

We have to somehow tell Grasshopper to divide the lists in separate items, so it will loft them one by one.

  • Graft both lists Sets » Tree » Graft Tree » Grasshopper


Loft the set of curves

We can now use these lists as input for the loft component.

  • Loft the lines with the Arc by connecting both of them to the Curves input of the loft component Surface » Freeform » Loft

Notice the dashed lines which indicate the connection between the loft and graft components. A dashed line indicates a grafted list.

Add a surface parameter for good practice
  • Add a surface component for good practice. Params » Geometry » Surface


You just finished your roof!

Final geometry in Rhino


Final script
Personal tools
Actions
Navigation
Tools