- yet another fix for a Shapely 2.0 deprecation warning

This commit is contained in:
Marius Stanciu
2022-01-31 22:05:09 +02:00
committed by Marius
parent 0276f6cfbb
commit e8ceda4809
2 changed files with 7 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ CHANGELOG for FlatCAM beta
- updated the `isolate`, `cutout` and `geocutout` Tcl commands and now they yield multigeo Geometry objects - updated the `isolate`, `cutout` and `geocutout` Tcl commands and now they yield multigeo Geometry objects
- fixed an issue in `panelize` Tcl command where some parameters (`spacing_columns` and `spacing_rows` where forced into integers where correct was to keep them as floats) - fixed an issue in `panelize` Tcl command where some parameters (`spacing_columns` and `spacing_rows` where forced into integers where correct was to keep them as floats)
- fixed a performance issue in `panelize` Tcl command: when panelizing a Geometry object the total solid_geometry was calculated for each tool, but it was enough to be calculated once - fixed a performance issue in `panelize` Tcl command: when panelizing a Geometry object the total solid_geometry was calculated for each tool, but it was enough to be calculated once
- yet another fix for a Shapely 2.0 deprecation warning
30.01.2022 30.01.2022

View File

@@ -594,11 +594,13 @@ class GeometryObject(FlatCAMObj, Geometry):
multigeo_solid = [] multigeo_solid = []
if self.multigeo: if self.multigeo:
for tool in self.tools: for tool in self.tools:
multigeo_solid += self.tools[tool]['solid_geometry'] w_geo_list = list(self.tools[tool]['solid_geometry'].geoms) if \
isinstance(self.tools[tool]['solid_geometry'], (MultiPolygon, MultiLineString)) else \
self.tools[tool]['solid_geometry']
multigeo_solid += w_geo_list
else: else:
multigeo_solid = self.solid_geometry multigeo_solid = self.solid_geometry
w_geo = multigeo_solid.geoms \ w_geo = multigeo_solid.geoms \
if isinstance(multigeo_solid, (MultiPolygon, MultiLineString)) else multigeo_solid if isinstance(multigeo_solid, (MultiPolygon, MultiLineString)) else multigeo_solid
for geo in w_geo: for geo in w_geo:
@@ -1062,7 +1064,7 @@ class GeometryObject(FlatCAMObj, Geometry):
# int or None. # int or None.
spindlespeed = spindlespeed if spindlespeed else self.options['tools_mill_spindlespeed'] spindlespeed = spindlespeed if spindlespeed else self.options['tools_mill_spindlespeed']
las_min_pwr = las_min_pwr if las_min_pwr else self.options['tools_mill_min_power'] las_min_pwr = las_min_pwr if las_min_pwr else self.options['tools_mill_min_power']
dwell = dwell if dwell else self.options["tools_mill_dwell"] dwell = dwell if dwell else self.options["tools_mill_dwell"]
dwelltime = dwelltime if dwelltime else float(self.options["tools_mill_dwelltime"]) dwelltime = dwelltime if dwelltime else float(self.options["tools_mill_dwelltime"])
@@ -1566,6 +1568,7 @@ class GeometryObject(FlatCAMObj, Geometry):
:param geo_final: Destination GerberObject object. :param geo_final: Destination GerberObject object.
:param multi_geo: if the merged geometry objects are of type MultiGeo :param multi_geo: if the merged geometry objects are of type MultiGeo
:param fuse_tools: If True will try to fuse tools of the same type for the Geometry objects :param fuse_tools: If True will try to fuse tools of the same type for the Geometry objects
:param log: A logging object
:return: None :return: None
""" """