From f12b3f2e9f6185bb376980cb265359a76df42544 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sun, 20 Jun 2021 18:59:59 -0400 Subject: [PATCH] fix polygon perimeter() and restore gyroid filter --- src/geo/polygon.js | 2 +- src/mode/fdm/fill.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/geo/polygon.js b/src/geo/polygon.js index bc87b87b..2096faac 100644 --- a/src/geo/polygon.js +++ b/src/geo/polygon.js @@ -1338,7 +1338,7 @@ * @returns {number} perimeter length (sum of all segment lengths) */ PRO.perimeter = function() { - if (this.perim !== 0.0) { + if (this.perim) { return this.perim; } diff --git a/src/mode/fdm/fill.js b/src/mode/fdm/fill.js index a8a24edc..d6f1fa00 100644 --- a/src/mode/fdm/fill.js +++ b/src/mode/fdm/fill.js @@ -140,7 +140,7 @@ } } polys = connectOpenPolys(polys); - for (let poly of polys) { + for (let poly of polys.filter(p => p.perimeter() > 2)) { target.newline(); for (let point of poly.points) { target.emit(point.x, point.y);