From e24b148e3abbb82fbdd11cb25d47738a095d24ff Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 14 Jun 2020 04:13:37 +0300 Subject: [PATCH] - fixed issue #428 - Cutout Tool -> Freeform geometry was not generated due of trying to get the bounds of the solid_geometry before it was available --- CHANGELOG.md | 1 + appTools/ToolCutOut.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b33211b..c4588e81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ CHANGELOG for FlatCAM beta - if clicking the activity icon in the status bar and there is no object selected then the effect will be a plot_all with fit_view - modified the FCLabel GUI element - NCC Tool - remade and optimized the copper clearing with rest machining: now it works as expected with a reasonable performance +- fixed issue #428 - Cutout Tool -> Freeform geometry was not generated due of trying to get the bounds of the solid_geometry before it was available 13.06.2020 diff --git a/appTools/ToolCutOut.py b/appTools/ToolCutOut.py index 64eb4349..ab7b8b2e 100644 --- a/appTools/ToolCutOut.py +++ b/appTools/ToolCutOut.py @@ -708,8 +708,9 @@ class CutOut(AppTool): solid_geo += cutout_handler(geom=geom_struct) - xmin, ymin, xmax, ymax = recursive_bounds(geo_obj.solid_geometry) geo_obj.solid_geometry = deepcopy(solid_geo) + xmin, ymin, xmax, ymax = recursive_bounds(geo_obj.solid_geometry) + geo_obj.options['xmin'] = xmin geo_obj.options['ymin'] = ymin geo_obj.options['xmax'] = xmax @@ -1428,6 +1429,7 @@ def recursive_bounds(geometry): return minx, miny, maxx, maxy except TypeError: # it's a Shapely object, return it's bounds - return obj.bounds + if obj: + return obj.bounds return bounds_rec(geometry)