From 7eeda0347f2929e31c52d6d34c91d794dfcd2767 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 27 Aug 2020 03:29:52 +0300 Subject: [PATCH] - in Tool Cutout fixed manual adding of gaps with thin gaps and plotting - in Tool Cutout, when using fix gaps made sure that this feature is not activated if the value is zero --- CHANGELOG.md | 2 ++ appTools/ToolCutOut.py | 17 +++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9567a2ca..3feb81bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ CHANGELOG for FlatCAM beta - fixed the Tcl commands AddCircle, AddPolygon, AddPolyline and AddRectangle to have stored bounds therefore making them movable/selectable on canvas - in Tool Cutout, when using the Thin Gaps feature, the resulting geometry loose the extra color by toggling tool plot in Geometry UI Tools Table- fixed +- in Tool Cutout fixed manual adding of gaps with thin gaps and plotting +- in Tool Cutout, when using fix gaps made sure that this feature is not activated if the value is zero 26.08.2020 diff --git a/appTools/ToolCutOut.py b/appTools/ToolCutOut.py index 49a989f0..89a08af9 100644 --- a/appTools/ToolCutOut.py +++ b/appTools/ToolCutOut.py @@ -432,7 +432,7 @@ class CutOut(AppTool): geo = object_geo solid_geo, rest_geo = cutout_handler(geom=geo) - if self.ui.thin_cb.get_value(): + if self.ui.thin_cb.get_value() and self.ui.thin_depth_entry.get_value() > 0: gaps_solid_geo = rest_geo else: try: @@ -450,7 +450,7 @@ class CutOut(AppTool): c_geo, r_geo = cutout_handler(geom=geom_struct) solid_geo += c_geo - if self.ui.thin_cb.get_value(): + if self.ui.thin_cb.get_value() and self.ui.thin_depth_entry.get_value() > 0: gaps_solid_geo += r_geo if not solid_geo: @@ -667,7 +667,7 @@ class CutOut(AppTool): solid_geo = cutout_rect_handler(geom=geo) - if self.ui.thin_cb.get_value(): + if self.ui.thin_cb.get_value() and self.ui.thin_depth_entry.get_value() > 0: gaps_solid_geo = self.subtract_geo(geo, solid_geo) else: if cutout_obj.kind == 'geometry': @@ -683,7 +683,7 @@ class CutOut(AppTool): c_geo = cutout_rect_handler(geom=geom_struct) solid_geo += c_geo - if self.ui.thin_cb.get_value(): + if self.ui.thin_cb.get_value() and self.ui.thin_depth_entry.get_value() > 0: try: gaps_solid_geo += self.subtract_geo(geom_struct, c_geo) except TypeError: @@ -703,7 +703,7 @@ class CutOut(AppTool): c_geo = cutout_rect_handler(geom=geom_struct) solid_geo += c_geo - if self.ui.thin_cb.get_value(): + if self.ui.thin_cb.get_value() and self.ui.thin_depth_entry.get_value() > 0: try: gaps_solid_geo += self.subtract_geo(geom_struct, c_geo) except TypeError: @@ -845,7 +845,9 @@ class CutOut(AppTool): cut_poly = self.cutting_geo(pos=(snapped_pos[0], snapped_pos[1])) - gaps_solid_geo = self.intersect_geo(self.manual_solid_geo, cut_poly) + gaps_solid_geo = None + if self.ui.thin_cb.get_value() and self.ui.thin_depth_entry.get_value() > 0: + gaps_solid_geo = self.intersect_geo(self.manual_solid_geo, cut_poly) # first subtract geometry for the total solid_geometry new_solid_geometry = CutOut.subtract_geo(self.man_cutout_obj.solid_geometry, cut_poly) @@ -1060,6 +1062,9 @@ class CutOut(AppTool): # rebuild the manual Geometry object self.man_cutout_obj.build_ui() + # plot the final object + self.man_cutout_obj.plot() + def on_mouse_move(self, event): self.app.on_mouse_move_over_plot(event=event)