- in Tool Cutout tool I've added the possibility to create a cutout without bridge gaps; added the 'None' option in the Gaps combobox

This commit is contained in:
Marius Stanciu
2019-08-23 02:38:42 +03:00
committed by Marius
parent 211a7e4f6f
commit f087c242f3
3 changed files with 86 additions and 76 deletions

View File

@@ -12,6 +12,7 @@ CAD program, and create G-Code for Isolation routing.
23.08.2019 23.08.2019
- in Tool Cutout for the manual gaps, right mouse button click will exit from the action of adding gaps - in Tool Cutout for the manual gaps, right mouse button click will exit from the action of adding gaps
- in Tool Cutout tool I've added the possibility to create a cutout without bridge gaps; added the 'None' option in the Gaps combobox
22.08.2019 22.08.2019

View File

@@ -6567,9 +6567,10 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
gaps_label = QtWidgets.QLabel('%s:' % _('Gaps')) gaps_label = QtWidgets.QLabel('%s:' % _('Gaps'))
gaps_label.setToolTip( gaps_label.setToolTip(
_("Number of bridge gaps used for the cutout.\n" _("Number of gaps used for the cutout.\n"
"There can be maximum 8 bridges/gaps.\n" "There can be maximum 8 bridges/gaps.\n"
"The choices are:\n" "The choices are:\n"
"- None - no gaps\n"
"- lr - left + right\n" "- lr - left + right\n"
"- tb - top + bottom\n" "- tb - top + bottom\n"
"- 4 - left + right +top + bottom\n" "- 4 - left + right +top + bottom\n"
@@ -6581,7 +6582,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
self.gaps_combo = FCComboBox() self.gaps_combo = FCComboBox()
grid0.addWidget(self.gaps_combo, 4, 1) grid0.addWidget(self.gaps_combo, 4, 1)
gaps_items = ['LR', 'TB', '4', '2LR', '2TB', '8'] gaps_items = ['None', 'LR', 'TB', '4', '2LR', '2TB', '8']
for it in gaps_items: for it in gaps_items:
self.gaps_combo.addItem(it) self.gaps_combo.addItem(it)
self.gaps_combo.setStyleSheet('background-color: rgb(255,255,255)') self.gaps_combo.setStyleSheet('background-color: rgb(255,255,255)')

View File

@@ -151,6 +151,7 @@ class CutOut(FlatCAMTool):
_("Number of gaps used for the Automatic cutout.\n" _("Number of gaps used for the Automatic cutout.\n"
"There can be maximum 8 bridges/gaps.\n" "There can be maximum 8 bridges/gaps.\n"
"The choices are:\n" "The choices are:\n"
"- None - no gaps\n"
"- lr - left + right\n" "- lr - left + right\n"
"- tb - top + bottom\n" "- tb - top + bottom\n"
"- 4 - left + right +top + bottom\n" "- 4 - left + right +top + bottom\n"
@@ -161,7 +162,7 @@ class CutOut(FlatCAMTool):
gaps_label.setMinimumWidth(60) gaps_label.setMinimumWidth(60)
self.gaps = FCComboBox() self.gaps = FCComboBox()
gaps_items = ['LR', 'TB', '4', '2LR', '2TB', '8'] gaps_items = ['None', 'LR', 'TB', '4', '2LR', '2TB', '8']
for it in gaps_items: for it in gaps_items:
self.gaps.addItem(it) self.gaps.addItem(it)
self.gaps.setStyleSheet('background-color: rgb(255,255,255)') self.gaps.setStyleSheet('background-color: rgb(255,255,255)')
@@ -413,8 +414,9 @@ class CutOut(FlatCAMTool):
self.app.inform.emit(_("[WARNING_NOTCL] Number of gaps value is missing. Add it and retry.")) self.app.inform.emit(_("[WARNING_NOTCL] Number of gaps value is missing. Add it and retry."))
return return
if gaps not in ['LR', 'TB', '2LR', '2TB', '4', '8']: if gaps not in ['None', 'LR', 'TB', '2LR', '2TB', '4', '8']:
self.app.inform.emit(_("[WARNING_NOTCL] Gaps value can be only one of: 'lr', 'tb', '2lr', '2tb', 4 or 8. " self.app.inform.emit(_("[WARNING_NOTCL] Gaps value can be only one of: "
"'None', 'lr', 'tb', '2lr', '2tb', 4 or 8. "
"Fill in a correct value and retry. ")) "Fill in a correct value and retry. "))
return return
@@ -449,7 +451,9 @@ class CutOut(FlatCAMTool):
leny = (ymax - ymin) + (margin * 2) leny = (ymax - ymin) + (margin * 2)
proc_geometry = [] proc_geometry = []
if gaps == 'None':
pass
else:
if gaps == '8' or gaps == '2LR': if gaps == '8' or gaps == '2LR':
geom = self.subtract_poly_from_geo(geom, geom = self.subtract_poly_from_geo(geom,
xmin - gapsize, # botleft_x xmin - gapsize, # botleft_x
@@ -606,8 +610,9 @@ class CutOut(FlatCAMTool):
self.app.inform.emit(_("[WARNING_NOTCL] Number of gaps value is missing. Add it and retry.")) self.app.inform.emit(_("[WARNING_NOTCL] Number of gaps value is missing. Add it and retry."))
return return
if gaps not in ['LR', 'TB', '2LR', '2TB', '4', '8']: if gaps not in ['None', 'LR', 'TB', '2LR', '2TB', '4', '8']:
self.app.inform.emit(_("[WARNING_NOTCL] Gaps value can be only one of: 'lr', 'tb', '2lr', '2tb', 4 or 8. " self.app.inform.emit(_("[WARNING_NOTCL] Gaps value can be only one of: "
"'None', 'lr', 'tb', '2lr', '2tb', 4 or 8. "
"Fill in a correct value and retry. ")) "Fill in a correct value and retry. "))
return return
@@ -633,6 +638,9 @@ class CutOut(FlatCAMTool):
lenx = (xmax - xmin) + (margin * 2) lenx = (xmax - xmin) + (margin * 2)
leny = (ymax - ymin) + (margin * 2) leny = (ymax - ymin) + (margin * 2)
if gaps == 'None':
pass
else:
if gaps == '8' or gaps == '2LR': if gaps == '8' or gaps == '2LR':
geom = self.subtract_poly_from_geo(geom, geom = self.subtract_poly_from_geo(geom,
xmin - gapsize, # botleft_x xmin - gapsize, # botleft_x