fix draft shield for elements extending beyond base
This commit is contained in:
parent
33ce0c715e
commit
aaa5d0fa46
1 changed files with 21 additions and 9 deletions
|
|
@ -74,15 +74,27 @@
|
||||||
// compute first brim
|
// compute first brim
|
||||||
widgets.filter(w => w.slices.length).forEach(function(widget) {
|
widgets.filter(w => w.slices.length).forEach(function(widget) {
|
||||||
let tops = [];
|
let tops = [];
|
||||||
|
let slices = [];
|
||||||
|
if (draftShield) {
|
||||||
|
slices.appendAll(widget.slices);
|
||||||
|
} else {
|
||||||
|
slices.push(widget.slices[0]);
|
||||||
|
}
|
||||||
|
for (let slice of slices) {
|
||||||
// collect top outer polygons
|
// collect top outer polygons
|
||||||
widget.slices[0].tops.forEach(function(top) {
|
if (slice.tops)
|
||||||
|
slice.tops.forEach(function(top) {
|
||||||
tops.push(top.poly.clone());
|
tops.push(top.poly.clone());
|
||||||
});
|
});
|
||||||
// collect support polygons
|
// collect support polygons
|
||||||
if (widget.slices[0].supports)
|
if (slice.supports)
|
||||||
widget.slices[0].supports.forEach(function(support) {
|
slice.supports.forEach(function(support) {
|
||||||
tops.push(support.clone());
|
tops.push(support.clone());
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
if (draftShield) {
|
||||||
|
tops = POLY.union(tops,1,true);
|
||||||
|
}
|
||||||
// nest and offset tops
|
// nest and offset tops
|
||||||
POLY.nest(tops).forEach(function(poly) {
|
POLY.nest(tops).forEach(function(poly) {
|
||||||
let off = poly.offset(-offset + nozzle / 2);
|
let off = poly.offset(-offset + nozzle / 2);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue