cu2qu.rf: only get fist item returned from curve_to_quadratic, ignore approx error

curve_to_quadratic and curves_to_quadratic now return a (spline, error) tuple.
This commit is contained in:
Cosimo Lupo 2015-12-07 14:42:57 +00:00
parent 4dffdb7dd7
commit e6b47d61c9

View File

@ -118,10 +118,10 @@ def points_to_quadratic(p0, p1, p2, p3, max_err, max_n):
if hasattr(p0, 'x'): if hasattr(p0, 'x'):
curve = [(float(i.x), float(i.y)) for i in [p0, p1, p2, p3]] curve = [(float(i.x), float(i.y)) for i in [p0, p1, p2, p3]]
return curve_to_quadratic(curve, max_err, max_n) return curve_to_quadratic(curve, max_err, max_n)[0]
curves = [[(float(i.x), float(i.y)) for i in p] for p in zip(p0, p1, p2, p3)] curves = [[(float(i.x), float(i.y)) for i in p] for p in zip(p0, p1, p2, p3)]
return curves_to_quadratic(curves, max_err, max_n) return curves_to_quadratic(curves, max_err, max_n)[0]
def replace_segments(contour, segments): def replace_segments(contour, segments):