angle_between issue

angle_between issue

Postby rinse04 » Wed Sep 25, 2019 9:19 am

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...?

Code: Select all
puts (sel[0].faces[0].normal.angle_between (sel[0].faces[1].normal)).radians


Any help would be greatly appreciated.
Thanks
0

rinse04 
 

Re: angle_between issue

Postby fredo6 » Thu Sep 26, 2019 2:12 am

rinse04 wrote: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
1
User avatar
fredo6 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Developers' Forum

Who is online

Users browsing this forum: pedrobaan and 8 guests

Visit our sponsors: