Closed piscvau closed 3 years ago
This is the expected behavior -- that said, there's a simple workaround:
Simply change todisplay
--> todisplay._segments
` from svgpathtools.path import Line, Path as sPath from svgpathtools.paths2svg import wsvg from svgpathtools.parser import parse_path
path = parse_path(f"M 50, 200 a 100, 50 0 0 0 250,50") line1 = Line(start=55 + 250j, end=350 + 200j) line2 = Line(start=75 + 270j, end=360 + 210j) todisplay = sPath(path[0], line1, line2) colors = ('black', 'green', 'blue') filename = 'essai' wsvg(todisplay._segments, filename=filename, colors=colors ) `
AN error is generated by wsvg when using an instance of Path as paths and a list as colors. ` from svgpathtools.path import Line, Path as sPath from svgpathtools.paths2svg import wsvg from svgpathtools.parser import parse_path
path = parse_path(f"M 50, 200 a 100, 50 0 0 0 250,50") line1 = Line(start=55 + 250j, end=350 + 200j) line2 = Line(start=75 + 270j, end=360 + 210j) todisplay = sPath(path[0], line1, line2) colors = ('black', 'green', 'blue') filename = 'essai' wsvg(todisplay, filename=filename, colors=colors )
`