From 01a9763ad6803f1448834862d6f9950e83670814 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Fri, 4 Oct 2019 20:43:22 +0300 Subject: [PATCH] - in Gerber isolation section, the tool dia value is updated when changing from Circular to V-shape and reverse - in Tool Film, when punching holes in a positive film, if the resulting object geometry is the same as the source object geometry, the film will not ge generated --- FlatCAMObj.py | 4 ++++ README.md | 2 ++ flatcamTools/ToolFilm.py | 14 ++++++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/FlatCAMObj.py b/FlatCAMObj.py index 2027aebc..fae047ad 100644 --- a/FlatCAMObj.py +++ b/FlatCAMObj.py @@ -727,6 +727,8 @@ class FlatCAMGerber(FlatCAMObj, Gerber): self.ui.cutzlabel.hide() self.ui.cutz_spinner.hide() self.ui.iso_tool_dia_entry.setDisabled(False) + # update the value in the self.iso_tool_dia_entry once this is selected + self.ui.iso_tool_dia_entry.set_value(self.options['isotooldia']) else: self.ui.tipdialabel.show() self.ui.tipdia_spinner.show() @@ -735,6 +737,8 @@ class FlatCAMGerber(FlatCAMObj, Gerber): self.ui.cutzlabel.show() self.ui.cutz_spinner.show() self.ui.iso_tool_dia_entry.setDisabled(True) + # update the value in the self.iso_tool_dia_entry once this is selected + self.on_calculate_tooldia() def build_ui(self): FlatCAMObj.build_ui(self) diff --git a/README.md b/README.md index 77566c55..be7dcc8f 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ CAD program, and create G-Code for Isolation routing. - added a new menu category in the MenuBar named 'Objects'. It will hold the objects found in the Project tab. Useful when working in FullScreen - disabeld a log.debug in ObjectColection.get_by_name() - added a Toggle Notebook button named 'NB' in the QMenBar which toggle the notebook +- in Gerber isolation section, the tool dia value is updated when changing from Circular to V-shape and reverse +- in Tool Film, when punching holes in a positive film, if the resulting object geometry is the same as the source object geometry, the film will not ge generated 3.10.2019 diff --git a/flatcamTools/ToolFilm.py b/flatcamTools/ToolFilm.py index d0eec5d5..b1dcaf49 100644 --- a/flatcamTools/ToolFilm.py +++ b/flatcamTools/ToolFilm.py @@ -440,7 +440,7 @@ class Film(FlatCAMTool): if punch_size >= float(film_obj.apertures[apid]['width']) or \ punch_size >= float(film_obj.apertures[apid]['height']): self.app.inform.emit('[ERROR_NOTCL] %s' % - _(" Could not generate punched hole film because the punch hole size" + _("Could not generate punched hole film because the punch hole size" "is bigger than some of the apertures in the Gerber object.")) return 'fail' else: @@ -450,7 +450,17 @@ class Film(FlatCAMTool): punching_geo.append(elem['follow'].buffer(punch_size / 2)) punching_geo = MultiPolygon(punching_geo) - punched_solid_geometry = MultiPolygon(film_obj.solid_geometry).difference(punching_geo) + if not isinstance(film_obj.solid_geometry, Polygon): + temp_solid_geometry = MultiPolygon(film_obj.solid_geometry) + else: + temp_solid_geometry = film_obj.solid_geometry + punched_solid_geometry = temp_solid_geometry.difference(punching_geo) + + if punched_solid_geometry == temp_solid_geometry: + self.app.inform.emit('[WARNING_NOTCL] %s' % + _("Could not generate punched hole film because the newly created object geometry " + "is the same as the one in the source object geometry...")) + return 'fail' def init_func(new_obj, app_obj): new_obj.solid_geometry = deepcopy(punched_solid_geometry)