- cascaded_union() method will be deprecated in Shapely 1.8 in favor of unary_union; replaced the usage of cascaded_union with unary_union in all the app

This commit is contained in:
Marius Stanciu
2020-10-21 13:55:41 +03:00
committed by Marius
parent 265028de76
commit 66a3e36701
26 changed files with 116 additions and 115 deletions

View File

@@ -2568,7 +2568,7 @@ class CNCJobObject(FlatCAMObj, CNCjob):
# g['geom'] = affinity.scale(g['geom'], factor, factor, origin=(0, 0))
#
# tool_dia_copy['gcode_parsed'] = deepcopy(dia_value)
# tool_dia_copy['solid_geometry'] = cascaded_union([geo['geom'] for geo in dia_value])
# tool_dia_copy['solid_geometry'] = unary_union([geo['geom'] for geo in dia_value])
temp_tools_dict.update({
tooluid_key: deepcopy(tool_dia_copy)

View File

@@ -2052,7 +2052,7 @@ class GeometryObject(FlatCAMObj, Geometry):
# TODO this serve for bounding box creation only; should be optimized
# commented this; there is no need for the actual GCode geometry - the original one will serve as well
# for bounding box values
# dia_cnc_dict['solid_geometry'] = cascaded_union([geo['geom'] for geo in dia_cnc_dict['gcode_parsed']])
# dia_cnc_dict['solid_geometry'] = unary_union([geo['geom'] for geo in dia_cnc_dict['gcode_parsed']])
try:
dia_cnc_dict['solid_geometry'] = tool_solid_geometry
self.app.inform.emit('[success] %s...' % _("Finished G-Code processing"))
@@ -2202,7 +2202,7 @@ class GeometryObject(FlatCAMObj, Geometry):
# TODO this serve for bounding box creation only; should be optimized
# commented this; there is no need for the actual GCode geometry - the original one will serve as well
# for bounding box values
# geo_for_bound_values = cascaded_union([
# geo_for_bound_values = unary_union([
# geo['geom'] for geo in dia_cnc_dict['gcode_parsed'] if geo['geom'].is_valid is True
# ])
try:

View File

@@ -12,7 +12,7 @@
from shapely.geometry import Point, Polygon, MultiPolygon, MultiLineString, LineString, LinearRing
from shapely.ops import cascaded_union
from shapely.ops import unary_union
from appParsers.ParseGerber import Gerber
from appObjects.FlatCAMObj import *
@@ -386,7 +386,7 @@ class GerberObject(FlatCAMObj, Gerber):
try:
self.solid_geometry = MultiPolygon(self.solid_geometry)
except Exception:
self.solid_geometry = cascaded_union(self.solid_geometry)
self.solid_geometry = unary_union(self.solid_geometry)
bounding_box = self.solid_geometry.envelope.buffer(float(self.options["noncoppermargin"]))
if not self.options["noncopperrounded"]:
@@ -412,7 +412,7 @@ class GerberObject(FlatCAMObj, Gerber):
try:
self.solid_geometry = MultiPolygon(self.solid_geometry)
except Exception:
self.solid_geometry = cascaded_union(self.solid_geometry)
self.solid_geometry = unary_union(self.solid_geometry)
# Bounding box with rounded corners
bounding_box = self.solid_geometry.envelope.buffer(float(self.options["bboxmargin"]))