Rotating Tower

(Redirected from Tutorial 1 - Rotating Tower)

Introduction

LEVEL: BEGINNER
Expected Time: 45 min

One of the main uses of Grasshopper is to build simple parametric models. In this tutorial we start by exploring these possibilities by dealing with some of the basic operations. To show this we will make a simple parametric tower. To work with complex objects, a design process usually starts from a very simple first level and then other layers are added; complex forms are comprised of different hierarchies, each associated with its own logic and details. These levels are also interconnected and their members affect each other and in that sense this method called ‘Associative’. So let us start by describing the towers basic properties.

The Design

Before we start building the grasshopper model we should determine some of its basic properties. The design we want to achieve is a tall tower with a bottom and top profile. The precise shape of the profiles is not fixed and alternatives need to be explored. Furthermore we are aiming at a minimal total floor area of 35.000 m2.

Other properties include:

• Radius of the bottom shape
• Radius of the top shape
• Floorheight

Starting the grasshopper model

Now that we have defined the input we can determine what components we need to build the model. As mentioned before, the process of making a complex model usually starts from a very simple level. In this particular design we will start by making a line which will act as the core of the building. Any line is constructed by connecting two points. Therefore we start by creating the two points; one at the origin and one moved in the Z-direction controlled by the height property.

• Create a point Vector » Point » Point XYZ

We leave the input to its default 0,0,0 thereby creating a point in the origin of the model.

Next we want to create the second point. Again we start by creating a point, but now we are going to control the Z value by the use of a slider.

• Create a vector Vector » Point » Point XYZ

And now the slider:

• Add a Number Slider to the canvas Params » Input » Number Slider

We want to change the setting of the slider so that it conforms to our use. For each slider one can set the type of numbers, lower and upper limits and its default value.

• Change the settings of the Number Slider RMB on the slider » Edit
• Set the lower limit value to 3.000 (the minimum height is 3 meter)
• Set the upper limit value to 300.000 (the maximum height)

Now it is a good habit to give your slider an appropriate name

• Rename the slider RMB on the slider » First item in the popupmenu controls the name. Set it to “buildingHeight”

We can connect the number slider to the Z input of the point.

• Drag the output of the slider to the Z input of the second point.

Using the two points we can create the line connecting them. First we create the line, then we connection the two points to input A and B of the line.

• Create a line between the points Curve » Primitive » Line

• Drag the output from the first point to the A input of the Line
• Drag the output from the second point to the B input of the Line

The result of these first steps are visible in the perspective window in Rhino. You should see a line in the Z direction. Changing the “buildingHeights” sliders value should change the height of the line.

Create the bottom and top shapes

For the bottom and the top shapes we choose to use a polygon as base. We will use the two points created earlier as the basepoints of the shapes. For the polygon we need to specify the number of sides and the outer radius. Both these values are driven by the design and the designer and are controlled by sliders.

Create the first and second polygon

• Create the first and second polygon Curve » Primitive » Polygon 2x

The polygon has 4 inputs:

• P – The baseplane or point for the polygon
• R – The outer radius of the polygon
• S – The number of sides of the polygon
• Rf – The radius of the optional rounded corners

Create the slider for the radius:

• Create a Number Slider for the Radius Params » Special » Number Slider

We want to change the setting of the slider so that it conforms to our use. There is a minimum and a maximum radius.

• Change the settings of the Number Slider RMB on the slider » edit
• Set the lower limit value to 5.000 (the minimum radius is 5 meter)
• Set the upper limit value to 25.000 (the maximum radius is 25 meter)

Now you have to rename the slider by RMB on the slider. By clicking on the first item in the pop-up menu you can control the name. Set it to 'outerRadius'.

Next create the second slider for the number of sides. This slider requires for an important setting as the number of sides can only be a whole number, a so called “integer”.

Create the slider for the number of sides:

• Add a Number Slider to the canvas Params » Special » Number Slider

We want to change the setting of the slider so that it conforms to our use. There is a minimum and a maximum number of sides and, most important, a type of values available.

• Edit the settings of the Number Slider RMB on the slider » edit
• Set the rounding to Integer
• Set the lower limit value to 3 (less that 3 sides create a line and has no area)
• Set the upper limit value to 10 (the maximum number of sides)

By right clicking on the slider you can rename it again. The first item in the pop-up menu controls the name. Set it to “numberOfSides”.

• Rename the Number Slider RMB on the slider » First item in the popupmenu controls the name. Set it to “numberOfSides”

