From 7635687d30fa41d4e845eca59d8548124001cca2 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 28 Feb 2019 04:22:52 +0200 Subject: [PATCH] - upgraded the Tool Cutout when done from Gerber file to create a convex_hull around the Gerber file rather than trying to isolate it --- README.md | 2 +- flatcamTools/ToolCutOut.py | 20 +++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index c81f3ef9..065c6ea5 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ CAD program, and create G-Code for Isolation routing. - added some parameters throughout camlib gcode generation functions; handled some possible errors (e.g like when attempting to use an empty Custom GCode Toolchange) - added toggle effect for the tools in the toolbar. - enhanced the toggle effect for the tools in the Tools Toolbar and also for Notebook Tab selection: if the current tool is activated it will toggle the notebook side but only if the installed widget is itself. If coming from another tool, the notebook will stay visible -- +- upgraded the Tool Cutout when done from Gerber file to create a convex_hull around the Gerber file rather than trying to isolate it 26.02.2019 diff --git a/flatcamTools/ToolCutOut.py b/flatcamTools/ToolCutOut.py index 10340ced..dcfc9b0c 100644 --- a/flatcamTools/ToolCutOut.py +++ b/flatcamTools/ToolCutOut.py @@ -200,9 +200,11 @@ class CutOut(FlatCAMTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) else: - if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName: - self.app.ui.splitter.setSizes([0, 1]) - + try: + if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName: + self.app.ui.splitter.setSizes([0, 1]) + except AttributeError: + pass FlatCAMTool.run(self) self.set_tool_ui() @@ -306,21 +308,13 @@ class CutOut(FlatCAMTool): # rename the obj name so it can be identified as cutout cutout_obj.options["name"] += "_cutout" else: - cutout_obj.isolate(dia=dia, passes=1, overlap=1, combine=False, outname="_temp") - ext_obj = self.app.collection.get_by_name("_temp") - def geo_init(geo_obj, app_obj): - geo_obj.solid_geometry = obj_exteriors + geo = cutout_obj.solid_geometry.convex_hull + geo_obj.solid_geometry = geo.buffer(margin + abs(dia / 2)) outname = cutout_obj.options["name"] + "_cutout" - - obj_exteriors = ext_obj.get_exteriors() self.app.new_object('geometry', outname, geo_init) - self.app.collection.set_all_inactive() - self.app.collection.set_active("_temp") - self.app.on_delete() - cutout_obj = self.app.collection.get_by_name(outname) if gaps == '8' or gaps == '2LR':