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:
-rw-r--r--curve_simplify.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/curve_simplify.py b/curve_simplify.py
index 6c12e88a..da58e96b 100644
--- a/curve_simplify.py
+++ b/curve_simplify.py
@@ -127,6 +127,9 @@ def getCurvature(deriv1, deriv2):
def altitude(point1, point2, pointn):
edge1 = point2 - point1
edge2 = pointn - point1
+ if edge2.length == 0:
+ altitude = 0
+ return altitude
alpha = edge1.angle(edge2)
altitude = math.sin(alpha) * edge2.length
return altitude