add travel boundary hangover for travel between ops when the next has no internal walls

This commit is contained in:
Stewart Allen 2025-12-13 21:34:08 -05:00
commit 776ce35864
2 changed files with 11 additions and 10 deletions

View file

@ -147,8 +147,9 @@ class OpRegister extends CamOp {
prepare(ops, progress) { prepare(ops, progress) {
let { op } = this; let { op } = this;
let { emitDrills, setDrill, setTool } = ops; let { emitDrills, setDrill, setTool, setTravelBoundary } = ops;
setTravelBoundary();
if (op.axis === '-' || op.axis === '=') { if (op.axis === '-' || op.axis === '=') {
setTool(op.tool, op.feed, op.rate); setTool(op.tool, op.feed, op.rate);
for (let slice of this.sliceOut) { for (let slice of this.sliceOut) {

View file

@ -116,10 +116,11 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
isLathe, isLathe,
isIndex, isIndex,
layerOut = [], layerOut = [],
lastOp,
lastTool,
lasering = false, lasering = false,
laserPower = 0, laserPower = 0,
lastOp,
lastTool,
lastTravelBounds,
newOutput = print.output || [], newOutput = print.output || [],
nextIsMove = true, nextIsMove = true,
plungeRate = camFastFeedZ, plungeRate = camFastFeedZ,
@ -164,6 +165,7 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
function setContouring(bool, step) { function setContouring(bool, step) {
contouring = bool; contouring = bool;
toolDiamMove = step ?? tool.getStepSize(currentOp.step) * 2; toolDiamMove = step ?? tool.getStepSize(currentOp.step) * 2;
if (bool) setTravelBoundary();
} }
function setSpindle(speed) { function setSpindle(speed) {
@ -482,7 +484,9 @@ 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) {
for (let poly of travelBounds) { // travel boundary "hangover" from last area op when traveling between
let check = lastTravelBounds ? [...lastTravelBounds, ...travelBounds] : travelBounds;
for (let poly of check) {
let ints = poly.intersections( let ints = poly.intersections(
toWidgetCoords(printPoint), toWidgetCoords(printPoint),
toWidgetCoords(point) toWidgetCoords(point)
@ -493,6 +497,7 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
break; break;
} }
} }
lastTravelBounds = undefined;
} else } else
// for longer moves, check the terrain to see if we need to go up and over // for longer moves, check the terrain to see if we need to go up and over
if (isMove) { if (isMove) {
@ -547,13 +552,10 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
} }
function setTravelBoundary(polys) { function setTravelBoundary(polys) {
lastTravelBounds = travelBounds;
travelBounds = POLY.flatten(polys); travelBounds = POLY.flatten(polys);
} }
function clearTravelBoundary() {
travelBounds = undefined;
}
/** /**
* output an array of slices that form a pocket * output an array of slices that form a pocket
* used by rough and pocket ops * used by rough and pocket ops
@ -604,8 +606,6 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
descend(depthData.slice(i)); descend(depthData.slice(i));
} }
} }
clearTravelBoundary();
} }
function descend(stack, inside) { function descend(stack, inside) {