From 6d42786d1f7b110cb31eedc6f25a0398904bbdbd Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Mon, 29 Nov 2021 21:07:39 +0100 Subject: [PATCH] fix in contour scanner (allow flattening arcs) --- .../contour_scanner_and_trimmer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/fablabchemnitz/contour_scanner_and_trimmer/contour_scanner_and_trimmer.py b/extensions/fablabchemnitz/contour_scanner_and_trimmer/contour_scanner_and_trimmer.py index 3505090c..f87ce27e 100644 --- a/extensions/fablabchemnitz/contour_scanner_and_trimmer/contour_scanner_and_trimmer.py +++ b/extensions/fablabchemnitz/contour_scanner_and_trimmer/contour_scanner_and_trimmer.py @@ -927,7 +927,8 @@ class ContourScannerAndTrimmer(inkex.EffectExtension): isPoly = False isBezier = False isPolyBezMixed = False - if ('c' in str(path) or 'C' in str(path)): + chars = set('aAcC') + if any((c in chars) for c in str(path)): isBezier = True if ('l' in str(path) or 'L' in str(path)): isPoly = True @@ -980,7 +981,7 @@ class ContourScannerAndTrimmer(inkex.EffectExtension): for subPath in subPaths: subPathData = CubicSuperPath(subPath) - #flatten bezier curves. If it was already a straight line do nothing! Otherwise we would split straight lines into a lot more straight lines + #flatten bezier curves. If it was already a straight line do nothing! Otherwise we would split straight lines into a lot more straight linesd) if so.flattenbezier is True and (isBezier is True or isPolyBezMixed is True): bezier.cspsubdiv(subPathData, so.flatness) #modifies the path flattenedpath = []