Now connect the output of the sliders to the polygons. It is important to notice that one slider can control multiple objects, making it easier to control complex models.

• Drag the output of the “outerRadius” to the R input of both the Polygons
• Drag the output of the “numberOfSides” to the S input of both the Polygons

Both polygons are now created in the origin of the model. As mentioned before we will use the 2 points created before as input.

• Drag the output of the first point to the P input of the first polygon
• Drag the output of the second point to the P input of the second polygon

Lets review what we have constructed until now. We should have 2 polygons; one at the bottom of the line and one at the top of the line. Check whether changing the numberOfSides and the outerRadius changes the two polygons accordingly.

The effect of the rotated tower is controlled bij the rotation of the top shape. To enable this we need a rotate option and a slider to control this rotation.

First we create the rotate option and connect the top shape output to the rotate

• Rotate the top polygon Transform » Euclidean » Rotate
• Drag the output P of the top shape to the input G of the rotate

Now we need to define the angle of rotation. For this particular design we want to be able to rotate the top between 0 and 180 degrees. So we create a slider with floating point numbers as option and connect this to the rotate.

• Add a Number slider for the rotation in degrees Params » Input » Number Slider

We want to change the setting of the slider so that it conforms to our use. There is a minimum and a maximum number degrees to rotate.

• Change the settings of the Number Slider RMB on the slider » edit
• Set the lower limit value to 0.0000 (0 equals no rotation)
• Set the upper limit value to 180.0000 (the maximum rotation)

Now we can add a rotation value to the rotate node:

• Connect the output of the slider to the input A of the rotate.

Now let review what we have done in the viewport of rhino and check if the grasshopper definition works. The first thing you might notice is that there are actually two top polygon shapes (if you don’t see two you need to increase the rotation). The reason why this happens is that the rotate option actually takes the geometry, copies and rotates it according the specified angle. Because grasshopper definitions work as a downward stream of data this is the only way to do this. We can solve this quite easily by hiding the original polygon.

• Hide the preview of the second polygon RMB on the second polygon » Toggle preview

The second polygon will be hidden and the rotated copy will remain visible. Also notice the Polygon Icon turning into a darker grey color.

The second issue that we have to deal with is the rotation. Given the minimum and maximum values that we have set for the slider we can expect the top polygon to rotate 180 degrees. If we check this in the model we can see that the object actually rotates a lot more than 180 degrees. Further inspection shows that the input A of the rotate expects a rotation in Radians instead of Degrees (hover with your cursor above the A shows this popup).

So we need to convert degrees to radians. This can be done by right-clicking on the Angle input and click on degrees.

• Change from radians to degrees RMB on Angle » Degrees

