Separate the Merge node from the Boolean Operation node (#1933)

* Rework boolean operation node

* Set Boolean Operation name for layer

* Remove memoize

* Update both demo artworks that use booleans

* Delete dead code, rename input connectors

* Remove more dead code

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
adamgerhant 2024-08-15 17:36:07 -07:00 committed by GitHub
parent fa981a0897
commit 33739b9ad4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 60 additions and 273 deletions

View file

@ -16,11 +16,7 @@ export function booleanIntersect(path1: string, path2: string): string {
return booleanOperation(path1, path2, "intersect");
}
export function booleanDifference(path1: string, path2: string): string {
return booleanOperation(path1, path2, "exclude");
}
function booleanOperation(path1: string, path2: string, operation: "unite" | "subtract" | "intersect" | "exclude"): string {
function booleanOperation(path1: string, path2: string, operation: "unite" | "subtract" | "intersect"): string {
const paperPath1 = new paper.CompoundPath(path1);
const paperPath2 = new paper.CompoundPath(path2);
const result = paperPath1[operation](paperPath2);