From ac29d16bcc6f8242065e3033cc9990e5e12747c1 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sat, 13 Dec 2025 16:55:56 -0500 Subject: [PATCH] fix offsetting open polys with array offsets --- src/geo/polygons.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/geo/polygons.js b/src/geo/polygons.js index f6e30f35..c92bcc34 100644 --- a/src/geo/polygons.js +++ b/src/geo/polygons.js @@ -600,7 +600,7 @@ export function expand(polys, distance, z, out, count, distance2, collector, min export function offset(polys, dist, opts = {}) { let open = opts.open ? polys.filter(p => p.open) : []; if (open.length) { - open = open.map(p => paths.pointsToPath(p.points, dist, true)); + open = open.map(p => paths.pointsToPath(p.points, Array.isArray(dist) ? dist[0] : dist, true)); open = open.map(p => newPolygon().setOpen().addPoints(p.right)); } @@ -655,7 +655,6 @@ export function offset(polys, dist, opts = {}) { polys = fromClipperTree(tree, zed, null, null, mina); } - // if specified, perform offset gap analysis if (opts.gaps && polys.length) { let oneg = offset(polys, -offs, {