Thursday, January 22, 2015

Dynamo - Spanish Roof Tile Generator

Why just few people know how awesome Dynamo is?
I suppose there are two representatives.

1. Hard to learn.

Not as difficult as learning other script based programming for sure. But not as easy as learning Revit. It must be much easier to learn if there are enough sources like the ones of Revit. I expect it should be solved soon or later.

2. Regarded as not very practical yet.

People says that Dynamo has a lot of potential. It can be easily regarded as it's useless yet when we say something has potential. I love computational design.  But It's true that there are just few projects which can be treated with computational design in real world.  Most of architects are still using traditional design codes or process even though they're using Revit.

So I created an example which can make some interests from the architects who are thinking Dynamo has just potential yet.

Roof Generator

This dyn places muliple AC Rooftile families at proper faces of selected sloped roof from Revit at once.

When you select a roof element, it will find six different parts and separate them as several lists as below.

1. Surfaces for plate tiles.
2. Eaves
3. Hips (connected with eaves)
4. Hips (disconnected with eaves)
5. Valleys
6. Ridges

Finding surfaces and placing plate tiles were not very difficult. But finding each of rest parts were quite complicated and made dyn larger than I expected.

Watch what I created.

Brief Poccess

1. Filtering above surfaces from all surfaces.

    Create lowest xy plane and use Geometry.DoesIntersect.

2. Find perimeter curves of each surfaces.

   Most of perimeter curves makes their first curve from eave.

I like this order
But, some of perimeter curves make their last curve at eave.
I don't like this order
This is quite important issue in this case. Because AC family will be placed in order of perimeter curves. Find some last-curve-eave series and use List.ShiftIndices.

3. Find valley and mountin vertex from eave-polycurve.

These will be end points (or start points) of both valleys and hips of the roof.
I explained about it at my last post.

4. Find hips & valley curves.

Use Geometry.DoesIntersect.  between new lowest plane and rest (not eaves) of curves. Only hips and valleys which have there end points at eave level intersect. and it will naturally find unique curves from overlapped series.

5. Find ridges and another hips as unique curves.

Now. rest of curves are all ridges or hips which are not connected with eaves. Only problem is that they are all overlapped also like above.

Overlapped curves have their mid point at same place. I used this concept to find unique ones.

6. Place proper families at proper location

This is the easiest part. Just use the families I published earlier.
Use all start points for plate tiles and use start & end points for ridge and hip tiles.
The only thing I had to do was creating Roof tile ACs for multiple points cases.

6-1. If you don't want to make too many similar families just for points-count-cases, you can cover all cases with one AC family by splitting perimeter curves.

 I used only original nodes in Dynamo library. I suppose there should be better ways to do the same. It could be much easier(or shorter) with multiline codes.

 I hope you found something beyond potential of Dynamo through my post.

  You can get above files as usual.

Enjoy. :)


  1. That is seriously cool HyunWoo Kim! Will have to come back at look at it when I get a little deeper into Dynamo. Thanks for posting this, it's very inspiring (And starting to showcase some of the level of modelling capability one would expect from 3D BIM)

  2. Good job! impressive as usual :)
    I found myself more comfortable with line codes because it's easier to "get lost" in a Dynamo solutions, specially if you are not the one who wrote it in the first place, but it's a very powerful tool with many ready-to-use chunks of code at your fingertips. The dynamic behaviour is definitely a goodie, in conjunction with the fact that lets you import external libraries (look for zero touch) the capabilites are virtually endless. This is good not only for the modelling part, but also for managing data and keep it consistent between models and external files like a spreadsheet. Once again well done! :) cheers -Paolo

  3. 멋집니다! 현우씨한테 정말 많이 배웁니다. 그리고 감사합니다.

  4. I used your old spanish tiles family for a uni project years ago. Nice to see it revamped through Dynamo!

  5. Just arrived to Dynamo, very impress with your job, Congratulations from Spain!

  6. how we can learn dynamo from scratch can please give any link.

    1. see this link. i also learn from this site

      also see this link.

      and watch AU CLASSES for same.

      good luck. :-)