rename sliceOutput to pocket
This commit is contained in:
parent
e71d8157a4
commit
2e046bd698
3 changed files with 15 additions and 14 deletions
|
|
@ -242,7 +242,7 @@ class OpPocket extends CamOp {
|
|||
|
||||
prepare(ops, progress) {
|
||||
let { op, state, pockets } = this;
|
||||
let { setTool, setSpindle, setTolerance, sliceOutput, getPrintPoint } = ops;
|
||||
let { getPrintPoint , pocket, setTool, setSpindle, setTolerance } = ops;
|
||||
let { process } = state.settings;
|
||||
|
||||
setTool(op.tool, op.rate);
|
||||
|
|
@ -275,11 +275,12 @@ class OpPocket extends CamOp {
|
|||
}
|
||||
if (min.pocket) {
|
||||
min.pocket.used = true;
|
||||
sliceOutput(min.pocket, {
|
||||
pocket({
|
||||
cutdir: op.ov_conv,
|
||||
depthFirst: process.camDepthFirst && !state.isIndexed,
|
||||
easeDown: op.down && process.easeDown ? op.down : 0,
|
||||
progress: (n,m) => progress(n/m, "pocket")
|
||||
progress: (n,m) => progress(n/m, "pocket"),
|
||||
slices: min.pocket
|
||||
});
|
||||
} else {
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ class OpRough extends CamOp {
|
|||
|
||||
prepare(ops, progress) {
|
||||
let { op, state, sliceOut, camFaces } = this;
|
||||
let { setTool, setSpindle, setPrintPoint, sliceOutput, polyEmit, newLayer, printPoint } = ops;
|
||||
let { setTool, setSpindle, setPrintPoint, pocket, polyEmit, newLayer, printPoint } = ops;
|
||||
let { settings } = state;
|
||||
let { process } = settings;
|
||||
|
||||
|
|
@ -331,11 +331,12 @@ class OpRough extends CamOp {
|
|||
|
||||
// output the roughing passes
|
||||
setPrintPoint(printPoint);
|
||||
sliceOutput(sliceOut, {
|
||||
pocket({
|
||||
cutdir,
|
||||
depthFirst,
|
||||
easeDown: op.down && easeDown ? 0.001 : 0,
|
||||
progress: (n,m) => progress(n/m, "routing")
|
||||
progress: (n,m) => progress(n/m, "routing"),
|
||||
slices: sliceOut
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -554,16 +554,15 @@ export function prepEach(widget, settings, print, firstPoint, update) {
|
|||
* output an array of slices that form a pocket
|
||||
* used by rough and pocket ops, does not support arcs
|
||||
*
|
||||
* @param {Slice[]} top-down Z stack of slices
|
||||
* @param {*} opts
|
||||
* @param {Slice[]} slices top-down Z stack of slices
|
||||
* @param {boolean} cutdir true=CW false=CCW
|
||||
* @param {boolean} depthFirst prioritize cut depth in pockets by nesting
|
||||
*/
|
||||
function sliceOutput(sliceOut, opts = {}) {
|
||||
const { cutdir, depthFirst, easeDown, progress } = opts;
|
||||
|
||||
function pocket({ slices, cutdir, depthFirst, easeDown, progress }) {
|
||||
let total = 0;
|
||||
let depthData = [];
|
||||
|
||||
for (let slice of sliceOut) {
|
||||
for (let slice of slices) {
|
||||
let polys = [], t = [], c = [];
|
||||
POLY.flatten(slice.camLines).forEach(function (poly) {
|
||||
let child = poly.parent;
|
||||
|
|
@ -590,7 +589,7 @@ export function prepEach(widget, settings, print, firstPoint, update) {
|
|||
}, { swapdir: false });
|
||||
newLayer();
|
||||
}
|
||||
progress(++total, sliceOut.length);
|
||||
progress(++total, slices.length);
|
||||
}
|
||||
|
||||
// crucially returns true for -0 as well as other negative #s
|
||||
|
|
@ -695,6 +694,7 @@ export function prepEach(widget, settings, print, firstPoint, update) {
|
|||
getPrintPoint() { return printPoint },
|
||||
lastPoint: () => { return lastPoint },
|
||||
newLayer,
|
||||
pocket,
|
||||
poly2polyEmit,
|
||||
polyEmit,
|
||||
printPoint,
|
||||
|
|
@ -704,7 +704,6 @@ export function prepEach(widget, settings, print, firstPoint, update) {
|
|||
setSpindle,
|
||||
setTolerance,
|
||||
setTool,
|
||||
sliceOutput,
|
||||
stock,
|
||||
tip2tipEmit,
|
||||
zclear,
|
||||
|
|
|
|||
Loading…
Reference in a new issue