fix polygon perimeter() and restore gyroid filter

This commit is contained in:
Stewart Allen 2021-06-20 18:59:59 -04:00
commit f12b3f2e9f
2 changed files with 2 additions and 2 deletions

View file

@ -1338,7 +1338,7 @@
* @returns {number} perimeter length (sum of all segment lengths) * @returns {number} perimeter length (sum of all segment lengths)
*/ */
PRO.perimeter = function() { PRO.perimeter = function() {
if (this.perim !== 0.0) { if (this.perim) {
return this.perim; return this.perim;
} }

View file

@ -140,7 +140,7 @@
} }
} }
polys = connectOpenPolys(polys); polys = connectOpenPolys(polys);
for (let poly of polys) { for (let poly of polys.filter(p => p.perimeter() > 2)) {
target.newline(); target.newline();
for (let point of poly.points) { for (let point of poly.points) {
target.emit(point.x, point.y); target.emit(point.x, point.y);