- added some geometry parameters in Cutout Tool as a convenience, to be passed to the generated Geometry objects

This commit is contained in:
Marius Stanciu
2019-12-03 23:44:53 +02:00
committed by Marius
parent 8d45f77085
commit b1547bf6b9
4 changed files with 113 additions and 36 deletions

View File

@@ -4187,7 +4187,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Cutout Tool Options")))
self.decimals = 4
# ## Board cuttout
# ## Board cutout
self.board_cutout_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.board_cutout_label.setToolTip(
_("Create toolpaths to cut around\n"
@@ -4199,33 +4199,77 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
tdclabel = QtWidgets.QLabel('%s:' % _('Tool dia'))
tdclabel = QtWidgets.QLabel('%s:' % _('Tool Diameter'))
tdclabel.setToolTip(
_("Diameter of the tool used to cutout\n"
"the PCB shape out of the surrounding material.")
)
grid0.addWidget(tdclabel, 0, 0)
self.cutout_tooldia_entry = FCDoubleSpinner()
self.cutout_tooldia_entry.set_range(0.000001, 9999.9999)
self.cutout_tooldia_entry.set_precision(self.decimals)
self.cutout_tooldia_entry.setSingleStep(0.1)
grid0.addWidget(tdclabel, 0, 0)
grid0.addWidget(self.cutout_tooldia_entry, 0, 1)
# Cut Z
cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z'))
cutzlabel.setToolTip(
_(
"Cutting depth (negative)\n"
"below the copper surface."
)
)
self.cutz_entry = FCDoubleSpinner()
self.cutz_entry.set_precision(self.decimals)
if machinist_setting == 0:
self.cutz_entry.setRange(-9999.9999, -0.00001)
else:
self.cutz_entry.setRange(-9999.9999, 9999.9999)
self.cutz_entry.setSingleStep(0.1)
grid0.addWidget(cutzlabel, 1, 0)
grid0.addWidget(self.cutz_entry, 1, 1)
# Multi-pass
self.mpass_cb = FCCheckBox('%s:' % _("Multi-Depth"))
self.mpass_cb.setToolTip(
_(
"Use multiple passes to limit\n"
"the cut depth in each pass. Will\n"
"cut multiple times until Cut Z is\n"
"reached."
)
)
self.maxdepth_entry = FCDoubleSpinner()
self.maxdepth_entry.set_precision(self.decimals)
self.maxdepth_entry.setRange(0, 9999.9999)
self.maxdepth_entry.setSingleStep(0.1)
self.maxdepth_entry.setToolTip(_("Depth of each pass (positive)."))
grid0.addWidget(self.mpass_cb, 2, 0)
grid0.addWidget(self.maxdepth_entry, 2, 1)
# Object kind
kindlabel = QtWidgets.QLabel('%s:' % _('Obj kind'))
kindlabel = QtWidgets.QLabel('%s:' % _('Object kind'))
kindlabel.setToolTip(
_("Choice of what kind the object we want to cutout is.<BR>"
"- <B>Single</B>: contain a single PCB Gerber outline object.<BR>"
"- <B>Panel</B>: a panel PCB Gerber object, which is made\n"
"out of many individual PCB outlines.")
)
grid0.addWidget(kindlabel, 1, 0)
self.obj_kind_combo = RadioSet([
{"label": _("Single"), "value": "single"},
{"label": _("Panel"), "value": "panel"},
])
grid0.addWidget(self.obj_kind_combo, 1, 1)
grid0.addWidget(kindlabel, 3, 0)
grid0.addWidget(self.obj_kind_combo, 3, 1)
marginlabel = QtWidgets.QLabel('%s:' % _('Margin'))
marginlabel.setToolTip(
@@ -4233,13 +4277,14 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
"will make the cutout of the PCB further from\n"
"the actual PCB border")
)
grid0.addWidget(marginlabel, 2, 0)
self.cutout_margin_entry = FCDoubleSpinner()
self.cutout_margin_entry.set_range(-9999.9999, 9999.9999)
self.cutout_margin_entry.set_precision(self.decimals)
self.cutout_margin_entry.setSingleStep(0.1)
grid0.addWidget(self.cutout_margin_entry, 2, 1)
grid0.addWidget(marginlabel, 4, 0)
grid0.addWidget(self.cutout_margin_entry, 4, 1)
gaplabel = QtWidgets.QLabel('%s:' % _('Gap size'))
gaplabel.setToolTip(
@@ -4248,13 +4293,14 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
"the surrounding material (the one \n"
"from which the PCB is cutout).")
)
grid0.addWidget(gaplabel, 3, 0)
self.cutout_gap_entry = FCDoubleSpinner()
self.cutout_gap_entry.set_range(0.000001, 9999.9999)
self.cutout_gap_entry.set_precision(self.decimals)
self.cutout_gap_entry.setSingleStep(0.1)
grid0.addWidget(self.cutout_gap_entry, 3, 1)
grid0.addWidget(gaplabel, 5, 0)
grid0.addWidget(self.cutout_gap_entry, 5, 1)
gaps_label = QtWidgets.QLabel('%s:' % _('Gaps'))
gaps_label.setToolTip(
@@ -4269,9 +4315,10 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
"- 2tb - 2*top + 2*bottom\n"
"- 8 - 2*left + 2*right +2*top + 2*bottom")
)
grid0.addWidget(gaps_label, 4, 0)
self.gaps_combo = FCComboBox()
grid0.addWidget(self.gaps_combo, 4, 1)
grid0.addWidget(gaps_label, 6, 0)
grid0.addWidget(self.gaps_combo, 6, 1)
gaps_items = ['None', 'LR', 'TB', '4', '2LR', '2TB', '8']
for it in gaps_items:
@@ -4285,8 +4332,8 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
_("Create a convex shape surrounding the entire PCB.\n"
"Used only if the source object type is Gerber.")
)
grid0.addWidget(self.convex_box_label, 5, 0)
grid0.addWidget(self.convex_box, 5, 1)
grid0.addWidget(self.convex_box_label, 7, 0)
grid0.addWidget(self.convex_box, 7, 1)
self.layout.addStretch()