Skip to content

Commit

Permalink
Add a method to joinPaths for Clipper
Browse files Browse the repository at this point in the history
  • Loading branch information
caewok committed Jul 23, 2024
1 parent 1727a65 commit d966bef
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ClipperPaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,11 @@ export class ClipperPaths {
}

/**
* Combine 2+ ClipperPaths objects using a union with a positive fill.
* Join paths into a single ClipperPaths object
* @param {ClipperPaths[]} pathsArr
* @returns {ClipperPaths}
*/
static combinePaths(pathsArr) {
static joinPaths(pathsArr) {
const ln = pathsArr.length;
if ( !ln ) return undefined;

Expand All @@ -380,7 +380,17 @@ export class ClipperPaths {

cPaths.paths.push(...obj.paths);
}
return cPaths;
}

/**
* Combine 2+ ClipperPaths objects using a union with a positive fill.
* @param {ClipperPaths[]} pathsArr
* @returns {ClipperPaths}
*/
static combinePaths(pathsArr) {
const cPaths = this.joinPaths(pathsArr);
if ( !cPaths ) return undefined;
return cPaths.combine();
}

Expand Down

0 comments on commit d966bef

Please sign in to comment.