diff --git a/CHANGELOG.md b/CHANGELOG.md index 7167bd27..bac377d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ CHANGELOG for FlatCAM Evo beta 9.05.2022 - fixed an issue in the Paint Plugin where some polygons are discarded in a Geometry object made out of an imported SVG +- fixed an issue in the SVG parser where when parsing a path and getting multiple polygons will generate an invalid compound polygon (the polygons other than the first are seen as interiors even if they are not inside the first) 6.05.2022 diff --git a/appParsers/ParseSVG.py b/appParsers/ParseSVG.py index a704f62f..c38ddef2 100644 --- a/appParsers/ParseSVG.py +++ b/appParsers/ParseSVG.py @@ -202,7 +202,7 @@ def path2shapely(path, object_type, res=1.0, units='MM', factor=1.0): contained = [] not_contained = [] if len(poly_list) > 1: - for p in poly_list[1:-1]: + for p in poly_list[1:]: if poly_list[0].contains(p): contained.append(p) else: @@ -217,7 +217,7 @@ def path2shapely(path, object_type, res=1.0, units='MM', factor=1.0): if contained: geo_element = Polygon(poly_list[0].exterior, [p.exterior for p in contained]) geometry.append(geo_element) - except Exception as err: + except Exception: coords = [] for line in rings.geoms: coords.append(line.coords[0])