Explorar el Código

- added protection so the Cutout (either Freeform or Rectangular) cannot be done on a multigeo Geometry

Marius Stanciu hace 7 años
padre
commit
e3d51c9da5
Se han modificado 2 ficheros con 13 adiciones y 0 borrados
  1. 1 0
      README.md
  2. 12 0
      flatcamTools/ToolCutout.py

+ 1 - 0
README.md

@@ -21,6 +21,7 @@ CAD program, and create G-Code for Isolation routing.
 - more changes in Edit -> Preferences -> Geometry, Gerber and in CNCJob
 - more changes in Edit -> Preferences -> Geometry, Gerber and in CNCJob
 - added new option for Cutout Tool Freeform Gaps in Edit -> Preferences -> Tools
 - added new option for Cutout Tool Freeform Gaps in Edit -> Preferences -> Tools
 - fixed Freeform Cutout gaps issue (it was double than the value set)
 - fixed Freeform Cutout gaps issue (it was double than the value set)
+- added protection so the Cutout (either Freeform or Rectangular) cannot be done on a multigeo Geometry
 
 
 28.01.2018
 28.01.2018
 
 

+ 12 - 0
flatcamTools/ToolCutout.py

@@ -253,6 +253,12 @@ class ToolCutout(FlatCAMTool):
                                  "Fill in a correct value and retry. ")
                                  "Fill in a correct value and retry. ")
             return
             return
 
 
+        if cutout_obj.multigeo is True:
+            self.app.inform.emit("[error]Cutout operation cannot be done on a multi-geo Geometry.\n"
+                                 "Optionally, this Multi-geo Geometry can be converted to Single-geo Geometry,\n"
+                                 "and after that perform Cutout.")
+            return
+
         # Get min and max data for each object as we just cut rectangles across X or Y
         # Get min and max data for each object as we just cut rectangles across X or Y
         xmin, ymin, xmax, ymax = cutout_obj.bounds()
         xmin, ymin, xmax, ymax = cutout_obj.bounds()
         px = 0.5 * (xmin + xmax) + margin
         px = 0.5 * (xmin + xmax) + margin
@@ -363,6 +369,12 @@ class ToolCutout(FlatCAMTool):
             self.app.inform.emit("[error_notcl]Tool Diameter is zero value. Change it to a positive integer.")
             self.app.inform.emit("[error_notcl]Tool Diameter is zero value. Change it to a positive integer.")
             return "Tool Diameter is zero value. Change it to a positive integer."
             return "Tool Diameter is zero value. Change it to a positive integer."
 
 
+        if cutout_obj.multigeo is True:
+            self.app.inform.emit("[error]Cutout operation cannot be done on a multi-geo Geometry.\n"
+                                 "Optionally, this Multi-geo Geometry can be converted to Single-geo Geometry,\n"
+                                 "and after that perform Cutout.")
+            return
+
         def geo_init(geo_obj, app_obj):
         def geo_init(geo_obj, app_obj):
             real_margin = margin + (dia / 2)
             real_margin = margin + (dia / 2)
             real_gap_size = gapsize + dia
             real_gap_size = gapsize + dia