From 5ef402b72db68abfab20c4b892ec9c5f0f00fb02 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Fri, 25 Jun 2021 10:28:39 -0400 Subject: [PATCH] bless a poly simple algo --- src/geo/polygon.js | 7 +++++++ src/mode/fdm/slice.js | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/geo/polygon.js b/src/geo/polygon.js index 0ddaacbf..25a151ba 100644 --- a/src/geo/polygon.js +++ b/src/geo/polygon.js @@ -1428,6 +1428,13 @@ return poly; }; + /** + * shortcut to de-rez poly + */ + PRO.simple = function() { + return this.clean(true, undefined, Math.min(CONF.clipper / 10, CONF.clipperClean * 5)); + }; + /** * simplify and merge collinear. only works for single * non-nested polygons. used primarily in slicer/connectLines. diff --git a/src/mode/fdm/slice.js b/src/mode/fdm/slice.js index 122a7703..7da70c8f 100644 --- a/src/mode/fdm/slice.js +++ b/src/mode/fdm/slice.js @@ -94,7 +94,8 @@ } // add simple (low rez poly) where less accuracy is OK for (let top of nutops) { - top.simple = top.poly.clean(true, undefined, CONF.clipper / 10); + // top.simple = top.poly.clean(true, undefined, CONF.clipper / 10); + top.simple = top.poly.simple(); } data.tops = nutops; };