From b444e1e5529650cab0a23ed20145da5c79803863 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Tue, 1 Oct 2019 15:32:31 +0300 Subject: [PATCH] - added new settings for the Gerber newly introduced feature to isolate with the V-Shape tools (tip dia, tip angle, tool_type and cut Z) in Edit -> Preferences -> Gerber Advanced --- FlatCAMApp.py | 9 ++++ FlatCAMObj.py | 8 ++++ README.md | 3 +- flatcamGUI/ObjectUI.py | 3 ++ flatcamGUI/PreferencesUI.py | 95 ++++++++++++++++++++++++------------- 5 files changed, 85 insertions(+), 33 deletions(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index dfa46455..8a5e7e55 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -519,6 +519,11 @@ class App(QtCore.QObject): # "gerber_aperture_scale_factor": self.ui.gerber_defaults_form.gerber_adv_opt_group.scale_aperture_entry, # "gerber_aperture_buffer_factor": self.ui.gerber_defaults_form.gerber_adv_opt_group.buffer_aperture_entry, "gerber_follow": self.ui.gerber_defaults_form.gerber_adv_opt_group.follow_cb, + "gerber_tool_type": self.ui.gerber_defaults_form.gerber_adv_opt_group.tool_type_radio, + "gerber_vtipdia": self.ui.gerber_defaults_form.gerber_adv_opt_group.tipdia_spinner, + "gerber_vtipangle": self.ui.gerber_defaults_form.gerber_adv_opt_group.tipangle_spinner, + "gerber_vcutz": self.ui.gerber_defaults_form.gerber_adv_opt_group.cutz_spinner, + "gerber_buffering": self.ui.gerber_defaults_form.gerber_adv_opt_group.buffering_radio, "gerber_simplification": self.ui.gerber_defaults_form.gerber_adv_opt_group.simplify_cb, "gerber_simp_tolerance": self.ui.gerber_defaults_form.gerber_adv_opt_group.simplification_tol_spinner, @@ -943,6 +948,10 @@ class App(QtCore.QObject): "gerber_aperture_scale_factor": 1.0, "gerber_aperture_buffer_factor": 0.0, "gerber_follow": False, + "gerber_tool_type": 'circular', + "gerber_vtipdia": 0.1, + "gerber_vtipangle": 30, + "gerber_vcutz": -0.05, "gerber_buffering": "full", "gerber_simplification": False, "gerber_simp_tolerance": 0.0005, diff --git a/FlatCAMObj.py b/FlatCAMObj.py index 5668700b..3a535b26 100644 --- a/FlatCAMObj.py +++ b/FlatCAMObj.py @@ -520,6 +520,10 @@ class FlatCAMGerber(FlatCAMObj, Gerber): "plot": True, "multicolored": False, "solid": False, + "tool_type": 'circular', + "vtipdia": 0.1, + "vtipangle": 30, + "vcutz": -0.05, "isotooldia": 0.016, "isopasses": 1, "isooverlap": 0.15, @@ -581,6 +585,10 @@ class FlatCAMGerber(FlatCAMObj, Gerber): "plot": self.ui.plot_cb, "multicolored": self.ui.multicolored_cb, "solid": self.ui.solid_cb, + "tool_type": self.ui.tool_type_radio, + "vtipdia": self.ui.tipdia_spinner, + "vtipangle": self.ui.tipangle_spinner, + "vcutz": self.ui.cutz_spinner, "isotooldia": self.ui.iso_tool_dia_entry, "isopasses": self.ui.iso_width_entry, "isooverlap": self.ui.iso_overlap_entry, diff --git a/README.md b/README.md index eb4da546..68a356d0 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,10 @@ CAD program, and create G-Code for Isolation routing. - fixed the FCSpinner and FCDoubleSpinner GUI elements to select all on first click and deselect on second click in the Spinbox LineEdit - for Gerber object in Selected Tab added ability to chose a V-Shape tool and therefore control the isolation better by adjusting the cut width of the isolation in function of the cut depth, tip width of the tool and the tip angle of the tool -- when in Gerber UI is selected the V-Shape tool, all those parameters (tip dia, dip angle, tool_type = 'V' and cut Z) are transferred to the generated Geometry and prefilled in the Geoemtry UI +- when in Gerber UI is selected the V-Shape tool, all those parameters (tip dia, tip angle, tool_type = 'V' and cut Z) are transferred to the generated Geometry and prefilled in the Geoemtry UI - added a fix in the Gerber parser to work even when there is no information about zero suppression in the Gerber file - added new settings in Edit -> Preferences -> Gerber for Gerber Units and Gerber Zeros to be used as defaults in case that those informations are missing from the Gerber file +- added new settings for the Gerber newly introduced feature to isolate with the V-Shape tools (tip dia, tip angle, tool_type and cut Z) in Edit -> Preferences -> Gerber Advanced 30.09.2019 diff --git a/flatcamGUI/ObjectUI.py b/flatcamGUI/ObjectUI.py index 3a5793a6..a778394b 100644 --- a/flatcamGUI/ObjectUI.py +++ b/flatcamGUI/ObjectUI.py @@ -313,6 +313,7 @@ class GerberObjectUI(ObjectUI): grid1.addWidget(self.cutzlabel, 3, 0) grid1.addWidget(self.cutz_spinner, 3, 1, 1, 2) + # Tool diameter tdlabel = QtWidgets.QLabel('%s:' % _('Tool dia')) tdlabel.setToolTip( _("Diameter of the cutting tool.\n" @@ -326,6 +327,7 @@ class GerberObjectUI(ObjectUI): grid1.addWidget(tdlabel, 4, 0) grid1.addWidget(self.iso_tool_dia_entry, 4, 1, 1, 2) + # Number of Passes passlabel = QtWidgets.QLabel('%s:' % _('# Passes')) passlabel.setToolTip( _("Width of the isolation gap in\n" @@ -337,6 +339,7 @@ class GerberObjectUI(ObjectUI): grid1.addWidget(passlabel, 5, 0) grid1.addWidget(self.iso_width_entry, 5, 1, 1, 2) + # Pass overlap overlabel = QtWidgets.QLabel('%s:' % _('Pass overlap')) overlabel.setToolTip( _("How much (fraction) of the tool width to overlap each tool pass.\n" diff --git a/flatcamGUI/PreferencesUI.py b/flatcamGUI/PreferencesUI.py index 93ede36d..e7c2c234 100644 --- a/flatcamGUI/PreferencesUI.py +++ b/flatcamGUI/PreferencesUI.py @@ -1340,6 +1340,58 @@ class GerberAdvOptPrefGroupUI(OptionsGroupUI): ) grid0.addWidget(self.aperture_table_visibility_cb, 1, 0, 1, 2) + # Tool Type + self.tool_type_label = QtWidgets.QLabel('%s' % _('Tool Type')) + self.tool_type_label.setToolTip( + _("Choose what tool to use for Gerber isolation:\n" + "'Circular' or 'V-shape'.\n" + "When the 'V-shape' is selected then the tool\n" + "diameter will depend on the chosen cut depth.") + ) + self.tool_type_radio = RadioSet([{'label': 'Circular', 'value': 'circular'}, + {'label': 'V-Shape', 'value': 'v'}]) + + grid0.addWidget(self.tool_type_label, 2, 0) + grid0.addWidget(self.tool_type_radio, 2, 1, 1, 2) + + # Tip Dia + self.tipdialabel = QtWidgets.QLabel('%s:' % _('V-Tip Dia')) + self.tipdialabel.setToolTip( + _("The tip diameter for V-Shape Tool") + ) + self.tipdia_spinner = FCDoubleSpinner() + self.tipdia_spinner.set_range(-99.9999, 99.9999) + self.tipdia_spinner.setSingleStep(0.1) + self.tipdia_spinner.setWrapping(True) + grid0.addWidget(self.tipdialabel, 3, 0) + grid0.addWidget(self.tipdia_spinner, 3, 1, 1, 2) + + # Tip Angle + self.tipanglelabel = QtWidgets.QLabel('%s:' % _('V-Tip Angle')) + self.tipanglelabel.setToolTip( + _("The tip angle for V-Shape Tool.\n" + "In degree.") + ) + self.tipangle_spinner = FCSpinner() + self.tipangle_spinner.set_range(0, 180) + self.tipangle_spinner.setSingleStep(5) + self.tipangle_spinner.setWrapping(True) + grid0.addWidget(self.tipanglelabel, 4, 0) + grid0.addWidget(self.tipangle_spinner, 4, 1, 1, 2) + + # Cut Z + self.cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z')) + self.cutzlabel.setToolTip( + _("Cutting depth (negative)\n" + "below the copper surface.") + ) + self.cutz_spinner = FCDoubleSpinner() + self.cutz_spinner.set_range(-99.9999, -0.0001) + self.cutz_spinner.setSingleStep(0.1) + self.cutz_spinner.setWrapping(True) + grid0.addWidget(self.cutzlabel, 5, 0) + grid0.addWidget(self.cutz_spinner, 5, 1, 1, 2) + # Buffering Type buffering_label = QtWidgets.QLabel('%s:' % _('Buffering')) buffering_label.setToolTip( @@ -1350,18 +1402,21 @@ class GerberAdvOptPrefGroupUI(OptionsGroupUI): ) self.buffering_radio = RadioSet([{'label': _('None'), 'value': 'no'}, {'label': _('Full'), 'value': 'full'}]) - grid0.addWidget(buffering_label, 2, 0) - grid0.addWidget(self.buffering_radio, 2, 1) + grid0.addWidget(buffering_label, 6, 0) + grid0.addWidget(self.buffering_radio, 6, 1) # Simplification self.simplify_cb = FCCheckBox(label=_('Simplify')) - self.simplify_cb.setToolTip(_("When checked all the Gerber polygons will be\n" - "loaded with simplification having a set tolerance.")) - grid0.addWidget(self.simplify_cb, 3, 0, 1, 2) + self.simplify_cb.setToolTip( + _("When checked all the Gerber polygons will be\n" + "loaded with simplification having a set tolerance.\n" + "<>: Don't change this unless you know what you are doing !!!") + ) + grid0.addWidget(self.simplify_cb, 7, 0, 1, 2) # Simplification tolerance self.simplification_tol_label = QtWidgets.QLabel(_('Tolerance')) - self.simplification_tol_label.setToolTip(_("Tolerance for poligon simplification.")) + self.simplification_tol_label.setToolTip(_("Tolerance for polygon simplification.")) self.simplification_tol_spinner = FCDoubleSpinner() self.simplification_tol_spinner.set_precision(5) @@ -1369,36 +1424,12 @@ class GerberAdvOptPrefGroupUI(OptionsGroupUI): self.simplification_tol_spinner.setRange(0.00000, 0.01000) self.simplification_tol_spinner.setSingleStep(0.0001) - grid0.addWidget(self.simplification_tol_label, 4, 0) - grid0.addWidget(self.simplification_tol_spinner, 4, 1) + grid0.addWidget(self.simplification_tol_label, 8, 0) + grid0.addWidget(self.simplification_tol_spinner, 8, 1) self.ois_simplif = OptionalInputSection(self.simplify_cb, [self.simplification_tol_label, self.simplification_tol_spinner], logic=True) - # Scale Aperture Factor - # self.scale_aperture_label = QtWidgets.QLabel(_('Ap. Scale Factor:')) - # self.scale_aperture_label.setToolTip( - # _("Change the size of the selected apertures.\n" - # "Factor by which to multiply\n" - # "geometric features of this object.") - # ) - # grid0.addWidget(self.scale_aperture_label, 2, 0) - # - # self.scale_aperture_entry = FloatEntry2() - # grid0.addWidget(self.scale_aperture_entry, 2, 1) - - # Buffer Aperture Factor - # self.buffer_aperture_label = QtWidgets.QLabel(_('Ap. Buffer Factor:')) - # self.buffer_aperture_label.setToolTip( - # _("Change the size of the selected apertures.\n" - # "Factor by which to expand/shrink\n" - # "geometric features of this object.") - # ) - # grid0.addWidget(self.buffer_aperture_label, 3, 0) - # - # self.buffer_aperture_entry = FloatEntry2() - # grid0.addWidget(self.buffer_aperture_entry, 3, 1) - self.layout.addStretch()