Design technologist Colin McCrone gives a tutorial in Dynamo for Autodesk Revit for how to analyze panel orientation and choose which family type to place based on code requirements. The vector dot product is used to compare the panel surface normal with the vertical dimension.
- [Narrator] Let's look at how we can use Dynamo to analyze the orientation of a panel and then choose which type of panel and Revit to place. This type of analysis is important sometimes because of code restrictions which may say that panels that are more roof-like need to be of a different type. Say, for example they may need to support the weight of a person walking on them for maintenance. We need to distinguish between those and panels that are more facade-like. To do that, we should compare the surface-normal, which is the vector that is perpendicular to the surface, for each of the panels relative to vertical.
Let's start by finding the surface-normal. We'll use the node surface.normal at parameter. And the parameters we can use are 0.5, which should give us pretty close to the midpoint. But these panels are all slightly twisted, but it will give us a good average for the whole panel. Next, we want to compare this with the vector.z axis. One way we can compare vectors is with the node vector.angle with vector.
This looks like it might be good, but we might have some surprising results here. For one, we don't actually know which way these surfaces are oriented. They may be pointing downwards, meaning that the winding of the verticis may be in such a manner as to make the normal point down. This will be harder for us to distinguish between those that point up. Either way, we have to do a little bit of math because really large numbers like 110 indicate that at least some of the panels are pointing downward. Rather than introduce a whole bunch of checks in order to make sure that our surfaces are pointing the correct way, let's use a different method.
Let's us a vector.product or vector.dot. In the vector.product is a measure of the component of one vector in the direction of another. That means, if the answer is zero, then the two vectors are perpendicular to one another and it also means that our panel would be perfectly vertical since it would share no component with the vertical z-axis. If the answer were one, then we would know that our panel were perfectly horizontal because it's surface-normal is pointing exactly in the same direction as up.
However, we have another possible answer too and that's we can have some negative answers that means that our panel would be pointing exactly down. Well, we're interested in those cases too because even though mathematically the panel is pointing down, it really is still horizontal. So, we don't actually care in this case about the sign, if it's pointing up or pointing down, we just care how close is it to pointing vertically? So, what we'll do is take the absolute value. We'll say math.absolute.
Now, we already know something about the comparison of each panel related to vertical, so let's it human readable. I'll introduce a number slider that will let us specify the cutoff angle. So, the start-value should be zero. The maximum-value should be 90 and the step-value can be anything. We'll make it easy and make it one. Let's start at something like 55. Okay, so how does our .product relate to the angle cutoff 55? We'll remember that the value of a .product itself is the length of the vector of one vector projected toward another.
Are you thinking right triangles? There's definitely a little big of trig in here. In fact, all we have to do is take the arc cosine of this ratio in order to find our angle. I'll use math.Acosine and now we have the angle difference between each surface's normal and vertical and we can apply the condition of the cutoff. We'll ask, is this angle less than the cutoff? And now we have our trues and falses with which we can make a distinction.
I'll group these nodes and say test if a roof panel. Now we can use the trues and falses to distinguish between which panel type should be placed. We'll use list.filter by pool mask. The mask is always the set of trues and falses and the list we want to operate on are the set of points. The reason for the points is because we'll use them to place adaptive components and Revit. To the place the adaptive components, we'll use adaptive component live points along with specifying a family type.
Instead of four-point panels, we'll use a four-pointed panel family type and remember, the end output here is corresponding to those that are roof panels, so, I'll make them opaque. Separately, we can place another set of panels for the walls. And these, just to make a difference, I'll make it clear. Now, we should see, in Revit, our form with a distinction between the panels that are perhaps by code, required to be considered roof versus those that can be clear and facade-like.
In this video, we looked at how to analyze the orientation of a panel and then how to choose what panel type to place based on that information. This has implications for code compliance or other types of, perhaps design considerations, that you might have.
- Paneling strategies
- Paneling with packages
- Normalized curve and surface parameters
- Importing geometry
- Adaptive components
- Conditional family placement
- Analysis and data
- Visualizing information
- Panel orientation and dimensions
- Embedding data in Revit elements
- Applying a regular pattern and a random pattern
- Mapping an image