Skip to content

Commit

Permalink
export paper model: important fix, upstream 02fe87e
Browse files Browse the repository at this point in the history
  • Loading branch information
addam committed Jul 23, 2019
1 parent f4db75e commit 9dfa4aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions io_export_paper_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down Expand Up @@ -703,7 +703,9 @@ def calculate_angle(self):
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)

Expand Down

0 comments on commit 9dfa4aa

Please sign in to comment.