fix trace offset override

This commit is contained in:
Stewart Allen 2025-12-19 17:56:34 -05:00
commit 834e60cd6b
3 changed files with 6 additions and 5 deletions

View file

@ -226,7 +226,7 @@ class OpArea extends CamOp {
progress(proc, 'clear'); progress(proc, 'clear');
} else } else
if (mode === 'trace') { if (mode === 'trace') {
let { tr_type } = op; let { tr_over, tr_type } = op;
let zs = down ? base_util.lerp(zTop, op.thru ? zBottom : Math.max(zBottom, area.minZ()), down) : [ bounds.min.z ]; let zs = down ? base_util.lerp(zTop, op.thru ? zBottom : Math.max(zBottom, area.minZ()), down) : [ bounds.min.z ];
let zroc = 0; let zroc = 0;
let zinc = 1 / zs.length; let zinc = 1 / zs.length;
@ -247,8 +247,8 @@ class OpArea extends CamOp {
} }
// todo: move this out of the zs loop // todo: move this out of the zs loop
let stepping = tr_type === 'inside' ? let stepping = tr_type === 'inside' ?
[ -toolDiam / 2, -toolOver ] : ( tr_over ? -tr_over : [ -toolDiam / 2, -toolOver ] ) :
[ toolDiam / 2, toolOver ]; ( tr_over ? tr_over : [ toolDiam / 2, toolOver ] );
POLY.offset(offit, stepping, { POLY.offset(offit, stepping, {
count: op.steps ?? 1, outs, flat: true, z, minArea: 0, open: true count: op.steps ?? 1, outs, flat: true, z, minArea: 0, open: true
}); });

View file

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

View file

@ -341,7 +341,7 @@ self.lang['en-us'] = {
pt_thrd_s: "threaded", pt_thrd_s: "threaded",
pt_thrd_l: ["use parallel processing when browser supports nested workers. may increase memory pressure on larger models. disable if you are getting out of memory errors"], pt_thrd_l: ["use parallel processing when browser supports nested workers. may increase memory pressure on larger models. disable if you are getting out of memory errors"],
pt_assy_s: "web asm", pt_assy_s: "web asm",
pt_assy_l: ["use web assembly when supported by browser. if you experience artifacts or memory errors, try disabling this."], pt_assy_l: ["use web assembly when supported by browser. required for some cnc operations. if you experience artifacts or memory errors, try disabling this."],
pt_wgpu_s: "web gpu", pt_wgpu_s: "web gpu",
pt_wgpu_l: ["use web gpu when supported by browser. if you experience artifacts or memory errors, try disabling this."], pt_wgpu_l: ["use web gpu when supported by browser. if you experience artifacts or memory errors, try disabling this."],