add trace 'offset z' option

This commit is contained in:
Stewart Allen 2026-01-21 20:17:41 -05:00
commit 7aefc51e1f
5 changed files with 9 additions and 2 deletions

View file

@ -608,6 +608,7 @@ export const conf = {
camTraceLines: false,
camTraceMerge: false,
camTraceOffOver: 0,
camTraceOffZ: 0,
camTraceOffset: "none",
camTraceOver: 0.5,
camTracePlunge: 200,

View file

@ -485,6 +485,7 @@ export function createPopOps() {
rate: 'camTraceSpeed',
plunge: 'camTracePlunge',
offover: 'camTraceOffOver',
offz: 'camTraceOffZ',
dogbone: 'camTraceDogbone',
revbone: 'camTraceDogbone',
ignore: 'camTraceIgnore',
@ -501,6 +502,7 @@ export function createPopOps() {
step: UC.newInput(LANG.cc_sovr_s, { title: LANG.cc_sovr_l, convert: toFloat, bound: UC.bound(0.01, 1.0), show: (op) => env.popOp.trace.rec.mode === "clear" }),
down: UC.newInput(LANG.cc_sdwn_s, { title: LANG.cc_sdwn_l, convert: toFloat, units }),
offover: UC.newInput(LANG.cc_offd_s, { title: LANG.cc_offd_l, convert: toFloat, units, show: () => env.poppedRec.offset !== "none" || env.poppedRec.mode === "clear" }),
offz: UC.newInput(LANG.cc_offz_s, { title: LANG.cc_offz_l, convert: toFloat, units, show: () => env.poppedRec.mode === "follow" }),
sep: UC.newBlank({ class: "pop-sep", modes: MODES.CAM, xshow: zDogSep }),
thru: UC.newBoolean(LANG.cc_thru_s, undefined, { title: LANG.cc_thru_l }),
ignore: UC.newBoolean(LANG.co_igno_s, undefined, { title: LANG.co_igno_l, show: () => env.poppedRec.mode === 'clear' }),

View file

@ -256,10 +256,11 @@ class OpArea extends CamOp {
progress(proc, 'clear');
} else
if (mode === 'trace') {
let { tr_over, tr_type } = op;
let { tr_over, tr_offz, tr_type } = op;
let zs = down ? base_util.lerp(zTop, op.thru ? zBottom : Math.max(zBottom, area.minZ()), down) : [ bounds.min.z ];
let zroc = 0;
let zinc = 1 / zs.length;
if (tr_offz) zs = zs.map(z => z - tr_offz);
for (let z of zs) {
let slice = newLayer(z);
let layers = slice.output();

View file

@ -12,7 +12,7 @@ class OpTrace extends CamOp {
async slice(progress) {
let { op, state } = this;
let { areas, direction, down, expand, follow, offover, offset, outline, ignore, mode, ov_botz, ov_topz } = op;
let { areas, direction, down, expand, follow, offover, offset, offz, outline, ignore, mode, ov_botz, ov_topz } = op;
let { plunge, rate, refine, smooth, spindle, step, steps, thru, tolerance, tool } = op;
let trace = {
areas,
@ -40,6 +40,7 @@ class OpTrace extends CamOp {
tool,
thru,
tr_over: offover,
tr_offz: offz,
tr_type: offset
};
this.op_trace = new OpArea(state, trace);

View file

@ -504,6 +504,8 @@ self.lang['en-us'] = {
cc_thru_l: ["allow trace depth to extend thru","the bottom of the selected area","use with negative Z bottom"],
cc_offd_s: "offset",
cc_offd_l: ["overrides default offset distance (which is the tool radius) when set to any value but zero"],
cc_offz_s: "offset z",
cc_offz_l: ["shift add or subtract Z values by this amount","in workspace units"],
cc_feed_s: "feed rate",
cc_feed_l: ["max cutting speed in","workspace units / minute"],
cc_plng_s: "plunge rate",