export paper model: important fix, upstream 02fe87e

This commit is contained in:
Adam Dominec 2019-07-23 14:20:52 +02:00 committed by Brecht Van Lommel
parent 75bbbdd060
commit d3c863c837
1 changed files with 4 additions and 2 deletions

View File

@ -12,7 +12,7 @@
bl_info = {
"name": "Export Paper Model",
"author": "Addam Dominec",
"version": (1, 0),
"version": (1, 1),
"blender": (2, 80, 0),
"location": "File > Export > Paper Model",
"warning": "",
@ -703,7 +703,9 @@ class Edge:
if not normal_a or not normal_b:
self.angle = -3 # just a very sharp angle
else:
self.angle = asin(normal_a.cross(normal_b).dot(self.vector.normalized()))
s = normal_a.cross(normal_b).dot(self.vector.normalized())
s = max(min(s, 1.0), -1.0) # deal with rounding errors
self.angle = asin(s)
if loop_a.link_loop_next.vert != loop_b.vert or loop_b.link_loop_next.vert != loop_a.vert:
self.angle = abs(self.angle)