I started from this
nice approximation of a perfect circle
based on
cubic Bézier segments, where they show that a good approximation
to a quarter circle of unit radius is a cubic Bézier curve with control points
P
0
= (0, 1),
P
1
= (
c
, 1),
P
2
= (1,
c
),
P
3
= (1, 0) where c = 0.551915024494.
For example we can use this SVG, with the control points shown in red:
<path d="M0,1 C0.552,1 1,0.552 1,0"/>
To draw a full circle, we just chain four of these together, using a path like this:
<path d="M0,1 C0.552,1 1,0.552 1,0 S0.552,-1 0,-1 S-1,-0.552 -1,0 S-0.552,1 0,1"/>
To make an approximate circle, it's more convenient to work in polar coordinates, where we represent points using a radius and angle, ( r, θ ), relative to the origin. So the four control points for each arc, in polar coordinates, become P 0 = (1, 0), P 1 = ( d, β ), P 2 = ( d, π /2 - β ), P 3 = (1, π /2), where β = tan -1 ( c ) and d = √ ( c 2 + 1).
Now we just need to add a bit of randomness as we generate the path. I decided to do this in four ways:
Radius variation (0: none, <0: shrink, >0: grow)
Starting angle (0-360):
Rotation variation (0: none, <0: undershoot, >0: overshoot)
Squash factor (1: none, <1: shrink, >1: grow)
Squash orientation (0-360)