Improve robustness and performance of the boolean operation algorithm (#2191)

* Improve perf of path bool lib

* Use swap remove

* Use outer/inner bounding box for inclusion testing

* Reuse allocations for hit testing

* Use direct root finding for inclusion testing

* Reuse bounding box

* Use faster hash and specify capacities

* Use hashmap based approach for find vertices

* Unroll find_vertecies loop and use 32 bit positions

* Tune initial vec capacities

* Remove unused bounding boxes

* Use smallvec for storing outgoing edges

* Improve allocations for compute_minor

* Use approximate bounding box for edge finding

* Transition aabb to use glam vecs

* Make find vertecies use 64 bit again this is slower but less likely to cause issues

* Improve intersection candidate finding

* Remove loop check in bit vec iter

* Special case cubic line intersections

* Optimize grid rounding and add debug output

* Remove file write

* Remove faulty line intersection

* Fix grid rounding

* Improve robustness and cleanaup code

* Make elided lifetime explicit

* Fix tests

* Fix a boolean ops crash

* Add comment

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Dennis Kobert
2025-08-22 01:15:36 +02:00
committed by GitHub
parent e4dd3ce806
commit a4ec50d8ba
11 changed files with 596 additions and 378 deletions

9
Cargo.lock generated
View File

@@ -3859,7 +3859,10 @@ dependencies = [
"lyon_geom",
"regex",
"resvg",
"roots",
"rustc-hash 2.1.1",
"slotmap",
"smallvec",
"svg",
]
@@ -4687,6 +4690,12 @@ dependencies = [
"serde_derive",
]
[[package]]
name = "roots"
version = "0.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "082f11ffa03bbef6c2c6ea6bea1acafaade2fd9050ae0234ab44a2153742b058"
[[package]]
name = "roxmltree"
version = "0.20.0"