Fix in flevobezier
This commit is contained in:
parent
4d9a52a94e
commit
89bf906191
@ -66,10 +66,10 @@ def flevobezier(points, z):
|
|||||||
v = window[-3] - window[-2]
|
v = window[-3] - window[-2]
|
||||||
w = window[-1] - window[-2]
|
w = window[-1] - window[-2]
|
||||||
try:
|
try:
|
||||||
v_w = dist(v) / dist(w)
|
dist(v) / dist(w)
|
||||||
except ZeroDivisionError as e:
|
except ZeroDivisionError as e:
|
||||||
pout("Division by zero. Check if your path contains duplicate handles.")
|
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 dotp(v, w) / dist(v) / dist(w) >= 0.5: # 60 degrees or less, over by angle
|
||||||
if maybeover: # backup
|
if maybeover: # backup
|
||||||
newcurve = stress(points[prevtrail:lead])[0]
|
newcurve = stress(points[prevtrail:lead])[0]
|
||||||
res[-3:] = newcurve[1:] # replace the last three nodes in res with those of newcurve
|
res[-3:] = newcurve[1:] # replace the last three nodes in res with those of newcurve
|
||||||
|
Reference in New Issue
Block a user