fix trace for some z bottom cases. show op type before note override

This commit is contained in:
Stewart Allen 2025-02-08 14:02:54 -05:00
commit 69ef882eff
3 changed files with 8 additions and 7 deletions

View file

@ -509,7 +509,7 @@ CAM.init = function(kiri, api) {
let clazz = notime ? [ "draggable", "notime" ] : [ "draggable" ]; let clazz = notime ? [ "draggable", "notime" ] : [ "draggable" ];
let notable = rec.note ? rec.note.split(' ').filter(v => v.charAt(0) === '#') : undefined; let notable = rec.note ? rec.note.split(' ').filter(v => v.charAt(0) === '#') : undefined;
if (clock) { clazz.push('clock'); title = ` title="end of ops chain\ndrag/drop like an op\nops after this are disabled"` } if (clock) { clazz.push('clock'); title = ` title="end of ops chain\ndrag/drop like an op\nops after this are disabled"` }
if (notable?.length) label = notable[0].slice(1); if (notable?.length) label += ` (${notable[0].slice(1)})`;
html.appendAll([ html.appendAll([
`<div id="${mark+i}" class="${clazz.join(' ')}"${title}>`, `<div id="${mark+i}" class="${clazz.join(' ')}"${title}>`,
`<label class="label">${label}</label>`, `<label class="label">${label}</label>`,

View file

@ -963,6 +963,7 @@ class OpTrace extends CamOp {
} }
// generate tracing offsets from chosen features // generate tracing offsets from chosen features
let zTop = workarea.top_z; let zTop = workarea.top_z;
let zBottom = workarea.bottom_z;
let sliceOut = this.sliceOut = []; let sliceOut = this.sliceOut = [];
let areas = op.areas[widget.id] || []; let areas = op.areas[widget.id] || [];
let camTool = new CAM.Tool(settings, tool); let camTool = new CAM.Tool(settings, tool);
@ -993,6 +994,9 @@ class OpTrace extends CamOp {
sliceOut.push(slice); sliceOut.push(slice);
return slice; return slice;
} }
function minZ(z) {
return op.bottom && zBottom ? Math.max(zBottom, z - thru) : z - thru;
}
function followZ(poly) { function followZ(poly) {
if (op.dogbone) { if (op.dogbone) {
CAM.addDogbones(poly, toolDiam / 5, !op.revbone); CAM.addDogbones(poly, toolDiam / 5, !op.revbone);
@ -1119,7 +1123,7 @@ class OpTrace extends CamOp {
} }
for (let pi of POLY.flatten(poly, [], true)) for (let pi of POLY.flatten(poly, [], true))
if (down) { if (down) {
let zto = pi.getZ() - thru; let zto = minZ(pi.getZ());
if (zThru && similar(zto,0)) { if (zThru && similar(zto,0)) {
zto -= zThru; zto -= zThru;
} }
@ -1147,10 +1151,7 @@ class OpTrace extends CamOp {
const zbo = widget.track.top - widget.track.box.d; const zbo = widget.track.top - widget.track.box.d;
let zmap = {}; let zmap = {};
for (let poly of polys) { for (let poly of polys) {
let z = poly.getZ() - thru; let z = minZ(poly.getZ());
if (op.bottom && camZBottom) {
z = Math.max(z, camZBottom) - zbo;
}
if (offover) { if (offover) {
let pnew = POLY.offset([poly], -offover, { minArea: 0, open: true }); let pnew = POLY.offset([poly], -offover, { minArea: 0, open: true });
if (pnew) { if (pnew) {

View file

@ -132,7 +132,7 @@ gapp.register("kiri.ui", [], (root, exports) => {
if (Array.isArray(input)) { if (Array.isArray(input)) {
iid = `confirm-input-${rnd}`; iid = `confirm-input-${rnd}`;
html.append(`<div><textarea rows="15" cols="40" class="grow" type="text" spellcheck="false" id="${iid}"></textarea></div>`); html.append(`<div><textarea rows="15" cols="40" class="grow" type="text" spellcheck="false" id="${iid}"></textarea></div>`);
} else if (input) { } else if (input !== undefined) {
iid = `confirm-input-${rnd}`; iid = `confirm-input-${rnd}`;
html.append(`<div><input class="grow" type="text" spellcheck="false" id="${iid}"/></div>`); html.append(`<div><input class="grow" type="text" spellcheck="false" id="${iid}"/></div>`);
} }