Curtain Panel Orientation - false normals


#1

Hi

I’m doing a definition to analyse world orientations of Windows and Curtain Panels. It’s quite easy for Windows, but as node FamilyInstance.FacingOrientation cannot be used for Curtain Panels and CurtainPanel.PanelPlane doesn’t work for panels on a curved Curtain Wall, I’m running into trouble.

I’ve got everything working except panels on curved walls. I’m just starting to wrap my head around vectors and normals, but I understand what is going on and why it fails - I just don’t know how to solve it. It seems like the direction / orientation of the panels is the missing link.

Can anybody help me out?

Best
Christian

Window Orientation 2.dyn (55.1 KB)
version 2.rvt (2.6 MB)


#2

Don’t you find it funny it’s exactly 90 degrees off :smiley:


#3

From 0-180 deg the values are correct - also the two panels you’ve dimensioned, as their faces have angles of 12 and 29 deg related to true north. So the values are actually not 90 degrees off :slight_smile:

The problem occurs on panels oriented from 180 to 360 deg related to true north, as it’s the wrong side of the panels that are being “calculated”.


#4

I guess it could be something concerning the direction of the normals:

Probably depending on the direction of the normal it’s calculating the bigger angle.


#5

It’s calculating like shown below;

All red are false. All angles should be calculated like the green ones, pointing away from the exterior side of the panels.


#6

Christian_Boggild_Sc,
I have had to solve this problem a few months ago. I have posted it on our company blog, with the Dynamo files available for download. Maybe it will help you:
http://edrpl.us/blog/2016/6/8/edr-glass-rose-beta-testing


#7

Here’s another method that may also work assuming the normals of the CurtainPanel.Boundaries is consistent:

Assuming it is, and assuming the surfaces created from the CurtainPanel.Boundaries results in inconsistent normals; calculate their dot product. Any scalar of -1 is an inverted Surface.NormalAtPoint. Use Vector.Reverese guided by an if statement and you should now be able to output the correct angles for all panels from this ‘corrected’ set of vectors.

Before conditional reverse:

After conditional reverse:

Graph:

EDIT: ps, if the result of the dot is anything to go by, it seems the normals of the CurtainPanel.Boundaries indicate these elements are treated as planar, meaning you can bypass everything and simply use Curve.Normal, I haven’t tested this so I’ll leave that for you to uncover.


The orientation of the Adaptive
#8

@Thomas_Mahon
That is brilliant! Thank you for your thorough walkthrough.

As you assumed, Curve.Normal does the job.


#9

Here’s the final definition if somebody’s interested;

Window Orientation.dyn (53.1 KB)


#10

Hello,

I have tried many things on my own and what you and @Thomas_Mahon have posted with no luck. The screen shot below is using the script you posted (without any changes). The two show, one was copied and then flipped but it is still showing the normal in the same direction. The two curtain walls in the first image are the same ones in the following ones after.

The panel normal, curve normal, and the patch normal are all equal for both walls.

The code in the python script is

import clr

clr.AddReference('RevitAPI')

from Autodesk.Revit.DB import *



clr.AddReference("RevitNodes")

import Revit

clr.ImportExtensions(Revit.Elements)

clr.ImportExtensions(Revit.GeometryConversion)



wallinstances = UnwrapElement(IN[0])

vectorlist = list()

for item in wallinstances:

    try:

        lcurve = item.Location.Curve

        if str(lcurve.GetType()) == "Autodesk.Revit.DB.Line":

            vectorlist.append(item.Orientation.ToVector())

        else:

            direction = (lcurve.GetEndPoint(1) - lcurve.GetEndPoint(0)).Normalize()

            vectorlist.append(XYZ.BasisZ.CrossProduct(direction).ToVector())

    except:

        vectorlist.append(list())

OUT = vectorlist

any help would be great,
steven


#11

I just found Wall.ExteriorDirection in Archi-lab and it works. Sorry for the post.

image