diff --git a/src/kiri/core/print.js b/src/kiri/core/print.js index d0487b52..7b6c642c 100644 --- a/src/kiri/core/print.js +++ b/src/kiri/core/print.js @@ -138,16 +138,17 @@ class Print { } poly.forEachPoint((point, pos, points, count) => { - if (first) { - if (options.onfirst) { + if (first || point.skip) { + // if (point.skip) console.log({ skip: point }); + if (first && options.onfirst) { options.onfirst(point); } // move to first output point on poly let out = scope.addOutput(output, point, 0, moveSpeed, tool); - if (options.onfirstout) { + if (first && options.onfirstout) { options.onfirstout(out); } - first = false; + if (first) first = false; } else { let seglen = last.distTo2D(point); if (coastDist && shellMult && perimeter - seglen <= coastDist) { @@ -158,6 +159,7 @@ class Print { shellMult = 0; } perimeter -= seglen; + // to increase shellMult when point.inc set for collapsed points scope.addOutput(output, point, shellMult, printSpeed, tool); } last = point; diff --git a/src/kiri/mode/fdm/post.js b/src/kiri/mode/fdm/post.js index 9a9d43e4..7a86ea94 100644 --- a/src/kiri/mode/fdm/post.js +++ b/src/kiri/mode/fdm/post.js @@ -99,6 +99,37 @@ function offset_default(params) { } } ); + // look for close points on segmented polys + if (false) + for (let poly of POLY.flatten(last)) { + let ps = poly.segment(offset1, true); + let pp = ps.points; + let moved = false; + pp.push(pp[0]); + for (let i=0; i