change the way rotation offsets are handled on the belt. appears to fix multi-part + support + anchor causing floating parts

This commit is contained in:
Stewart Allen 2021-04-27 21:53:21 -04:00
commit fe525b34f2
4 changed files with 18 additions and 25 deletions

View file

@ -332,8 +332,9 @@
// also find max width of first 5 layers
let start;
let minx = Infinity, maxx = -Infinity;
let peek = 0;
for (let slice of slices) {
if (slice.index < 5) {
if (slice.groups.length && peek++ < 5) {
for (let poly of slice.topPolys()) {
minx = Math.min(minx, poly.bounds.minx);
maxx = Math.max(maxx, poly.bounds.maxx);