separate leave stock z from leave stock

This commit is contained in:
Stewart Allen 2024-03-28 19:40:47 -04:00
commit 2f81016793
4 changed files with 11 additions and 5 deletions

View file

@ -1263,6 +1263,7 @@ CAM.init = function(kiri, api) {
rate: 'camRoughSpeed', rate: 'camRoughSpeed',
plunge: 'camRoughPlunge', plunge: 'camRoughPlunge',
leave: 'camRoughStock', leave: 'camRoughStock',
leavez: 'camRoughStockZ',
all: 'camRoughAll', all: 'camRoughAll',
voids: 'camRoughVoid', voids: 'camRoughVoid',
flats: 'camRoughFlat', flats: 'camRoughFlat',
@ -1278,6 +1279,7 @@ CAM.init = function(kiri, api) {
down: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, units:true}), down: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, units:true}),
step: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0)}), step: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0)}),
leave: UC.newInput(LANG.cr_lsto_s, {title:LANG.cr_lsto_l, convert:UC.toFloat, units:true}), leave: UC.newInput(LANG.cr_lsto_s, {title:LANG.cr_lsto_l, convert:UC.toFloat, units:true}),
leavez: UC.newInput(LANG.cr_lstz_s, {title:LANG.cr_lstz_l, convert:UC.toFloat, bound:UC.bound(0,10),units:true}),
sep: UC.newBlank({class:"pop-sep"}), sep: UC.newBlank({class:"pop-sep"}),
all: UC.newBoolean(LANG.cr_clst_s, undefined, {title:LANG.cr_clst_l, show:hasIndexing}), all: UC.newBoolean(LANG.cr_clst_s, undefined, {title:LANG.cr_clst_l, show:hasIndexing}),
voids: UC.newBoolean(LANG.cr_clrp_s, undefined, {title:LANG.cr_clrp_l}), voids: UC.newBoolean(LANG.cr_clrp_s, undefined, {title:LANG.cr_clrp_l}),

View file

@ -182,7 +182,8 @@ class OpRough extends CamOp {
let roughIn = op.inside; let roughIn = op.inside;
let roughTop = op.top; let roughTop = op.top;
let roughDown = op.down; let roughDown = op.down;
let roughLeave = op.leave; let roughLeave = op.leave || 0;
let roughLeaveZ = op.leavez || 0;
let roughStock = op.all && isIndexed; let roughStock = op.all && isIndexed;
let toolDiam = new CAM.Tool(settings, op.tool).fluteDiameter(); let toolDiam = new CAM.Tool(settings, op.tool).fluteDiameter();
let trueShadow = process.camTrueShadow === true; let trueShadow = process.camTrueShadow === true;
@ -210,7 +211,7 @@ class OpRough extends CamOp {
for (let z = zstart; zsteps > 0; zsteps--) { for (let z = zstart; zsteps > 0; zsteps--) {
let slice = shadowTop.slice.clone(false); let slice = shadowTop.slice.clone(false);
slice.z = z; slice.z = z;
slice.camLines = POLY.setZ(facing.clone(true), slice.z); slice.camLines = POLY.setZ(facing.clone(true), slice.z + roughLeaveZ);
slice.output() slice.output()
.setLayer("face", {face: color, line: color}) .setLayer("face", {face: color, line: color})
.addPolys(slice.camLines); .addPolys(slice.camLines);
@ -383,10 +384,10 @@ class OpRough extends CamOp {
}); });
slice.camLines = offset; slice.camLines = offset;
if (roughLeave) { if (roughLeaveZ) {
// offset roughing in Z as well to minimize // offset roughing in Z as well to minimize
// tool marks on curved surfaces // tool marks on curved surfaces
const roughLeaveZ = 1 * Math.min(roughDown, roughLeave / 2); // const roughLeaveZ = 1 * Math.min(roughDown, roughLeave / 2);
slice.camLines.forEach(p => { slice.camLines.forEach(p => {
p.setZ(p.getZ() + roughLeaveZ); p.setZ(p.getZ() + roughLeaveZ);
}); });
@ -409,7 +410,7 @@ class OpRough extends CamOp {
let add = last.clone(true); let add = last.clone(true);
add.z -= zneg; add.z -= zneg;
add.camLines = last.camLines.clone(true); add.camLines = last.camLines.clone(true);
add.camLines.forEach(p => p.setZ(add.z)); add.camLines.forEach(p => p.setZ(add.z + roughLeaveZ));
// add.tops.forEach(top => top.poly.setZ(add.z)); // add.tops.forEach(top => top.poly.setZ(add.z));
// add.shadow = last.shadow.clone(true); // add.shadow = last.shadow.clone(true);
slices.push(add); slices.push(add);

View file

@ -470,6 +470,7 @@ const conf = exports({
camRoughSpeed: 1000, camRoughSpeed: 1000,
camRoughPlunge: 250, camRoughPlunge: 250,
camRoughStock: 0, camRoughStock: 0,
camRoughStockZ: 0,
camRoughAll: true, camRoughAll: true,
camRoughVoid: false, camRoughVoid: false,
camRoughFlat: true, camRoughFlat: true,

View file

@ -481,6 +481,8 @@ self.kiri.lang['en-us'] = {
cr_menu: "rough", cr_menu: "rough",
cr_lsto_s: "leave stock", cr_lsto_s: "leave stock",
cr_lsto_l: ["horizontal offset from vertical faces","stock to leave for finishing pass","in workspace units"], cr_lsto_l: ["horizontal offset from vertical faces","stock to leave for finishing pass","in workspace units"],
cr_lstz_s: "leave stock z",
cr_lstz_l: ["vertical offset for roughing passes in workspace units. best for roughing curved surfaces."],
cr_ease_s: "ease down", cr_ease_s: "ease down",
cr_ease_l: ["plunge cuts will","spiral down or ease","along a linear path"], cr_ease_l: ["plunge cuts will","spiral down or ease","along a linear path"],
cr_clst_s: "clear stock", cr_clst_s: "clear stock",