fix offsetting open polys with array offsets
This commit is contained in:
parent
9da67ea66d
commit
ac29d16bcc
1 changed files with 1 additions and 2 deletions
|
|
@ -600,7 +600,7 @@ export function expand(polys, distance, z, out, count, distance2, collector, min
|
||||||
export function offset(polys, dist, opts = {}) {
|
export function offset(polys, dist, opts = {}) {
|
||||||
let open = opts.open ? polys.filter(p => p.open) : [];
|
let open = opts.open ? polys.filter(p => p.open) : [];
|
||||||
if (open.length) {
|
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));
|
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);
|
polys = fromClipperTree(tree, zed, null, null, mina);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// if specified, perform offset gap analysis
|
// if specified, perform offset gap analysis
|
||||||
if (opts.gaps && polys.length) {
|
if (opts.gaps && polys.length) {
|
||||||
let oneg = offset(polys, -offs, {
|
let oneg = offset(polys, -offs, {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue