# Learn To Model a Twisted Tower in Grasshopper

Hi there,

So, now that we are somewhat familiar with the basic geometry types in Rhino and Grasshopper, it is time to get some modeling experience in. I think a good starting model is the classic twisting tower that most beginners with Grasshopper go through.

Although simple, creating this model should hopefully help us be more comfortable with using Grasshopper and help us start out with using the program itself.

But before we dive into the script, we have to first figure out the driving factors of the model. A very important part of Grasshopper is to identify the key variables and assumptions because they govern the logic of the script itself.

# Key Variables and Assumptions

There are many ways to create this tower much like there are many routes you can take to work. To figure out which modeling route to take, you have to first find the answers to these two questions.

What information do you have now?

What is the story of this model?

The second question precedes the first, you need to know what information you have first before you can think of creating the story of the model.

To answer the second question, we need more experience and a better instinct in Grasshopper which will come later as we learn more and more about the program. For now, let’s focus on answering the first question.

Since we don’t have a model brief, we have to make one up to get started. In our case, let’s say that two key variables are the inter-floor height and the number of floors. This is actually quite common in the real world as most building developers would like to know how many people they can fit into a building.

So that means our tower will be primarily driven by inter-floor height and the number of floors and our job is to build a model that can quickly go through different iterations of these two variables here.

# Modeling

Now that we know our key variables, we can start with creating the initial floor profile. I am going to just create a simple square for now. I can do this by first creating a slider for some rough dimensions, then feeding that number into a rectangle component.

I am using the same slider for both X and Y because I want a square. If I wanted a rectangle, all I have to do is to make two sliders.

Then it is time to create two more sliders that are our two key variables, the inter-floor height and the number of floors. I am doing this here to create the floors of our tower. I am also going to rename the sliders so that we know which slider controls which variable.

I am then going to use the LinearArray component to create the floors. The LinearArray component moves the input geometry in a certain direction a number of times. This means the component takes in a geometry, vector, and a double.

and in our case, I want to move it in the Z direction by the inter-floor height and by the number of floors that we specified earlier.

Now, that we have our floors, I can apply a rotation to each of the floors to create the twisted shape of the tower.

To do this, I am going to be using the Range component which lets you create a list of values when you pass in a domain and the number of steps.

The -1 is there because the Range component forces the first and last number of the list to match the start and end of the domain given. To match up with the number of floors, we have to add the -1.

And we are almost done, all that is left to do is to loft all the curves together so that they become one model.

With our script created, we can also experiment with different floor profiles and see what our tower looks like. As long as we don’t violate our key variables, we can make changes to the script without worrying about any cascading effects.

# Changing Floor Profiles

So let’s try using a hexagon as the floor profile instead, all I have to do is to replace the Rectangle component with the Polygon component.

And you can see that the script handles the new shape as expected. I can even try drawing a curve of my own in Rhino and then reference that back in Grasshopper itself.

But something has gone wrong here, the rotation of the drawn curve isn’t working well with the script.

If I take a look from the top, the curve is rotating around the wrong point. It seems to be rotating around the origin instead of its center. Well, that is because the Rotate component uses the world XY as the center of rotation by default.

To fix this, all I have to do is pass in the centroid of the curve. We can do this by using the Area component.

In using the Rotate component, I have made a hidden script dependency. Before fixing it with the Area component, the script relied on the floor profile having its center at the origin. I broke that hidden dependency when I drew a curve that didn’t have its center at the origin.

I hope that shows that it is important to figure out any hidden dependencies that your script might have, especially when you have to make a change to the script itself. Sometimes the fix is not as simple as adding another component.

# Model Logic

To help with better understanding Grasshopper, I am going to try something new with this Newsletter. I am going to be including a “Model Logic” section that shows a high-level overview of the mindset that I used when creating the model.

I’ll be doing this for every model that I show. I think this is useful in understanding how I approach modeling and hopefully, it gives you some insight in approaching other modeling problems.

# Final Thoughts

I hope in following along with me, you are more comfortable with using Grasshopper now. Mastering Grasshopper is all about using it more and gaining more experience in a variety of situations.

If you enjoyed what you have read, consider subscribing to this Newsletter and the Youtube channel. It really helps me out, I am trying to get more people to talk and share about Computational Design.

## You can find the Grasshopper Script for this model for free here :

(Just Set a Price of 0 dollars)

## https://allthingscomputational.substack.com/p/the-best-way-to-master-grasshopper?s=w

or

https://medium.com/all-things-computational/the-best-way-to-master-grasshopper-is-to-learn-by-doing-27c538ebfa9a

Originally published at https://allthingscomputational.substack.com on March 22, 2022.

--

--

--

## More from All Things Computational

Connecting the world of geometry, programming, and engineering. Come learn about this hidden world that lives in plain sight.