Procházet zdrojové kódy

- 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

Marius Stanciu před 5 roky
rodič
revize
e24b148e3a
2 změnil soubory, kde provedl 5 přidání a 2 odebrání
  1. 1 0
      CHANGELOG.md
  2. 4 2
      appTools/ToolCutOut.py

+ 1 - 0
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
 

+ 4 - 2
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)