add 'z thru' option for cleaner cutouts

This commit is contained in:
Stewart Allen 2020-08-15 17:32:09 -04:00
commit b9597cc096
4 changed files with 23 additions and 0 deletions

View file

@ -444,6 +444,7 @@
camZTopOffset: 0, camZTopOffset: 0,
camZBottom: 0, camZBottom: 0,
camZClearance: 1, camZClearance: 1,
camZThru: 0,
camFastFeed: 6000, camFastFeed: 6000,
camFastFeedZ: 300, camFastFeedZ: 300,
camTolerance: 0.15, camTolerance: 0.15,

View file

@ -1449,6 +1449,7 @@
camZTopOffset: UC.newInput(LANG.ou_ztof_s, {title:LANG.ou_ztof_l, convert:UC.toFloat, modes:CAM}), camZTopOffset: UC.newInput(LANG.ou_ztof_s, {title:LANG.ou_ztof_l, convert:UC.toFloat, modes:CAM}),
camZBottom: UC.newInput(LANG.ou_zbot_s, {title:LANG.ou_zbot_l, convert:UC.toFloat, modes:CAM}), camZBottom: UC.newInput(LANG.ou_zbot_s, {title:LANG.ou_zbot_l, convert:UC.toFloat, modes:CAM}),
camZClearance: UC.newInput(LANG.ou_zclr_s, {title:LANG.ou_zclr_l, convert:UC.toFloat, bound:UC.bound(0.01,100), modes:CAM}), camZClearance: UC.newInput(LANG.ou_zclr_s, {title:LANG.ou_zclr_l, convert:UC.toFloat, bound:UC.bound(0.01,100), modes:CAM}),
camZThru: UC.newInput(LANG.ou_ztru_s, {title:LANG.ou_ztru_l, convert:UC.toFloat, bound:UC.bound(0.0,100), modes:CAM}),
camFastFeedZ: UC.newInput(LANG.cc_rzpd_s, {title:LANG.cc_rzpd_l, convert:UC.toInt, modes:CAM}), camFastFeedZ: UC.newInput(LANG.cc_rzpd_s, {title:LANG.cc_rzpd_l, convert:UC.toInt, modes:CAM}),
camFastFeed: UC.newInput(LANG.cc_rapd_s, {title:LANG.cc_rapd_l, convert:UC.toInt, modes:CAM}), camFastFeed: UC.newInput(LANG.cc_rapd_s, {title:LANG.cc_rapd_l, convert:UC.toInt, modes:CAM}),
camTolerance: UC.newInput(LANG.ou_toll_s, {title:LANG.ou_toll_l, convert:UC.toFloat, bound:UC.bound(0.001,1.0), modes:CAM}), camTolerance: UC.newInput(LANG.ou_toll_s, {title:LANG.ou_toll_l, convert:UC.toFloat, bound:UC.bound(0.001,1.0), modes:CAM}),

View file

@ -882,6 +882,7 @@
bounds = widget.getBoundingBox(), bounds = widget.getBoundingBox(),
mesh = widget.mesh, mesh = widget.mesh,
zMin = Math.max(bounds.min.z, proc.camZBottom) * units, zMin = Math.max(bounds.min.z, proc.camZBottom) * units,
zThru = (proc.camZThru || 0) * units,
camRoughStock = proc.camRoughStock * units, camRoughStock = proc.camRoughStock * units,
shellRough, shellRough,
shellOutline, shellOutline,
@ -986,6 +987,18 @@
slice.tops[0].traces = nutrace; slice.tops[0].traces = nutrace;
} }
// extend bottom cutout
const addZThru = function(selected) {
let last = selected[selected.length-1];
let add = last.clone(true);
add.camMode = last.camMode;
add.z -= zThru;
add.tops.forEach(top => {
top.poly.setZ(add.z);
});
selected.push(add);
};
// called when z-index slicing complete // called when z-index slicing complete
const camSlicesDone = function(slices) { const camSlicesDone = function(slices) {
@ -1049,6 +1062,9 @@
if (procRough) { if (procRough) {
let selected = []; let selected = [];
selectSlices(slices, proc.camRoughDown * units, CPRO.ROUGH, selected); selectSlices(slices, proc.camRoughDown * units, CPRO.ROUGH, selected);
if (zThru) {
addZThru(selected);
}
sliceAll.appendAll(selected); sliceAll.appendAll(selected);
if (!proc.camRoughVoid) { if (!proc.camRoughVoid) {
thruHoles = holes(slices, roughToolDiam + camRoughStock); thruHoles = holes(slices, roughToolDiam + camRoughStock);
@ -1058,6 +1074,9 @@
if (procOutline) { if (procOutline) {
let selected = []; let selected = [];
selectSlices(slices, proc.camOutlineDown * units, CPRO.OUTLINE, selected); selectSlices(slices, proc.camOutlineDown * units, CPRO.OUTLINE, selected);
if (zThru) {
addZThru(selected);
}
sliceAll.appendAll(selected); sliceAll.appendAll(selected);
} }
} }

View file

@ -353,6 +353,8 @@ kiri.lang['en-us'] = {
ou_zbot_l: "offset from part bottom\nto limit cutting depth\nin workspace units", ou_zbot_l: "offset from part bottom\nto limit cutting depth\nin workspace units",
ou_zclr_s: "z clearance", ou_zclr_s: "z clearance",
ou_zclr_l: "travel offset from z top\nin workspace units", ou_zclr_l: "travel offset from z top\nin workspace units",
ou_ztru_s: "z thru",
ou_ztru_l: "extend cutout pass down\nin workspace units",
ou_conv_s: "conventional", ou_conv_s: "conventional",
ou_conv_l: "milling direction\nuncheck for 'climb'", ou_conv_l: "milling direction\nuncheck for 'climb'",
ou_depf_s: "depth first", ou_depf_s: "depth first",