Filter faces that are almost horizontal on an organic shape (SAT)


I have a .SAT file of an organic shape consisting of 19.000 surfaces.
I would like to filter out the surfaces that are almost horizontal, within 5 degrees.
Filter by Orientation gives me only the horizontal ones.
Filter by Surface.PointAtParameter looks interresting, but how do i use it?


Get the normals of the surface and compute the dot product against the global Z-axis. Evaluate the scalars and set a threshold, (e.g. > 0.9). Any surfaces which satisfy this condition you can determine are horizontal.

Thank you @Thomas_Mahon

I found something from Vikram

I cannot figure out how the threshold part would work though

Look at the boolean nodes, use greater than (> symbol) and pass the result of your Vector.DotProduct node into it. Then List.FilterByBoolMask to return all the horizontal faces.

I’m not sure i have set it up correctly, watch3D nodes on the in an out of the boolean filter give me the same picture witch looks like all the geometry.??

Can you (or somebody else) give me a hint?

You’ve done it; although angle should be less than say 5-10 degrees (you are measuring the angle from the normals of the surface to the global Z axis). Only comment would be to use the dot product rather than measuring the angle between the vector.

Really, you’re doing the same thing, but computing the dot would be the expected way to go about this type of problem, plus you can ‘Math.Abs’ the scalar and pick up both ‘base’ and ‘top’ surfaces if they are orientated in opposing directions, whereas the angle wont offer you this luxury since ‘top’ surfaces would be < 10 degrees (assuming this is the tolerance for determining a ‘horizontal’ surface) and ‘base’ surfaces would be > 170 degrees, doubling-up your evaluation criteria, which is unnecessary.

1 Like

I understand the problem of flipped surfaces and using Math.Abs to flip the vectors coming from them.
I didn’t have this problem, i was lucky.

Made some small changes to make the resulting Dynamo geometry into Revit geometry.

For the underlying mathematics see this
Dot product calculations are on Page 7

EssentialMathematicsForComputationalDesign_ThirdEdition_rev3.pdf (3.3 MB)


You should post this link as a separate thread as I’m sure there are many Dynamo users who would benefit from reading this invaluable document.

1 Like