add leave stock to tool shadow travel boundaries

This commit is contained in:
Stewart Allen 2025-12-15 00:35:56 -05:00
commit 6417dd5678
2 changed files with 8 additions and 7 deletions

View file

@ -115,7 +115,7 @@ class OpArea extends CamOp {
let pinc = 1 / polys.length; let pinc = 1 / polys.length;
for (let area of polys) { for (let area of polys) {
let bounds = area.getBounds3D(); let bounds = area.getBounds3D();
let ts_off = toolDiam / 2 - ts_eps; let ts_off = toolDiam / 2 - ts_eps + (op.leave_xy ?? 0);
let offopt = { let offopt = {
arc: 250, arc: 250,
join: roundSharps ? ClipperLib.JoinType.jtRound : undefined, join: roundSharps ? ClipperLib.JoinType.jtRound : undefined,

View file

@ -484,14 +484,15 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
} }
} else } else
// check move against a known boundary (pocketing) // check move against a known boundary (pocketing)
if (isMove && travelBounds) { if (isMove && (travelBounds || lastTravelBounds)) {
// travel boundary "hangover" from last area op when traveling between // travel boundary "hangover" from last area op when traveling between
let check = lastTravelBounds ? [...lastTravelBounds, ...travelBounds] : travelBounds; let check = [];
if (travelBounds) check.push(...travelBounds);
if (lastTravelBounds) check.push(...lastTravelBounds);
let from = toWidgetCoords(printPoint);
let to = toWidgetCoords(point);
for (let poly of check) { for (let poly of check) {
let ints = poly.intersections( let ints = poly.intersections(from, to);
toWidgetCoords(printPoint),
toWidgetCoords(point)
);
if (ints.length) { if (ints.length) {
if (debug) console.log({ ints, poly, deltaXY, deltaZ }); if (debug) console.log({ ints, poly, deltaXY, deltaZ });
upAndOver = "bounds"; upAndOver = "bounds";