From 7501fed121e2fbeb2cdf1d54966d913cf03dbfc5 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Thu, 10 Dec 2020 14:55:46 -0500 Subject: [PATCH] optimize outside only outlining. disable synth plunge (for now) --- src/mode/cam/prepare.js | 3 ++- src/mode/cam/slice.js | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/mode/cam/prepare.js b/src/mode/cam/prepare.js index df6f07e2..47459954 100644 --- a/src/mode/cam/prepare.js +++ b/src/mode/cam/prepare.js @@ -94,6 +94,7 @@ lastMode, lastPoint, nextIsMove = true, + synthPlunge = false, spindle = 0, spindleMax = device.spindleMax, addOutput = print.addOutput, @@ -293,7 +294,7 @@ } // synth new plunge rate - if (deltaZ <= -tolerance) { + if (synthPlunge && deltaZ <= -tolerance) { let threshold = Math.min(deltaXY / 2, absDeltaZ), modifier = threshold / absDeltaZ; if (threshold && modifier && deltaXY > tolerance) { diff --git a/src/mode/cam/slice.js b/src/mode/cam/slice.js index 190bc7df..5133d292 100644 --- a/src/mode/cam/slice.js +++ b/src/mode/cam/slice.js @@ -168,7 +168,7 @@ let tslices = []; let tshadow = []; let tzindex = slicer.interval(minStepDown, { fit: true, off: 0.01, down: true, flats: true }); - let skipTerrain = !(procRough || procOutline) && tzindex.length > 50; + let skipTerrain = !(procRough || procOutlineIn) && tzindex.length > 50; if (skipTerrain) { console.log("skipping terrain generation for speed"); @@ -397,6 +397,20 @@ .filter(v => v > 0 && indices.indexOf(v) < 0); indices = indices.appendAll(flats).sort((a,b) => b-a); // console.log('indices', ...indices, {zBottom, slicer}); + if (procOutlineOut && !procOutlineIn) { + console.log({outline_bypass: indices, outlineDown}); + indices.forEach((ind,i) => { + if (flats.indexOf(ind) >= 0) { + // exclude flats + return; + } + let slice = newSlice(ind); + slice.camMode = PRO.OUTLINE; + slice.shadow = shadow.clone(true); + slices.push(slice); + updateOp(i, indices.length); + }); + } else slicer.slice(indices, { each: (data, index, total) => { shadow = POLY.union(shadow.slice().appendAll(data.tops), 0.01, true); if (flats.indexOf(data.z) >= 0) {