From 7072afb613d2a5a9794429b494e936c9154e6a05 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Wed, 23 Jun 2021 16:29:27 -0400 Subject: [PATCH] mark de-rez as experimental, remove comments --- src/mode/fdm/slice.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/mode/fdm/slice.js b/src/mode/fdm/slice.js index b35a8f41..0789507b 100644 --- a/src/mode/fdm/slice.js +++ b/src/mode/fdm/slice.js @@ -146,6 +146,13 @@ onSliceDoneAsync(slices).then(ondone); } + let lastlog = Date.now(); + function logger() { + let now = Date.now(); + console.log(now - lastlog, ...arguments); + lastlog = now; + } + async function doShadow(slices) { if (widget.shadow) { return; @@ -157,20 +164,15 @@ let alllen = alltops.map(p => p.deepLength).reduce((a,v)=>a+v); // de-rez for really large #s if (alllen > 100000) { - // console.log({alllen}); - alltops = alltops.map(p => p.clean(true, undefined, 5000)); - // console.log({reduced: alltops.map(p => p.deepLength).reduce((a,v)=>a+v)}); + alltops = alltops.map(p => p.clean(true, undefined, CONF.clipper / 10)); } - let mark = Date.now(); - // shadow = POLY.union(alltops, 0.1, true); shadow = doConcurrent ? await KIRI.minions.union(alltops, 0.1) : POLY.union(alltops, 0.1, true); - // console.log({unioned_in: Date.now() - mark}); if (spro.sliceSupportExtra) { shadow = POLY.offset(shadow, spro.sliceSupportExtra); } - widget.shadow = shadow; + widget.shadow = POLY.setZ(shadow, 0); // slices[0].output() // .setLayer('shadow', { line: 0xff0000, check: 0xff0000 }) // .addPolys(shadow); @@ -525,7 +527,7 @@ doShadow(slices); // console.log('start'); await BASE.util.ptimer(1000); forSlices(0.7, 0.8, slice => { - doSupport(slice, spro, widget.shadow); + doSupport(slice, spro, widget.shadow, ctrl.danger); }, "support"); // console.log('stop'); await BASE.util.ptimer(1000); let promises = doConcurrent ? [] : undefined; @@ -1158,7 +1160,7 @@ /** * calculate external overhangs requiring support */ - function doSupport(slice, proc, shadow) { + function doSupport(slice, proc, shadow, experimental) { let maxBridge = proc.sliceSupportSpan || 5, minArea = proc.supportMinArea, pillarSize = proc.sliceSupportSize, @@ -1182,7 +1184,7 @@ down_tops = down ? down.topPolys() : null, down_traces = down ? POLY.flatten(down.topShells().clone(true)) : null; - if (down_tops) { + if (experimental && down_tops) { // de-rez complex polys because it's not that important for supports let points = down_tops.map(p => p.deepLength).reduce((a,v)=>a+v); if (points > 200) {