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:
authorFlorian Meyer <florianfelix@web.de>2010-05-30 17:44:20 +0400
committerFlorian Meyer <florianfelix@web.de>2010-05-30 17:44:20 +0400
commitb0db439b3cc336eed9dcdc6849e7064275d19fa7 (patch)
tree8cd4def3a54978ba489cbb187b5eb4a143cb84d0 /curve_simplify.py
parent5523ab3a1fee08bafd1ca21294415729d7ffa8b1 (diff)
- fix for 0 edge length spotted by pildanovak,
thanks
Diffstat (limited to 'curve_simplify.py')
-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