Angle_between issue
-
Hi guys wonder if someone can help.
I am trying to differentiate the difference between an internal corner and an external corner to get two different angles as shown in the below image.This is the code I am using, which is returning the same angle for all...?
puts (sel[0].faces[0].normal.angle_between (sel[0].faces[1].normal)).radians
Any help would be greatly appreciated.
Thanks -
@rinse04 said:
I am trying to differentiate the difference between an internal corner and an external corner to get two different angles as shown in the below image.
angle_between() returns the angle between 0 and 180 degrees. If you wish the oriented angle, you need to set a reference of some sort to distinguish between concave and convex angles. Look at your model, and make abstraction of the walls, keeping only the vectors, and you'll see that none can make a difference between inside and outside.
Usually, if you have vectors v1 and v2, say in the horizontal plane, then
(v1 * v2) % Z_AXIS
is either positive or negative. Now, up to you, based on conventions to consider this is an internal or external angle.Fredo
Advertisement