Merge pull request #467 from 1bardesign/feature/finish-cut

Basic Finish Cut Capability
This commit is contained in:
Stewart Allen 2026-03-25 18:16:58 -04:00 committed by GitHub
commit 9efd855003
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View file

@ -778,6 +778,7 @@ export function createPopOps() {
revbones: 'camAreaRevbones',
ov_topz: 0,
ov_botz: 0,
finish_cut: 0,
}).inputs = {
mode: UC.newSelect(LANG.mo_menu, { post: opRender }, "opmode"),
tr_type: UC.newSelect(LANG.cc_offs_s, { title: LANG.cc_offs_l, show: isTrace }, "traceoff"),
@ -805,6 +806,7 @@ export function createPopOps() {
sr_angle: UC.newInput(LANG.ca_sang_s, { title: LANG.ca_sang_l, convert: toFloat, bound: UC.bound(0, 360), show: isSurfaceLinear }),
over: UC.newInput(LANG.cc_sovr_s, { title: LANG.cc_sovr_l, convert: toFloat, bound: UC.bound(0.001, 100.0), show: () => isClear() || isSurface() }),
down: UC.newInput(LANG.cc_sdwn_s, { title: LANG.cc_sdwn_l, convert: toFloat, bound: UC.bound(0, 100.0), units, show: () => isClear() || isTrace() }),
finish_cut: UC.newInput("finish cut", { title: "finish cut", convert: toFloat, bound: UC.bound(0, 2.0), units, show: () => isClear() }), //todo: needs to check camInnerFirst
refine: UC.newInput(LANG.cp_refi_s, { title: LANG.cp_refi_l, convert: toInt, show: isSurface }),
sr_alter: UC.newBoolean(LANG.ca_altr_s, undefined, { title: LANG.ca_altr_l, show: isSurfaceLinear }),
dogbones: UC.newBoolean(LANG.co_dogb_s, undefined, { title: LANG.co_dogb_l, show: isTrace }),

View file

@ -197,7 +197,17 @@ class OpArea extends CamOp {
} else {
POLY.subtract([ area ], shadow, clip, undefined, undefined, 0);
}
POLY.offset(clip, [ firstOff, -toolOver ], {
//generate offsets to use
let offsets = [ firstOff ];
//if we need a finish cut, add it
let finish_cut = op.finish_cut ?? 0;
if (finish_cut != 0) { //todo: this should check for camInnerFirst and warn if it is not true
offsets.push(-finish_cut);
}
//everything else uses the tool stepover
offsets.push(-toolOver);
//actually offset the walls inwards
POLY.offset(clip, offsets, {
count: op.walls ? 1 : (op.steps ?? 999), outs, flat: true, z: z - zMov, ...offopt
});
// if we see no offsets, re-check the mesh bottom Z then exit