- in Cutout Plugin solved a Shapely 2.0 deprecation warning
This commit is contained in:
@@ -12,6 +12,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
- updated the language strings to the latest version
|
- updated the language strings to the latest version
|
||||||
- some changes in the Objects UI
|
- some changes in the Objects UI
|
||||||
- removed some VisPy patches that now are incorporated in the v 0.9 of VisPy; bumped the VisPy requirement to 0.9.0
|
- removed some VisPy patches that now are incorporated in the v 0.9 of VisPy; bumped the VisPy requirement to 0.9.0
|
||||||
|
- in Cutout Plugin solved a Shapely 2.0 deprecation warning
|
||||||
|
|
||||||
2.10.2021
|
2.10.2021
|
||||||
|
|
||||||
|
|||||||
@@ -2075,16 +2075,17 @@ class CutOut(AppTool):
|
|||||||
:param geometry: Shapely type or list or list of list of such.
|
:param geometry: Shapely type or list or list of list of such.
|
||||||
"""
|
"""
|
||||||
flat_geo = []
|
flat_geo = []
|
||||||
|
work_geo = geometry.geoms if isinstance(geometry, (MultiPolygon, MultiLineString)) else geometry
|
||||||
try:
|
try:
|
||||||
for geo in geometry:
|
for geo in work_geo:
|
||||||
if geo:
|
if geo:
|
||||||
flat_geo += CutOut.flatten(geometry=geo)
|
flat_geo += CutOut.flatten(geometry=geo)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
if isinstance(geometry, Polygon) and not geometry.is_empty:
|
if isinstance(work_geo, Polygon) and not work_geo.is_empty:
|
||||||
flat_geo.append(geometry.exterior)
|
flat_geo.append(work_geo.exterior)
|
||||||
CutOut.flatten(geometry=geometry.interiors)
|
CutOut.flatten(geometry=work_geo.interiors)
|
||||||
elif not geometry.is_empty:
|
elif not work_geo.is_empty:
|
||||||
flat_geo.append(geometry)
|
flat_geo.append(work_geo)
|
||||||
|
|
||||||
return flat_geo
|
return flat_geo
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user