Simple search for intersections became slow for larger concave ngons (100+)
Tested to work with ngons up to 75k sides, performance is approx ~6x faster then scanfill.
This is a 2D version of BLI_kdtree with modifications:
- nodes can be removed
- an index -> node map is stored (especially for tessellation)
Simple/predictable polygon filling functions (no hole support)
originally from libgdx which have some advantages over scanfill.
- always creates the same number of triangles (never any missing faces).
- gives same results for any affine transformation.
- doesn't give so many skinny faces by default.
made some changes for Blender.
- remove last ears first (less to memmove)
- step over the ears while clipping to avoid some verts becoming fans to most of the other.