From 5b10e9faf0e0d0a7d7b9004cca88ccdfb3091d3f Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 1 Mar 2020 19:23:06 +0200 Subject: [PATCH] - updated the CutOut Tool such that while adding manual gaps, the cutting geometry is updated on-the-fly if the gap size or tool diameter parameters are adjusted --- README.md | 4 ++++ flatcamTools/ToolCutOut.py | 11 +++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3ebe0a9e..11b4b213 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing. ================================================= +01.03.2020 + +- updated the CutOut Tool such that while adding manual gaps, the cutting geometry is updated on-the-fly if the gap size or tool diameter parameters are adjusted + 29.02.2020 - compacted the NCC Tool UI by replacing some Radio buttons with Combo boxes due of too many elements diff --git a/flatcamTools/ToolCutOut.py b/flatcamTools/ToolCutOut.py index 0033d149..38f4ae7c 100644 --- a/flatcamTools/ToolCutOut.py +++ b/flatcamTools/ToolCutOut.py @@ -532,8 +532,8 @@ class CutOut(FlatCAMTool): object_geo = cutout_obj.solid_geometry.convex_hull else: object_geo = cutout_obj.solid_geometry - except Exception as e: - log.debug("CutOut.on_freeform_cutout().geo_init() --> %s" % str(e)) + except Exception as err: + log.debug("CutOut.on_freeform_cutout().geo_init() --> %s" % str(err)) else: object_geo = cutout_obj.solid_geometry @@ -939,6 +939,9 @@ class CutOut(FlatCAMTool): self.app.new_object('geometry', outname, geo_init) def cutting_geo(self, pos): + self.cutting_dia = float(self.dia.get_value()) + self.cutting_gapsize = float(self.gapsize.get_value()) + offset = self.cutting_dia / 2 + self.cutting_gapsize / 2 # cutting area definition @@ -1034,7 +1037,7 @@ class CutOut(FlatCAMTool): except TypeError: return - if self.app.grid_status() == True: + if self.app.grid_status(): snap_x, snap_y = self.app.geo_editor.snap(x, y) else: snap_x, snap_y = x, y @@ -1064,7 +1067,7 @@ class CutOut(FlatCAMTool): else: radian = math.atan(dx / dy) angle = radian * 180 / math.pi - except Exception as e: + except Exception: angle = 0 return angle