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 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 (notable?.length) label = notable[0].slice(1);
if (notable?.length) label += ` (${notable[0].slice(1)})`;
html.appendAll([
`<div id="${mark+i}" class="${clazz.join(' ')}"${title}>`,
`<label class="label">${label}</label>`,

View file

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

View file

@ -132,7 +132,7 @@ gapp.register("kiri.ui", [], (root, exports) => {
if (Array.isArray(input)) {
iid = `confirm-input-${rnd}`;
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}`;
html.append(`<div><input class="grow" type="text" spellcheck="false" id="${iid}"/></div>`);
}