alt approach to fixing miter render bug

This commit is contained in:
Stewart Allen 2021-04-13 13:31:02 -04:00
commit 401577943c
2 changed files with 4 additions and 3 deletions

View file

@ -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));

View file

@ -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)