If a path has some disconnected objects, which I believe is handled with the M (move) command in SVG, how do we detect this from within svgpathtools commands?
I'm currently using something like the following code, which ends up drawing a line between those two disconnected shapes:
lx=ly=None # Last x,y
paths, attributes = svg2paths(file)
for pathi,path in enumerate(paths):
for parti,part in enumerate(path):
for i in np.arange(0, 1, .32):
pt = part.point(i)
x,y = pt.real, pt.imag
if lx is not None:
line(lx, ly, x, y)
lx=x; ly=y
If a path has some disconnected objects, which I believe is handled with the M (move) command in SVG, how do we detect this from within svgpathtools commands?
I'm currently using something like the following code, which ends up drawing a line between those two disconnected shapes: