|
angle mathThis is just here so I don't forget ;) (small characters here refer to angles, capitals to lengths of sides) An oblique triangleA triangle without a 90 degree angle Python equivalents of the above math are for instance (untested): A = math.sin(a) / (math.sin(b)/B) A right angle triangleA triangle with a single 90 degree angle (a in this case)
Python equivalents of the above math are for instance: c = math.asin(C/A) Remember soscastoa! Finding the angle between two faces in BlenderNow this isn't really complicated.
Then we can simply do the following to find the angle: myAngle = Mathutils.AngleBetweenVecs(face1.no, face2.no)The result though is only an angle between 0 and 90 degrees, to find out if that is positive or negative continue reading below. Finding out whether the angle between two faces is convex or concaveA lot of the time you also want to know whether the angle is concave or convex (positive or negative). To get that we get the vector from the midpoint of face1 to the midpoint of face2.
In python that could be: dotProduct = Mathutils.DotVecs(face1.no, (face2.cent - face1.cent)) The resulting dot product will be either positive or negative depending on whether the angle is concave or convex.
|