This commit is contained in:
Mario Voigt 2024-01-18 11:56:30 +01:00
parent 68e1dd9ac4
commit 6f1d0d2003
1 changed files with 235 additions and 228 deletions

View File

@ -101,9 +101,11 @@ class ChainPaths(inkex.EffectExtension):
p2 = seg2[0]
# fuse p1 and p2 to create one new point:
# first handle from p1, point coordinates averaged, second handle from p2
seg.append([ [ p1[0][0] , p1[0][1] ],
[ (p1[1][0] + p2[1][0]) * .5, (p1[1][1] + p2[1][1]) * .5 ],
[ p2[2][0] , p2[2][1] ] ])
seg.append([
[ p1[0][0] , p1[0][1] ],
[(p1[1][0] + p2[1][0]) * .5, (p1[1][1] + p2[1][1]) * .5],
[ p2[2][0] , p2[2][1] ]
])
seg.extend(seg2[1:])
else:
seg = seg1[:]
@ -157,6 +159,11 @@ class ChainPaths(inkex.EffectExtension):
if node.tag != inkex.addNS('path', 'svg'):
inkex.errormsg("Object id {} is not a path. Try\n - Path->Object to Path\n - Object->Ungroup".format(node.get('id')))
return
#check if node has a transform. If yes, print a warning
if node.get('transform') is not None:
inkex.utils.debug("Warning: node {} has transform {}. Use 'Apply Transforms' extension before to handle this.".format(node.get('id'), node.get('transform')))
return
if so.debug: inkex.utils.debug("id={}, tag=".format(idnode.get('id'), node.tag))
path_d = CubicSuperPath(Path(node.get('d')))
sub_idx = -1