Add a stack-based Boolean Operation layer node (#1813)

* Multiple boolean operation node

* Change boolean operation ordering

* Complete layer boolean operation node

* Automatically insert new boolean operation node

* Remove divide operation

* Fix subtract operations

* Remove stack data from boolean operation properties

* Fix images and custom vectors

* Code cleanup

* Use slice instead of iter to avoid infinite type recursion

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
adamgerhant
2024-07-10 02:12:55 -07:00
committed by GitHub
parent f4e3e5ab2a
commit 9d749c49fb
14 changed files with 319 additions and 153 deletions

View File

@@ -20,10 +20,6 @@ export function booleanDifference(path1: string, path2: string): string {
return booleanOperation(path1, path2, "exclude");
}
export function booleanDivide(path1: string, path2: string): string {
return booleanOperation(path1, path2, "intersect") + booleanOperation(path1, path2, "exclude");
}
function booleanOperation(path1: string, path2: string, operation: "unite" | "subtract" | "intersect" | "exclude"): string {
const paperPath1 = new paper.CompoundPath(path1);
const paperPath2 = new paper.CompoundPath(path2);