add dogbones as an outline option

This commit is contained in:
Stewart Allen 2020-12-03 19:51:14 -05:00
commit 83de534a52
5 changed files with 51 additions and 6 deletions

View file

@ -173,11 +173,14 @@
for (let i=1; i<oldpts.length + 1; i++) {
let nextpt = oldpts[i % oldpts.length];
let nextsl = lastpt.slopeTo(nextpt).toUnit();
if (lastsl.angleDiff(nextsl) >= 10 && lastpt.distTo2D(nextpt) >= knifeTipOff) {
arc(lastpt, lastsl, nextsl, newpts);
// let tmp;
// newpts.push( tmp = lastpt.projectOnSlope(lastsl, knifeTipOff) );
// newpts.push( lastpt.projectOnSlope(nextsl, knifeTipOff) );
if (lastsl.angleDiff(nextsl) >= 10) {
if (lastpt.distTo2D(nextpt) >= knifeTipOff) {
arc(lastpt, lastsl, nextsl, newpts);
} else {
// todo handle short segments
// newpts.push(lastpt.projectOnSlope(lastsl, knifeTipOff) );
// newpts.push( lastpt.projectOnSlope(nextsl, knifeTipOff) );
}
}
newpts.push(nextpt);
lastsl = nextsl;