- more Shapely deprecations fixes

This commit is contained in:
Marius Stanciu
2021-09-21 20:16:44 +03:00
committed by Marius
parent 734398d460
commit 548b5c2e28
3 changed files with 8 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ CHANGELOG for FlatCAM beta
- made sure that the Gerber Object geometry is always flattened
- in Legacy2D graphic engine fixed setting the Opacity functionality
- fixed a recent issue where Gerber files made out of single polygons were not processed
- more Shapely deprecations fixes
19.09.2021

View File

@@ -1641,9 +1641,11 @@ class Gerber(Geometry):
except TypeError:
buff_length = 1
try:
if isinstance(self.solid_geometry, MultiPolygon):
sol_geo_length = len(self.solid_geometry.geoms)
elif isinstance(self.solid_geometry, list):
sol_geo_length = len(self.solid_geometry)
except TypeError:
else:
sol_geo_length = 1
try:

View File

@@ -8104,8 +8104,9 @@ def flatten_shapely_geometry(geometry):
if isinstance(geometry, (MultiLineString, MultiPolygon, MultiPoint)):
for geo in geometry.geoms:
flat_list.append(geo)
for geo_el in geometry:
flat_list += flatten_shapely_geometry(geo_el)
else:
for geo_el in geometry:
flat_list += flatten_shapely_geometry(geo_el)
except TypeError:
flat_list.append(geometry)