diff --git a/src/kiri/layers.js b/src/kiri/layers.js index e96df07e..8d73a35d 100644 --- a/src/kiri/layers.js +++ b/src/kiri/layers.js @@ -85,6 +85,9 @@ } addPolys(polys, options) { + if (options && options.clean) { + polys = polys.map(p => p.clean()); + } if (options && options.flat) { return this.addFlats(polys, options); } @@ -200,8 +203,6 @@ const contour = []; poly = poly.debur(0.05); if (!poly) return; - poly = poly.clean(); - if (!poly) return; poly = poly.miter(); poly.points.forEach(p => { contour.push(new THREE.Vector2(p.x, p.y)); diff --git a/src/mode/fdm/slice.js b/src/mode/fdm/slice.js index 5b041f83..70e5aef4 100644 --- a/src/mode/fdm/slice.js +++ b/src/mode/fdm/slice.js @@ -484,7 +484,7 @@ if (top.shells) output .setLayer("shells", isSynth ? COLOR.support : COLOR.shell) - .addPolys(top.shells, vopt({ offset, height })); + .addPolys(top.shells, vopt({ offset, height, clean: true })); if (top.gaps) output .setLayer("gaps", COLOR.gaps)