- some more work on the Isolation plugin
This commit is contained in:
@@ -10,11 +10,12 @@ CHANGELOG for FlatCAM beta
|
|||||||
30.01.2022
|
30.01.2022
|
||||||
|
|
||||||
- refactored the Isolation Plugin class
|
- refactored the Isolation Plugin class
|
||||||
|
- some more work on the Isolation plugin
|
||||||
|
|
||||||
29.01.2022
|
29.01.2022
|
||||||
|
|
||||||
- upgraded/fixed the Panelize Tcl command
|
- 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
|
- 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
|
- 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
|
- updated the `new` Tcl command: now it has an argument `-keep_scripts` that when True, will keep the loaded scripts in the new project
|
||||||
|
|||||||
@@ -1739,13 +1739,21 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# use_combine: True/False
|
||||||
use_combine = args['combine'] if 'combine' in args else self.ui.combine_passes_cb.get_value()
|
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_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_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()
|
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()
|
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()
|
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()
|
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()
|
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
|
# 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
|
# clean the progressive plotted shapes if it was used
|
||||||
|
|
||||||
if prog_plot == 'progressive':
|
if plot and prog_plot == 'progressive':
|
||||||
try:
|
try:
|
||||||
self.temp_shapes.clear(update=True)
|
self.temp_shapes.clear(update=True)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
@@ -2031,7 +2039,8 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
env_iso_type=iso_t, negative_dia=negative_dia,
|
env_iso_type=iso_t, negative_dia=negative_dia,
|
||||||
forced_rest=forced_rest,
|
forced_rest=forced_rest,
|
||||||
prog_plot=prog_plot,
|
prog_plot=prog_plot,
|
||||||
prog_plot_handler=self.plot_temp_shapes)
|
prog_plot_handler=self.plot_temp_shapes,
|
||||||
|
plot=plot)
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
# ########## AREA SUBTRACTION ################################
|
# ########## AREA SUBTRACTION ################################
|
||||||
@@ -2062,7 +2071,7 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
break
|
break
|
||||||
|
|
||||||
# clean the progressive plotted shapes if it was used
|
# 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)
|
self.temp_shapes.clear(update=True)
|
||||||
|
|
||||||
# remove tools without geometry
|
# remove tools without geometry
|
||||||
@@ -2270,7 +2279,7 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
total_solid_geometry += new_solid_geo
|
total_solid_geometry += new_solid_geo
|
||||||
|
|
||||||
# clean the progressive plotted shapes if it was used
|
# clean the progressive plotted shapes if it was used
|
||||||
if prog_plot == 'progressive':
|
if plot and prog_plot == 'progressive':
|
||||||
try:
|
try:
|
||||||
self.temp_shapes.clear(update=True)
|
self.temp_shapes.clear(update=True)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
@@ -3102,7 +3111,7 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def generate_rest_geometry(geometry, tooldia, passes, overlap, invert, env_iso_type=2, negative_dia=None,
|
def generate_rest_geometry(geometry, tooldia, passes, overlap, invert, env_iso_type=2, negative_dia=None,
|
||||||
forced_rest=False,
|
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
|
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
|
and a list of Shapely Polygons that could not be isolated
|
||||||
@@ -3127,6 +3136,8 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
:type prog_plot: str
|
:type prog_plot: str
|
||||||
:param prog_plot_handler: method used to plot shapes if plot_prog is "proggressive"
|
:param prog_plot_handler: method used to plot shapes if plot_prog is "proggressive"
|
||||||
:type prog_plot_handler:
|
: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
|
:return: Tuple made from list of isolating paths and list of not isolated Polygons
|
||||||
:rtype: tuple
|
:rtype: tuple
|
||||||
"""
|
"""
|
||||||
@@ -3194,7 +3205,7 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
break
|
break
|
||||||
|
|
||||||
good_pass_iso.append(temp_geo)
|
good_pass_iso.append(temp_geo)
|
||||||
if prog_plot == 'progressive':
|
if plot and prog_plot == 'progressive':
|
||||||
prog_plot_handler(temp_geo)
|
prog_plot_handler(temp_geo)
|
||||||
|
|
||||||
if good_pass_iso:
|
if good_pass_iso:
|
||||||
|
|||||||
Reference in New Issue
Block a user