From 6965c914470dd2c235372b2d153284b84a2e21e7 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 30 Jan 2022 14:13:36 +0200 Subject: [PATCH] - some more work on the Isolation plugin --- CHANGELOG.md | 3 ++- appPlugins/ToolIsolation.py | 23 +++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cd82a4d..3eef3f28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,12 @@ CHANGELOG for FlatCAM beta 30.01.2022 - refactored the Isolation Plugin class +- some more work on the Isolation plugin 29.01.2022 - upgraded/fixed the Panelize Tcl command -- added a new preprocessor for Marlin that has movemements on the Z axis named `Marlin_laser_Z` +- added a new preprocessor for Marlin that has movements on the Z axis named `Marlin_laser_Z` - cleaned up Marlin preprocessors - in the `panelize`, `cutout` and `geocutout` Tcl commands updated the error strings and made sure that if an error occur then a potential script execution in chain is aborted - updated the `new` Tcl command: now it has an argument `-keep_scripts` that when True, will keep the loaded scripts in the new project diff --git a/appPlugins/ToolIsolation.py b/appPlugins/ToolIsolation.py index d85ca7f3..ba2d9fb5 100644 --- a/appPlugins/ToolIsolation.py +++ b/appPlugins/ToolIsolation.py @@ -1739,13 +1739,21 @@ class ToolIsolation(AppTool, Gerber): :return: None """ + # use_combine: True/False use_combine = args['combine'] if 'combine' in args else self.ui.combine_passes_cb.get_value() + # use_iso_except: True/False use_iso_except = args['iso_except'] if 'iso_except' in args else self.ui.except_cb.get_value() + # use_extra_passes: True/False use_extra_passes = args['e_passes'] if 'e_passes' in args else self.ui.pad_passes_entry.get_value() + # use_area_exception: True/False use_area_exception = args['area_except'] if 'area_except' in args else self.ui.except_cb.get_value() + # sel_area_shape: ['square', 'polygon'] sel_area_shape = args['area_shape'] if 'area_shape' in args else self.ui.area_shape_radio.get_value() + # use_rest: True/False use_rest = args['rest'] if 'rest' in args else self.ui.rest_cb.get_value() + # selection_type: [_("All"), _("Area Selection"), _("Polygon Selection"), _("Reference Object")] selection_type = args['sel_type'] if 'sel_type' in args else self.ui.select_combo.get_value() + # tool_tip_shape: ["C1", "C2", "C3", "C4", "B", "V"] tool_tip_shape = args['tip_shape'] if 'tip_shape' in args else self.ui.tool_shape_combo.get_value() # update the Common Parameters values in the self.iso_tools @@ -1922,7 +1930,7 @@ class ToolIsolation(AppTool, Gerber): # clean the progressive plotted shapes if it was used - if prog_plot == 'progressive': + if plot and prog_plot == 'progressive': try: self.temp_shapes.clear(update=True) except Exception as err: @@ -2031,7 +2039,8 @@ class ToolIsolation(AppTool, Gerber): env_iso_type=iso_t, negative_dia=negative_dia, forced_rest=forced_rest, prog_plot=prog_plot, - prog_plot_handler=self.plot_temp_shapes) + prog_plot_handler=self.plot_temp_shapes, + plot=plot) # ############################################################ # ########## AREA SUBTRACTION ################################ @@ -2062,7 +2071,7 @@ class ToolIsolation(AppTool, Gerber): break # clean the progressive plotted shapes if it was used - if self.app.defaults["tools_iso_plotting"] == 'progressive': + if plot and self.app.defaults["tools_iso_plotting"] == 'progressive': self.temp_shapes.clear(update=True) # remove tools without geometry @@ -2270,7 +2279,7 @@ class ToolIsolation(AppTool, Gerber): total_solid_geometry += new_solid_geo # clean the progressive plotted shapes if it was used - if prog_plot == 'progressive': + if plot and prog_plot == 'progressive': try: self.temp_shapes.clear(update=True) except Exception as err: @@ -3102,7 +3111,7 @@ class ToolIsolation(AppTool, Gerber): @staticmethod def generate_rest_geometry(geometry, tooldia, passes, overlap, invert, env_iso_type=2, negative_dia=None, forced_rest=False, - prog_plot="normal", prog_plot_handler=None): + prog_plot="normal", prog_plot_handler=None, plot=False): """ Will try to isolate the geometry and return a tuple made of list of paths made through isolation and a list of Shapely Polygons that could not be isolated @@ -3127,6 +3136,8 @@ class ToolIsolation(AppTool, Gerber): :type prog_plot: str :param prog_plot_handler: method used to plot shapes if plot_prog is "proggressive" :type prog_plot_handler: + :param plot: If True plot + :type plot: bool :return: Tuple made from list of isolating paths and list of not isolated Polygons :rtype: tuple """ @@ -3194,7 +3205,7 @@ class ToolIsolation(AppTool, Gerber): break good_pass_iso.append(temp_geo) - if prog_plot == 'progressive': + if plot and prog_plot == 'progressive': prog_plot_handler(temp_geo) if good_pass_iso: