boldport/pcbmode

Shape dimensions are not calculated correctly for path-shapes with multiple sub-paths

Opened this issue · 1 comments

I wanted to pour a shape mutiple sub-paths, as seen in the image.
image
Unfortunately the shape got placed off center even if loctation is [0,0].
I tracked the problem down to an erroneous behaviour of SvgPath._getDimensions() for multi-shape paths:

from pcbmode.utils import svgpath
path = " M 10,-10 L 0,-10 L 0,-0 L 10,-0 z M 25,-10 L 15,-10 L 15,-0 L 25,-0 z M 40,-10 L 30,-10 L 30,-0 L 40,-0 z M 55,-10 L 45,-10 L 45,-0 L 55,-0 z"
svgp = svgpath.SvgPath(path)
print svgp._getDimensions(svgp._relative_parsed)

>>(55.0, 40.0)

I'm starting to work on the next version of PCBmodE at branch cinco-master. I'll look at this issue -- I know that there is one! -- during this work. Thanks.