I want to be able to pick the centre and radius of the circle, the start and sweep angles. I’ve chosen that vertical is 0°, and I imagine drawing the arc in a clockwise direction.
I’m not interested in extending an existing path, or creating new lines beyond the arc – I really just want a single arc. I got it working, after lots of time spent in the MDN docs for the
<path> element. It feels like something that might be useful elsewhere, so I’ve pulled it out as a standalone piece.
I wrote a small Python helper function:
This is a case where source code as plain text feels really limiting. Both this snippet and the bigger project have a bunch of geometry code, and it’d be really useful to be able to insert small diagrams in the comments to explain what I’m doing. Words are okay, but they’re no substitute for pictures.