do not allow infill caching with concurrency

This commit is contained in:
Stewart Allen 2021-06-20 19:27:53 -04:00
commit a4d6c00a8d
2 changed files with 16 additions and 18 deletions

View file

@ -137,7 +137,9 @@
if (bucketCount > 1) { if (bucketCount > 1) {
// create empty buckets // create empty buckets
for (i = 0; i < bucketCount + 1; i++) buckets.push([]); for (i = 0; i < bucketCount + 1; i++) {
buckets.push({ points: []});
}
// copy triples into all matching z-buckets // copy triples into all matching z-buckets
for (i = 0; i < points.length;) { for (i = 0; i < points.length;) {
@ -150,11 +152,13 @@
bM = Math.ceil(zM * zScale); bM = Math.ceil(zM * zScale);
if (bm < 0) bm = 0; if (bm < 0) bm = 0;
for (j = bm; j < bM; j++) { for (j = bm; j < bM; j++) {
buckets[j].push(p1); buckets[j].points.push(p1);
buckets[j].push(p2); buckets[j].points.push(p2);
buckets[j].push(p3); buckets[j].points.push(p3);
} }
} }
} else {
buckets.push({ points });
} }
// we need Z ordered list for laser auto or adaptive fdm slicing // we need Z ordered list for laser auto or adaptive fdm slicing
@ -267,7 +271,7 @@
zIndexes[i] -= -0.001; zIndexes[i] -= -0.001;
} }
// slice next layer and add to slices[] array // slice next layer and add to slices[] array
let slice = sliceZ(zIndexes[i], zHeights[i], onFlat, onLine, zThick[i]); sliceZ(zIndexes[i], zHeights[i], onFlat, onLine, zThick[i]);
onupdate(i / zIndexes.length); onupdate(i / zIndexes.length);
} }
@ -365,18 +369,14 @@
function sliceZ(z, height, onflat, online, thick) { function sliceZ(z, height, onflat, online, thick) {
let phash = {}, let phash = {},
lines = [], lines = [],
slice = newSlice(z, options.view ? options.view.newGroup() : null), slice = newSlice(z),
bucket = bucketCount == 1 ? points : buckets[Math.floor(z * zScale)]; points = buckets[Math.floor(z * zScale)].points;
if (!bucket) {
return;
}
// iterate over matching buckets for this z offset // iterate over matching buckets for this z offset
for (let i = 0; i < bucket.length;) { for (let i = 0; i < points.length; ) {
p1 = bucket[i++]; p1 = points[i++];
p2 = bucket[i++]; p2 = points[i++];
p3 = bucket[i++]; p3 = points[i++];
let where = {under: [], over: [], on: []}; let where = {under: [], over: [], on: []};
checkUnderOverOn(p1, z, where); checkUnderOverOn(p1, z, where);
checkUnderOverOn(p2, z, where); checkUnderOverOn(p2, z, where);
@ -447,8 +447,6 @@
}); });
slices.push(slice); slices.push(slice);
return slice;
} }
} }

View file

@ -463,7 +463,7 @@
bounds: widget.getBoundingBox(), bounds: widget.getBoundingBox(),
height: sliceHeight, height: sliceHeight,
type: newType, type: newType,
cache: params._range !== true && lastType === newType, cache: params._range !== true && lastType === newType && !doConcurrent,
promises promises
}); });
lastType = newType; lastType = newType;