How Boolean Operations Work in Vector Graphics (Union, Intersection, Difference and XOR from scratch)

I spent a week implementing Union, Intersection, Difference, and XOR for my vector engine. The geometry turned out to be simpler than I expected. The hard part was one function — correctly labeling which side of a boundary each segment is on. 1. Find where the shapes intersect 2. Split both paths at intersection points Now that we have the intersection points for both Path , we need to start…