Fix in flevobezier

This commit is contained in:
leyghisbb 2021-04-14 21:53:11 +02:00
parent c13ab76b7d
commit 588eedaaad
1 changed files with 5 additions and 1 deletions

View File

@ -65,7 +65,11 @@ def flevobezier(points, z):
window = points[trail:lead + 1] # Extend the window one more node
v = window[-3] - window[-2]
w = window[-1] - window[-2]
if dotp(v, w) / dist(v) / dist(w) >= 0.5: # 60 degrees or less, over by angle
try:
v_w = dist(v) / dist(w)
except ZeroDivisionError as e:
pout("Division by zero. Check if your path contains duplicate handles.")
if dotp(v, w) / v_w >= 0.5: # 60 degrees or less, over by angle
if maybeover: # backup
newcurve = stress(points[prevtrail:lead])[0]
res[-3:] = newcurve[1:] # replace the last three nodes in res with those of newcurve