Henry00IS / ShapeEditor

2D Shape Editor for Unity Editor to create complex 3D meshes out of 2D shapes with RealtimeCSG support.
MIT License
101 stars 9 forks source link

[50$ Bounty] PolyBool can cause an editor crash on T-Junctions #17

Open Henry00IS opened 2 years ago

Henry00IS commented 2 years ago

Two shapes that look like a B

Boolean operations mistakenly consider these two shapes as a single shape with an infinitely thin point connecting them, causing the convex decomposition to fail. This will then cause a stack overflow and editor crash in the BayazitDecomposer. The splitting of this type of polygon at the singularity has yet to be fixed.

It's likely that PolyBoolJS (and thus PolyBoolCS) has this as an oversight in their algorithm. They scan lines vertically and end up merging them together. Maybe this is correct in their eyes. But we need a way to detect and split these singularities into multiple shapes. Whether you fix it here as a post-process or there in the core algorithm, it would be an incredible achievement and I will be super thankful!

Example Projects: S2D Projects Bad.zip

The payment of 50$ (or 50€ if preferred) will be made via PayPal after verifying your work.