Autodesk Dynamo Tutorial - The Tower

Page 1

It’s just another tower I know that internet is full of tutorials on how to create strange tower with Dynamo or Grasshopper, but this is a very introductive guide on how to approach to this kind of modeling. The scope of this article is to give a method and not only the solution. Thanks to Thinkparametric (www.thinkparametric.com) for inspiring me about the concept.

Let’s start from the beginning. First of all you need to focus on the section of the tower: rectangular, circular, elliptical or any kind of strange shape that you can think. In this project we’ll use elliptical section, the same that you can use as a base for a stadium.

The is important to focus on how to mathematically construct the shape so is better to deconstruct the shape in simple curves like lines, arcs or other mathematical functions. For this project we’ll use a very simple mathematical function to construct something like an egg but, to keep it symmetrical, we will create both side of the egg like in the picture below.


The formula is not really complicated but, to be able to use this formula in Dynamo you need to convert in ”Excel like” way. Everything must to be in one line using only parenthesis:

((R-r)² - a²) / (2*(R-r)) R = radius of the major circle r = radius of the small circle a = distance between the circles center points P=R–y


Time for Dynamo Now that you have in your mind the ending point, we can start to “put on the paper” the idea and we can start to build our main section. For this project we’ll use only standard nodes provided by Dynamo installation. All the screenshots are taken from Revit 2017 and Dynamo 1.0.0 but you can easily apply this workflow to previous versions of Revit and Dynamo. Before starting turn Dynamo in Manual mode from the bottom left, this will prevent couple of crash if you write the wrong code or choose wrong nodes

Keep always in your mind the shape, draw the shape on a piece of paper and start to think how to draw. I’ll use one way to create the shape but remember that this is not always the perfect way and of course is not the only way to achieve the result. I’ll start to place all the center point for the circles that I need. The big circle will be located at coordinates (0,0,0) and from this I’ll calculate all the others center points.


Then a couple of number slider to be select variables. Is very easy to select nodes, just starting to write the name of the node in the search toolbar on the left or with right click in the canvas.

Then double click on the node to rename it and give a good label.


Easy! Now the firs appointment with Code Block, this is one of the most important nodes and is the way to easily create formulas. I’ll not concentrate on the explanation of the code block, all the documentation is available on the dynamo website. To create an empty Code Block just double click inside the canvas.

Then write the formula inside the code space. I’ll use some mathematical function available in Dynamo to calculate the squared of a given number. All the mathematical functions are provided by the Math library and to access to a specific function the syntax is Math.FunctionName(). In this case the power function is Math.Pow(n,powerValue), so the formula will be:


(Math.Pow(R-r,2)-Math.Pow(a,2))/(2*(R-r));

The code block is very powerful and it converts all the variables into input slots according to the name used in the formula. Now is time to connect nodes and Run!

Ok the formula is working, the first center point is in the origin and now we can calculate the position of small circles center points. A new node is coming and is the Geometry Translate node. In the geometry we need to fill the geometry that we want to translate, and in the other slots the value of the translation in all the three directions. Is important to note that this node is not moving the geometry but a copy of the geometry. Simple, we need to move the origin point by a value of “a� in both positive and negative X.


This is the real power of node based workflow, to be able to reuse value for multiple nodes and keep both logical and physical connections. Let’s see if you understood the process: how to do now the negative translation? Yes‌Code Block!

Do you think that the net of nodes is becoming complicated? This is still nothing, but everything as a logic. Now the others center points, the translation this time will be in the Y Axis with a value of y coming from the formula.


The first part is finished and we can start to group nodes to keep a clean and organized workspace. Just select a bounce of nodes and CTRL+G or from the menu Edit  Create Group, then we can change font size and color of the node.

Ready for the next step? Of course. Now is time to create circles using the circle node. There’re many ways to create a circle in Dynamo but for this exercise the simplest one is enough, just we need a center point and a radius. We have all these information, the center point is the one calculated at the beginning with x translations and the radius is the small radius, so we can fill with “a” value both of them.



And of course the big circle in the center origin with the biggest radius.

Now we need the two external circles tangent to both the small radius circles and the center circle. The center points will be the points calculated with the “y” translations and the radius will be P = R – y.

After the run the result will be similar to the picture. To navigate in the background canvas use CTRL+B or the small button on the top right of the window.


Yes‌the basic construction shapes are finished! Take a rest and drink you coffee, I’ll do the same.


