def create_round_meander(radius, theta=0, offset=Point()):
    
    deg_to_rad = 2 * pi / 360

    r = radius
    t = theta * deg_to_rad
    
    # The calculation to obtain the 'k' coefficient can be found here:
    # http://itc.ktu.lt/itc354/Riskus354.pdf
    # "APPROXIMATION OF A CUBIC BEZIER CURVE BY CIRCULAR ARCS AND VICE VERSA"
    # by Aleksas Riskus
    k = 0.5522847498
 
    # the control points need to be shortened relative to the angle by this factor
    j = 2*t/pi

    path =  "m %s,%s " % (-2*r*cos(t)-offset.x, -offset.y)
    path += "c %s,%s %s,%s %s,%s " % (-k*r*j*sin(t),-k*r*j*cos(t), -(r-r*cos(t)),-r*sin(t)+r*k*j, -(r-r*cos(t)),-r*sin(t))     
    path += "c %s,%s %s,%s %s,%s " % (0,-k*r, r-k*r,-r, r,-r) 
    path += "c %s,%s %s,%s %s,%s " % (k*r,0, r,r-k*r, r,r)
    path += "c %s,%s %s,%s %s,%s " % (0,k*r*j, -(r-r*cos(t)-k*r*j*sin(t)),r*sin(t)-r*k*j*cos(t), -r+r*cos(t),r*sin(t))     
    path += "c %s,%s %s,%s %s,%s " % (-k*r*j*sin(t),k*r*j*cos(t), -(r-r*cos(t)),r*sin(t)-r*k*j, -(r-r*cos(t)),r*sin(t)) 
    path += "c %s,%s %s,%s %s,%s " % (0,k*r, r-k*r,r, r,r) 
    path += "c %s,%s %s,%s %s,%s " % (k*r,0, r,-r+k*r, r,-r)
    path += "c %s,%s %s,%s %s,%s "  % (0,-k*r*j, -(r-r*cos(t)-k*r*j*sin(t)),-r*sin(t)+r*k*j*cos(t), -r+r*cos(t),-r*sin(t))     
                 
    return path
Returns a single period of a meandering path based on radius
dataset/ETHPy150Open boldport/pcbmode/pcbmode/utils/svg.py/create_round_meander