From 2a39a6cbd8877e098d4f659daafde608aec23a73 Mon Sep 17 00:00:00 2001 From: Florian Meyer <florianfelix@web.de> Date: Thu, 10 Jun 2010 18:42:32 +0000 Subject: [PATCH] now really the correct fix for zero edge lengths --- curve_simplify.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/curve_simplify.py b/curve_simplify.py index 5cc062326..70e9f8255 100644 --- a/curve_simplify.py +++ b/curve_simplify.py @@ -142,6 +142,9 @@ def altitude(point1, point2, pointn): if edge2.length == 0: altitude = 0 return altitude + if edge1.length == 0: + altitude = edge2.length + return altitude alpha = edge1.angle(edge2) altitude = math.sin(alpha) * edge2.length return altitude -- GitLab