Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Dominec <adominec@gmail.com>2019-07-23 15:20:52 +0300
committerAdam Dominec <adominec@gmail.com>2019-07-23 15:20:52 +0300
commit9dfa4aa12cc8d40cc8ef9b67fe39fbdca1f3f589 (patch)
treea7e181319e022d7588026d5b7c4f987b9a91a518 /io_export_paper_model.py
parentf4db75e60f3532a3774f182aa72f4308be828f43 (diff)
export paper model: important fix, upstream 02fe87e
Diffstat (limited to 'io_export_paper_model.py')
-rw-r--r--io_export_paper_model.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/io_export_paper_model.py b/io_export_paper_model.py
index 39d6b508..39b65505 100644
--- a/io_export_paper_model.py
+++ b/io_export_paper_model.py
@@ -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)