fix negative slice spans, error handling in promise chain, rebuild cleanup

This commit is contained in:
Stewart Allen 2022-01-27 12:29:48 -05:00
commit 6485e54280
4 changed files with 23 additions and 17 deletions

View file

@ -106,11 +106,6 @@
}
}
/** short-circuit for microscopic and invalid objects */
if (zMax == 0 || zSum == 0 || points.length == 0) {
return [];
}
/**
* bucket polygons into z-bounded groups (inside or crossing)
* to reduce the search space in complex models
@ -130,6 +125,11 @@
});
}
/** short-circuit for microscopic and invalid objects */
if (zSpan == 0 || zSum == 0 || points.length == 0) {
return {};
}
// create empty buckets
for (i = 0; i < bucketCount + 1; i++) {
buckets.push({ points: [], slices: [] });