diff --git a/src/geo/polygons.js b/src/geo/polygons.js index 59c1dc82..59b82f91 100644 --- a/src/geo/polygons.js +++ b/src/geo/polygons.js @@ -871,9 +871,6 @@ flatten(polys).sort((a,b) => { return a.area() > b.area(); }).forEach(p => { - // finger.push(p.area()); - // finger.push(p.perimeter()); - // finger.push(p.bounds); finger.push({ c: p.circularityDeep(), p: p.perimeterDeep(), @@ -913,20 +910,6 @@ return false; } } - // for (let i=0; i 0.001) { - // return false; - // } - // if (Math.abs(a[i+1] - b[i+1]) > 0.0001) { - // return false; - // } - // if (Math.abs(a[i+2].centerx() - b[i+2].centerx()) > 0.0001) { - // return false; - // } - // if (Math.abs(a[i+2].centery() - b[i+2].centery()) > 0.0001) { - // return false; - // } - // } return true; } diff --git a/src/geo/wasm.js b/src/geo/wasm.js index c304a839..9e33106f 100644 --- a/src/geo/wasm.js +++ b/src/geo/wasm.js @@ -190,7 +190,7 @@ if (!self.window) (function() { free: exports.mem_clr, set_debug: exports.set_debug }; - wasm.shared = wasm.malloc(1024 * 1024 * 32), + wasm.shared = wasm.malloc(1024 * 1024 * 30), wasm.fn = { diff: exports.poly_diff, union: exports.poly_union, diff --git a/src/mode/fdm/slice.js b/src/mode/fdm/slice.js index ccdcb49a..c62c18f5 100644 --- a/src/mode/fdm/slice.js +++ b/src/mode/fdm/slice.js @@ -479,7 +479,7 @@ if (!isSynth && !vaseMode) { // sparse layers only present when non-vase mose and sparse % > 0 let lastType; - let promises = false && isConcurrent ? [] : undefined; + let promises = isConcurrent ? [] : undefined; forSlices(0.5, promises ? 0.55 : 0.7, slice => { let params = slice.params || process; if (!params.sliceFillSparse) { @@ -496,7 +496,7 @@ bounds: widget.getBoundingBox(), height: sliceHeight, type: newType, - cache: params._range !== true && lastType === newType && !isConcurrent, + cache: params._range !== true && lastType === newType, promises }); lastType = newType; @@ -506,6 +506,16 @@ trackupdate(i / t, 0.55, 0.7); }); } + // back-fill slices marked for infill cloning + for (let slice of slices) { + if (slice._clone_sparse) { + let tops = slice.tops; + let down = slice.down.tops; + for (let i=0; i p.cloneZ(slice.z)); + } + } + } } else if (isSynth) { // fill manual supports differently let promises = isConcurrent ? [] : undefined; @@ -943,20 +953,15 @@ if (skippable && slice.fingerprintSame(down)) { // the fill fingerprint can slightly different because of solid projections if (down._fill_finger && POLY.fingerprintCompare(slice._fill_finger, down._fill_finger)) { - // console.log({fill_clone: down.index}); for (let i=0; i p.cloneZ(slice.z)); - tops[i].fill_sparse = down.tops[i].fill_sparse.map(poly => { - return poly.clone().setZ(slice.z); - }); - } else { + if (!down.tops[i].fill_sparse) { miss = true; } } - // if any of the fills as missing from below, re-compute + // mark for infill cloning if nothing is missing if (!miss) { + slice._clone_sparse = true; return; } }