From 4d830c3b12b09363dd0dabc619914128d2cfb3aa Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Tue, 22 Jun 2021 00:01:21 -0400 Subject: [PATCH] add union notes --- src/geo/polygons.js | 5 +++++ src/mode/fdm/slice.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/geo/polygons.js b/src/geo/polygons.js index c0e3ce57..d6d3b505 100644 --- a/src/geo/polygons.js +++ b/src/geo/polygons.js @@ -342,6 +342,11 @@ * Slice.doProjectedFills() * Print.init w/ brims * + * clipper is natively less efficient at merging many polygons. this iterative + * approach skips attempting to merge polys lacking overlapping bounding boxes + * and can quickly check if the attempt to union two polys outputs the same + * two input polys. the latter bit is the key to greater speed. + * * @param {Polygon[]} polys * @returns {Polygon[]} */ diff --git a/src/mode/fdm/slice.js b/src/mode/fdm/slice.js index 05480502..fdf2082a 100644 --- a/src/mode/fdm/slice.js +++ b/src/mode/fdm/slice.js @@ -1034,7 +1034,7 @@ return; } - let unioned = POLY.union(solids, undefined, true).flat(), // TODO verify + let unioned = POLY.union(solids, undefined, true).flat(), isSLA = (spacing === undefined && angle === undefined); if (solids.length === 0) return false;