From e39dbeb5a1b56a03da9f75396af02288cd2cb959 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Tue, 20 Feb 2024 03:20:21 +0200 Subject: [PATCH] - Punch Gerber Plugin: fixed issues with iterating ovr a MultiPolygon - GerberObject: fixed Gerber merging functionality --- CHANGELOG.md | 5 +++++ appMain.py | 6 ++++-- appObjects/GerberObject.py | 4 ++-- appPlugins/ToolPunchGerber.py | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ceacac6..63688553 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ CHANGELOG for FlatCAM Evo beta ================================================= +20.02.2024 + +- Punch Gerber Plugin: fixed issues with iterating ovr a MultiPolygon +- GerberObject: fixed Gerber merging functionality + 11.01.2024 - Paint Plugin: fixed an issue where a Gerber object cannot be painted using the Single Polygon selection correctly because it painted the whole geometry diff --git a/appMain.py b/appMain.py index 4df01872..123b2c12 100644 --- a/appMain.py +++ b/appMain.py @@ -279,6 +279,7 @@ class App(QtCore.QObject): # post-Edit actions post_edit_sig = pyqtSignal() + # noinspection PyUnresolvedReferences def __init__(self, qapp, user_defaults=True): """ Starts the application. @@ -1616,7 +1617,7 @@ class App(QtCore.QObject): """ if init_tcl: - # Tcl Shell tool has to be initialized always first because other tools print messages in the Shell Dock + # Tcl "Shell" tool has to be initialized always first because other tools print messages in the Shell Dock self.shell = FCShell(app=self, version=self.version) self.log.debug("TCL was re-instantiated. TCL variables are reset.") @@ -1837,7 +1838,7 @@ class App(QtCore.QObject): # first remove all of them self.remove_tools() - # re-add the TCL Shell action to the Tools menu and reconnect it to ist slot function + # re-add the TCL "Shell" action to the Tools menu and reconnect it to ist slot function self.ui.menu_plugins_shell = self.ui.menu_plugins.addAction( QtGui.QIcon(self.resource_location + '/shell16.png'), '&Command Line\tS') self.ui.menu_plugins_shell.triggered.connect(self.ui.toggle_shell_ui) @@ -2939,6 +2940,7 @@ class App(QtCore.QObject): beta = self.beta class AboutDialog(QtWidgets.QDialog): + # noinspection PyUnresolvedReferences def __init__(self, app, parent): QtWidgets.QDialog.__init__(self, parent=parent) diff --git a/appObjects/GerberObject.py b/appObjects/GerberObject.py index d475621e..703b56bf 100644 --- a/appObjects/GerberObject.py +++ b/appObjects/GerberObject.py @@ -1720,8 +1720,8 @@ class GerberObject(FlatCAMObj, Gerber): for k, v in grb.tools[ap].items(): grb_final.tools[max_ap][k] = deepcopy(v) - grb_final.solid_geometry = MultiPolygon(grb_final.solid_geometry) - grb_final.follow_geometry = MultiPolygon(grb_final.follow_geometry) + grb_final.solid_geometry = unary_union(flatten_shapely_geometry(grb_final.solid_geometry)) + grb_final.follow_geometry = unary_union(flatten_shapely_geometry(grb_final.follow_geometry)) def mirror(self, axis, point): Gerber.mirror(self, axis=axis, point=point) diff --git a/appPlugins/ToolPunchGerber.py b/appPlugins/ToolPunchGerber.py index 263d2bd8..5e40d38d 100644 --- a/appPlugins/ToolPunchGerber.py +++ b/appPlugins/ToolPunchGerber.py @@ -929,7 +929,7 @@ class ToolPunchGerber(AppTool, Gerber): for elem in val['geometry']: # make it work only for Gerber Flashes who are Points in 'follow' if 'solid' in elem and isinstance(elem['follow'], Point): - for geo in punching_geo: + for geo in punching_geo.geoms: clear_apid_size = punch_size # since there may be drills that do not drill into a pad we test only for drills in a pad