Finally on the home stretch for flo_curves. The curve offsetting algorithm I was using was very buggy and was producing some very odd shapes as a result which was very handy for finding bugs.
I posted this sketch of Flo (flowbetweenās mascot) a few weeks ago as my goal. Itās a few hundred complicated paths and adding them together has always just resulted in a mess before due to random issues determining where rays enter or leave the shape, but this evening everything finally actually worked. The set of source paths are shown bottom-left, and the result of adding and subtracting them until thereās only a single path is at the top-right:
I probably need to work on the performance a bit still, and there are still some configurations that produce bad rays, like this one resulting from a nonsense path from the old offsetting algorithm (ray is in red, though thatās not a lot of help in spotting it in this mess. Other line colours indicate the current state of the algorithm):
I think itās the direct hit on the intersection near a point where the curve moves just barely above the ray thatās caused an issue, but itās somewhat hard to tell as itās pretty hard to work out which lines are inside or outside even by hand. The circles here (indicating end points of curves) have a radius of 1px to give a sense of scale. I think itās in the nature of the algorithm that some configurations will cause issues like this, so Iāve added a heuristic that āhealsā any holes that might result in the boundary.