//=time() ?>
In fact, throwing a intersections.sort() onto it seems to work really well. I think there's still some weird edge cases to discover but, huh.
I say that but hey it seems like at least a basic support for non-convexity isn't so bad after all. Ain't perfect though.
Works-ish for arbitrary polygons, as expected; behavior for either self-intersecting or non-convex polygons is not something this is intended to support, though maybe I'm getting away with self-intersecting anyway (so long as none of the discrete chunks are non-convex)?
like took all of twenty seconds from google image search to completion, look how bad it is