Cut and sew All the basic shapes are ready and now we need to construct the final section curve. This curve is made by 4 different pieces coming from the different circles. To be able to cut all the circles we need to find the intersections point between all the shapes.

1

2

4

3


In Dynamo is easy to identify which element is related to a node, just click on the node and the relative geometry will be highlighted in the canvas.

To find intersection points we’ll use the node Geometry.IntersectAll. The node accept two geometries and we’ll combine both of the small circles with both of the biggest circles, that means four different intersection nodes.



Same for the second circle.

And this is the result.

Now there’re different ways to create the 4 different curves that will produce the final sections. We’ll use the simplest one but I want that you think about the solution before going to the next page.


Final section I’m sure that you thought about the solution and for sure is your best solution. I’ll share my personal way to resolve. We have 4 different circles and for all of them we have: center point and two points on the circle. In Dynamo we have exactly a node that is suitable for these input and is called Arc.ByCenterPointStartPointEndPoint. Actually we have also the radius but in this case is not necessary. To be more visible the result of the arc node, I’ll hide all the construction circles. Simply click on the node that is producing the geometry and remove the mark on Preview (do it on all the circle nodes).


Same operation for all the others intersections. Is a combinations of all the center points and the correct start and end point. I’m sure that if you’re at this point of the tutorial you’re also able to connect in the correct way all the points.

Perfect! The section is also finished and now you can try to play with the input values to see the final result.


Happy? I know! In the following chapter we’ll finalize the tower creating floors, external surface and some mathematical twisting.


The Tower The final section is still made by 4 different curves and we need to join them into one single curve. Is a very common step and to do this, first of all, we need to create a list of curves. The node List.Create is one of the most used node in Dynamo and it will be useful in thousands of circumstance. Depending on the number of input that you want to put together, you can add or remove items from the list by clicking on the plus or minus icon.

In this case the result of the list node is a nested list but, to join the curves we need a flatten list (have a look on the dynamo website to better understand the logic of the list) and there’s a specific node to flatten all the lists.

Finally we can use the PolyCurve.ByJoinedCurves to merge all the curves into one curve.


Now we have a type section for the floor and we can build our tower. First of all I changed my units in Revit to be in meters so we can deal with small numbers in our inputs. Again before starting we need to think about what we need as input to achieve our result: -

Number of floors (Integer Slider)

-

Distance between floors

-

Floor rotation o

Start rotation angle

o

End rotation angle


It’s possible to manage the range of each slider in the node properties. Open the small arrow on the left of the slider to access the min/max range

The maximum height of the tower will be MaxHeight = FloorHeight * NumFloors. We can easily use a code block to calculate this value.

With this we only have the total amount but we need the elevation of each floor as a list of levels. As always many ways but I want to show you a new node that will help to create a range of values with a starting value, ending value and step. The default value is 0 then the end value is the maximum height and the step is the floor height.


Do you remember how to translate a geometry and at the same time copy this geometry? Exactly! Geometry.Translate and the amazing thing is, if you fill the input of the geometry with a list you’ll get all the copies just in one node. So what are you waiting for? Just fill the curve into the geometry and the zTranslation and click run.

Good‌the tower is here! We are almost at the end of this tutorial and your tower now need a little bit of twisting before the external surface. The logical behind the rotation is similar to the translation but we need some more information. The node is Geometry.Rotate and as input we need: geometry (of course), origin of the rotation, axis of rotation and degrees of rotation.


The origin will be the translation of the origin at the elevation of each floor (you know how to do it), the axis, according to the world coordinate system is the Z axis, and for the degrees of rotation we’ll create a range using our input values. First we can create the translation of the origin point.

For the rotation range this time we’ll use a code block with a particular syntax minValue..maxValue..#numberValue+1 minRotation..maxRotation..#numFloors+1 Why plus 1? Because all the list has a first index the number 0 so is important in arrays to consider one step more. For example 54 floors means 0 to 53 that’s why we need to consider one more.


Now we are ready to rotate the geometries, the only thing we will search in the node library is the ZAxis node.

Hide

We can hide the Geometry.Translate node with the aligned section just to see the rotate sections



We came to the end, the latest node is the Surface.ByLoftwhich is accepting a list of curves as cross sections curves and basically is able to interpolate all these curves with a surface.

I’m very pleased to present you your brand new twisting tower. I hope that this tutorial is useful not only as a step by step but as a starting guide on how to think when you approach to computational design. Now is time to use this tower in Revit‌but this is another story for another tutorial. Cesare Caoduro


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.