fix shell depth cues used for extrusion speed
This commit is contained in:
parent
ae9cd843c1
commit
4a0a000ef9
2 changed files with 20 additions and 0 deletions
|
|
@ -550,6 +550,7 @@
|
|||
let total = count;
|
||||
let layers = [];
|
||||
let ref = polys;
|
||||
let depth = 0;
|
||||
while (count-- > 0 && ref && ref.length) {
|
||||
let off = offset(ref, -dist, {z});
|
||||
let mid = offset(off, dist / 2, {z});
|
||||
|
|
@ -563,6 +564,15 @@
|
|||
subtract(ref, cmp, gap, null, z);
|
||||
}
|
||||
layers.push({idx: total-count, off, mid, gap});
|
||||
// fixup depth cues
|
||||
for (let m of mid) {
|
||||
m.depth = depth++;
|
||||
if (m.inner) {
|
||||
for (let mi of m.inner) {
|
||||
mi.depth = m.depth;
|
||||
}
|
||||
}
|
||||
}
|
||||
ref = off;
|
||||
}
|
||||
return layers;
|
||||
|
|
|
|||
|
|
@ -609,6 +609,11 @@
|
|||
if (p.fill_off) {
|
||||
p.fill_off.forEach(pi => pi.depth = i);
|
||||
}
|
||||
if (p.inner) {
|
||||
for (let pi of p.inner) {
|
||||
pi.depth = p.depth;
|
||||
}
|
||||
}
|
||||
top.shells.push(p);
|
||||
});
|
||||
last = polys;
|
||||
|
|
@ -643,6 +648,11 @@
|
|||
// use negative offset for inners
|
||||
pi.depth = -(count - countNow);
|
||||
});
|
||||
if (p.inner) {
|
||||
for (let pi of p.inner) {
|
||||
pi.depth = p.depth;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue