drop wipe endpoints outside centering poly. drop fill attempt for anchor lines

This commit is contained in:
Stewart Allen 2021-02-09 19:08:28 -05:00
commit beeea2387c
4 changed files with 14 additions and 4 deletions

View file

@ -544,7 +544,10 @@
let last = array.last(); let last = array.last();
last.retract = true; last.retract = true;
if (wipeDist && lastPoly && last.point) { if (wipeDist && lastPoly && last.point) {
addOutput(array, last.point.followTo(lastPoly.center(true), wipeDist)); let endpoint = last.point.followTo(lastPoly.center(true), wipeDist);
if (endpoint.inPolygon(lastPoly)) {
addOutput(array, endpoint);
}
} }
} else if (opt.pretract) { } else if (opt.pretract) {
opt.pretract(wipeDist); opt.pretract(wipeDist);

View file

@ -608,7 +608,8 @@ self.onmessage = function(e) {
data: output data: output
}); });
} catch (wrkerr) { } catch (wrkerr) {
console.log({wrkerr}); // console.log(wrkerr);
console.trace(wrkerr.stack);
send.done({error: wrkerr.toString()}); send.done({error: wrkerr.toString()});
} }
} else { } else {

View file

@ -409,7 +409,10 @@
let lastOut = lastLayer.last(); let lastOut = lastLayer.last();
lastOut.retract = true; lastOut.retract = true;
if (wipeDist && lastPoly && lastOut.point) { if (wipeDist && lastPoly && lastOut.point) {
print.addOutput(lastLayer, lastOut.point.followTo(lastPoly.center(true).add(offset), wipeDist)); let endpoint = lastOut.point.followTo(lastPoly.center(true).add(offset), wipeDist);
if (endpoint.inPolygon(lastPoly)) {
print.addOutput(lastLayer, endpoint);
}
} }
} }
} }

View file

@ -943,6 +943,10 @@
// create empty filled line array for each top // create empty filled line array for each top
tops.forEach(function(top) { tops.forEach(function(top) {
// synth belt anchor tops don't want fill
if (!top.fill_lines) {
return;
}
const tofill = []; const tofill = [];
const angfill = []; const angfill = [];
const newfill = []; const newfill = [];
@ -968,7 +972,6 @@
top.fill_lines_ang.poly.push(af.clone()); top.fill_lines_ang.poly.push(af.clone());
}); });
} }
top.fill_lines.appendAll(newfill); top.fill_lines.appendAll(newfill);
}); });