Now that we have both bottom and top profile set we can connect them to make the outer surface of the tower. For this we use the loft component. The loft connects the curves in the order they are connected and forms a surface that runs through these curves. Therefore they can be considers sections through the surface. It is important to notice that we want to connect multiple sources (curves) to one input (the input of the loft. To accomplish these we can hold the “shift” key to connect more than one object to an input.

• Loft the curves Surface » Freeform » loft » Grasshopper
• Connect the bottom polygon output to the C input of the loft.
• Connect the top polygon output to the C input of the loft while holding the shift-key.

Now we can review the overall shape of the tower in the Rhino perspective view. Try changing some of the slider input to see the impact on the model.

Creating the floors

In the beginning of this design some requirements were set. One of those requirements is the minimal needed floor area in the building. To calculate this we first need to model these floors. Again, before we start the modelling, we need to define what kind of input and output we need. The output is composed of two parts; first we want to see the floor slabs in our model and second we want the total amount of square meters. The input is relatively simple; we need to specify the number of floors and we need to specify the thickness of the slabs. There are two methods to specify the number of floor; by defining a number or by defining the floor height for each floor. In our design we choose the second option because we are looking for an usable design.

Furthermore we are reusing a component that we have build in the beginning: the core-line. This will act as the main driver for the division of the floors. Grasshopper has the option to position points along a curve. We are using these points as the input for the positioning of our floors. The input will be a slider defining the height of the floors. To make life easier we first will temporarily hide the outer surface of the tower created earlier.

• Turn off the preview of the outer surface RMB on the Loft » Toggle Preview
• Create a Number Slider Params » Special » Number Slider

Again we want to change the setting of the slider so that it conforms to our use. There is a minimum and a maximum height.

• Change the settings of the Number Slider RMB on the slider » edit
• Set the lower limit value to 2.8000 (minimum 2.8 meters)
• Set the upper limit value to 6.0000 (maximum 6 meters)
• Rename the Number Slider to floorHeight

Now we can create the curve division and connect these. Please take notice of the other division types.

• Divide the curve Curve » Division » Divide Distance
• Connect the output of floorHeight to the input D of the division
• Connect the output of the line to the input C of the division

We can check the output in our Rhino Model view. You will see a series of points along the line.

Because the shape of the tower is not known at the beginning of the process (we can rotate the top shape and change the number of sides of the tower) we need to create the floors based on the outer shape of the tower. To create the needed outer curve an intersection at each floor with the outer surface needs to be made. The intersection is made between a (virtual) plane and the outer surface. The plane uses the points on curve as center point.

• Create an XY plane from the points Vector » Plane » XY Plane
• Connect the output P of the Divide Distance to the Input O of the XY Plane.

Notice that for each point a plane is created. This is actually one of the more powerfull features of Grasshopper: Because the Divide Distance creates multiple points, the XY Plane treats each point as a centerpoint for a new plane, thereby making it easy to define one action for multiple objects.

Using the plane the intersection with the outer surface (also called a “BRep”) can be made.

• Calculate the intersection between the outer surface and the planes Intersect » Mathematical » Brep Plane
• Connect the output P of the XY Plane to the P input of the Intersect
• Connect the output L of the previously created loft to the B input of the Intersect

The curves define the outer boundary of the floors. Using a plane command the floor surface can be created.

• Generate a surface from the intersection curveSurface » Freeform » Boundary Srf
• Connect the output C of the intersect to the input E of the Planar Srf

With the surface for each floor created the area can be calculated using the Area component. A panel is created to review the result

• Calculate the area Surface » Analysis » Area
• Connect the output S of the Planar Srf to the input B of the Brep Area
• Display the output with a panel Params » Input » Panel
• Connect the output A of the Brep Area to the input of the panel

In the panel window the output of the Area component is visible. Notice that it treats each floor as an individual element and therefore calculates the area for each floor.

To calculate the total floor area all the individual floor areas need to be added. This can be accomplished with the use of the Mass Addition. This will be placed between the Brep Area and the Panel. For the Mass Addition the list of individual floor areas needs to be treated as one. This is done using the flatten command.

• Flatten the calculated areas Sets » Tree » Flatten Tree
• Connect the output A of the Brep Area to the Input D of the Flatten Tree
• Create a panel and connect to the output of the Flatten Tree

The difference is in the way Grasshopper treats the values in a list. In the first (not flattened) list each value is a separate object (also called a separate branch), in the flattened list it is one object with multiple values.

Now we can calculate the total area of the building by adding all values together.

• Calculate the sum of the areas Math » Operators » Mass Addition
• Connect the output D of the Flatten Tree to the input I of the Mass Addition
• Connect the output R (the result) to the input of one of the panels

The value in the panel is the total area of all the floors combined. In this example the total area is appr. 29100 square meters. There are several options to influence this value:

• Change the buildingHeight > a higher building can contain more floors, hence more floor area
• Change the outerRadius > larger floors
• Change the floorHeight > more or less floors
• Change the rotation > although the influence is minimal
• Change the number of Sides > also minimal influence

The last step is creating the thickness of the floors. To accomplish this the surface is extruded to the specified thickness. A slider will be used as input for the extrude. The extrude need a direction. In this case the Z-direction will be used.

• Add a Number Slider for the thickness Params » Special » Number Slider

Again we want to change the setting of the slider so that it conforms to our use. There is a minimum and a maximum thickness.

• Change the settings of the Number Slider RMB on the slider » edit
• Set the lower limit value to 0.1000 (minimum 0.1 meters)
• Set the upper limit value to 0.5000 (maximum 0.5 meters)
• Rename to floorThickness

Create the direction Z and connect the slider to the direction. The slider will act as an multiplier on the direction, which has a default value of 1.

• Define the thickness direction with a Unit Z vector Vector » Vector » Unit Z
• Connect the output of the floorThickness to the input F of unit Z

Next create the extrude component:

• Extrude the surfaces Surface » Freeform » Extrude
• Connect the output S of the planarSrf to the input B of the extrude
• Connect the output V of the UnitZ to the input D of the extrude

By right-clicking on the loft node, you can enable the preview to see the outer shell of the building.

This is the end of this tutorial. The resulting Grasshopper Definition allows the designer to generate alternatives using the various inputs defined in this tutorial.