add function to force op change when chaining ops internally like roughing does
This commit is contained in:
parent
76fabfa7f5
commit
45803664f1
2 changed files with 11 additions and 2 deletions
|
|
@ -106,10 +106,12 @@ class OpRough extends CamOp {
|
||||||
await op.slice(progress);
|
await op.slice(progress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
s
|
||||||
async prepare(ops, progress) {
|
async prepare(ops, progress) {
|
||||||
|
let { setChangeOp } = ops;
|
||||||
for (let op of this.ops_list) {
|
for (let op of this.ops_list) {
|
||||||
await op.prepare(ops, progress);
|
await op.prepare(ops, progress);
|
||||||
|
setChangeOp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,7 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
|
||||||
lastTravelBounds,
|
lastTravelBounds,
|
||||||
newOutput = print.output || [],
|
newOutput = print.output || [],
|
||||||
nextIsMove = true,
|
nextIsMove = true,
|
||||||
|
nextIsNewOp = false,
|
||||||
plungeRate = camFastFeedZ,
|
plungeRate = camFastFeedZ,
|
||||||
printPoint,
|
printPoint,
|
||||||
tool,
|
tool,
|
||||||
|
|
@ -354,6 +355,10 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
|
||||||
nextIsMove = true;
|
nextIsMove = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setChangeOp() {
|
||||||
|
nextIsNewOp = true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move a point by the widget's movement offset.
|
* Move a point by the widget's movement offset.
|
||||||
* @param {Point} p - point to move
|
* @param {Point} p - point to move
|
||||||
|
|
@ -475,11 +480,12 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
|
||||||
// 1. move to safe z of current point preserving angle
|
// 1. move to safe z of current point preserving angle
|
||||||
// 2. move to safe z of new point preserving old angle
|
// 2. move to safe z of new point preserving old angle
|
||||||
// 3. move to safe z of new point with new angle
|
// 3. move to safe z of new point with new angle
|
||||||
if (lop !== currentOp) {
|
if (nextIsNewOp || lop !== currentOp) {
|
||||||
layerPush(printPoint.clone().setZ(zSafe).setA(printPoint.a), 0, feedRate, tool);
|
layerPush(printPoint.clone().setZ(zSafe).setA(printPoint.a), 0, feedRate, tool);
|
||||||
layerPush(point.clone().setZ(zSafe).setA(printPoint.a), 0, feedRate, tool);
|
layerPush(point.clone().setZ(zSafe).setA(printPoint.a), 0, feedRate, tool);
|
||||||
layerPush(point.clone().setZ(zSafe), 0, feedRate, tool);
|
layerPush(point.clone().setZ(zSafe), 0, feedRate, tool);
|
||||||
newLayer();
|
newLayer();
|
||||||
|
nextIsNewOp = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// consume forced next move flag and convert to move
|
// consume forced next move flag and convert to move
|
||||||
|
|
@ -965,6 +971,7 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
|
||||||
poly2polyEmit,
|
poly2polyEmit,
|
||||||
polyEmit,
|
polyEmit,
|
||||||
printPoint,
|
printPoint,
|
||||||
|
setChangeOp,
|
||||||
setContouring,
|
setContouring,
|
||||||
setDrill,
|
setDrill,
|
||||||
setLasering,
|
setLasering,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue