@jwz Do you remember GLU? It had a perfectly good tesselator, and it turns out to be easy enough to separate from the open source GLU code into being standalone. I've done it once, and the libtess2 above is that too but cleaner than my old attempt. In general it's surprising how much good primitive game/graphics tech you can get by raiding either GLU or the old CPU renderers in Mesa.
Oh, btw, I guess the nanosvg I was using was this minor fork for better units support:
https://github.com/mcclure/nanosvg/tree/mermaid-hacks