From acc61d460b75799a57d3d616a450edf192334984 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sat, 29 Feb 2020 22:21:09 +0200 Subject: [PATCH] - fixed error in CutOut Tool when trying to create a FreeFrom Cutout out of a Gerber object with the Convex Shape checked --- README.md | 1 + flatcamGUI/PreferencesUI.py | 22 +++++++++++----------- flatcamTools/ToolCutOut.py | 16 +++++++++++----- flatcamTools/ToolNCC.py | 8 ++++---- flatcamTools/ToolPaint.py | 11 +++++------ 5 files changed, 32 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 28be59a2..9d3bab8c 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ CAD program, and create G-Code for Isolation routing. 29.02.2020 - compacted the NCC Tool UI by replacing some Radio buttons with Combo boxes due of too many elements +- fixed error in CutOut Tool when trying to create a FreeFrom Cutout out of a Gerber object with the Convex Shape checked 28.02.2020 diff --git a/flatcamGUI/PreferencesUI.py b/flatcamGUI/PreferencesUI.py index 7d6767cd..89dcbfd0 100644 --- a/flatcamGUI/PreferencesUI.py +++ b/flatcamGUI/PreferencesUI.py @@ -5407,12 +5407,12 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): self.select_combo.addItems( [_("Itself"), _("Area Selection"), _("Reference Object")] ) - select_label = QtWidgets.QLabel('%s:' % _("Reference")) + select_label = QtWidgets.QLabel('%s:' % _("Selection")) select_label.setToolTip( - _("Selection of area to be cleared of copper." - "- 'Itself' - the non copper clearing extent is based on the object that is copper cleared.\n " - "- 'Area Selection' - left mouse click to start selection of the area to be painted.\n" - "- 'Reference Object' - will do non copper clearing within the area specified by another object.") + _("Selection of area to be processed.\n" + "- 'Itself' - the processing extent is based on the object that is processed.\n " + "- 'Area Selection' - left mouse click to start selection of the area to be processed.\n" + "- 'Reference Object' - will process the area specified by another object.") ) grid0.addWidget(select_label, 18, 0) @@ -5905,14 +5905,14 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): # Polygon selection selectlabel = QtWidgets.QLabel('%s:' % _('Selection')) selectlabel.setToolTip( - _("How to select Polygons to be painted.\n" - "- 'Polygon Selection' - left mouse click to add/remove polygons to be painted.\n" - "- 'Area Selection' - left mouse click to start selection of the area to be painted.\n" + _("Selection of area to be processed.\n" + "- 'Polygon Selection' - left mouse click to add/remove polygons to be processed.\n" + "- 'Area Selection' - left mouse click to start selection of the area to be processed.\n" "Keeping a modifier key pressed (CTRL or SHIFT) will allow to add multiple areas.\n" - "- 'All Polygons' - the Paint will start after click.\n" - "- 'Reference Object' - will do non copper clearing within the area\n" - "specified by another object.") + "- 'All Polygons' - the process will start after click.\n" + "- 'Reference Object' - will process the area specified by another object.") ) + # self.selectmethod_combo = RadioSet( # [ # {"label": _("Polygon Selection"), "value": "single"}, diff --git a/flatcamTools/ToolCutOut.py b/flatcamTools/ToolCutOut.py index 32e799b1..87ebafc3 100644 --- a/flatcamTools/ToolCutOut.py +++ b/flatcamTools/ToolCutOut.py @@ -521,13 +521,19 @@ class CutOut(FlatCAMTool): gapsize = gapsize / 2 + (dia / 2) def geo_init(geo_obj, app_obj): - solid_geo = [] + solid_geo = list() if isinstance(cutout_obj, FlatCAMGerber): - if convex_box: - object_geo = cutout_obj.solid_geometry.convex_hull - else: - object_geo = cutout_obj.solid_geometry + if isinstance(cutout_obj.solid_geometry, list): + cutout_obj.solid_geometry = MultiPolygon(cutout_obj.solid_geometry) + + try: + if convex_box: + 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)) else: object_geo = cutout_obj.solid_geometry diff --git a/flatcamTools/ToolNCC.py b/flatcamTools/ToolNCC.py index 9caddcc3..021788eb 100644 --- a/flatcamTools/ToolNCC.py +++ b/flatcamTools/ToolNCC.py @@ -534,10 +534,10 @@ class NonCopperClear(FlatCAMTool, Gerber): self.select_label = QtWidgets.QLabel('%s:' % _("Selection")) self.select_label.setToolTip( - _("Selection of area to be cleared of copper." - "- 'Itself' - the non copper clearing extent is based on the object that is copper cleared.\n " - "- 'Area Selection' - left mouse click to start selection of the area to be painted.\n" - "- 'Reference Object' - will do non copper clearing within the area specified by another object.") + _("Selection of area to be processed.\n" + "- 'Itself' - the processing extent is based on the object that is processed.\n " + "- 'Area Selection' - left mouse click to start selection of the area to be processed.\n" + "- 'Reference Object' - will process the area specified by another object.") ) self.grid3.addWidget(self.select_label, 26, 0,) self.grid3.addWidget(self.select_combo, 26, 1) diff --git a/flatcamTools/ToolPaint.py b/flatcamTools/ToolPaint.py index 310a6208..8cb957b9 100644 --- a/flatcamTools/ToolPaint.py +++ b/flatcamTools/ToolPaint.py @@ -453,13 +453,12 @@ class ToolPaint(FlatCAMTool, Gerber): # Polygon selection selectlabel = QtWidgets.QLabel('%s:' % _('Selection')) selectlabel.setToolTip( - _("How to select Polygons to be painted.\n" - "- 'Polygon Selection' - left mouse click to add/remove polygons to be painted.\n" - "- 'Area Selection' - left mouse click to start selection of the area to be painted.\n" + _("Selection of area to be processed.\n" + "- 'Polygon Selection' - left mouse click to add/remove polygons to be processed.\n" + "- 'Area Selection' - left mouse click to start selection of the area to be processed.\n" "Keeping a modifier key pressed (CTRL or SHIFT) will allow to add multiple areas.\n" - "- 'All Polygons' - the Paint will start after click.\n" - "- 'Reference Object' - will do non copper clearing within the area\n" - "specified by another object.") + "- 'All Polygons' - the process will start after click.\n" + "- 'Reference Object' - will process the area specified by another object.") ) # grid3 = QtWidgets.QGridLayout()