Closed tatarize closed 3 years ago
This will be corrected in svgelements 1.4.11. The parsing somewhat represents the render tree and as such degenerate shapes which are not to be rendered will not be returned as parsed. So Rect with widths of 0 will also be omitted going forward.
For reference in case someone else encounters this bug, this is the error shown when this happens:
File "c:\users\ohmar\virtualenvironments\vpype_venv\lib\site-packages\vpype\io.py", line 189, in _extract_paths
path = [svgelements.Move(elem.points[0]), elem]
IndexError: list index out of range
1.4.11 was published and should omit degenerate shapes.
https://github.com/meerk40t/svgelements/issues/105
A polygon of
<polygon points="">
in svg creates a polygon of zero points and as such that line causes an index error. I checked the SVG spec for the error handling of 0 point polygons and it says "The initial value, (none), indicates that the polygon element is valid, but does not render." Which means svgelements is in error when it produces a degenerate polygon in that case.