import math

# size in mm
mill = 0.8
circ = 2.54 
zmax = -22
step = 5

r = (circ-mill)/2

def hole(xpos,ypos):
    print ('G00 Z5.0')
    print ('G00 X{0:.4f} Y{1:.4f}' .format( xpos, ypos + r))

    for z in range (-2, zmax, -2):
        print ('G01 F50')
        print ('G01 Z{0:.4f}' .format(z/10))
        print ('G01 X{0:.4f} Y{1:.4f}' .format( xpos, ypos + r))
        for i in range (0,360,step*3):
            print ('G01 X{0:.4f} Y{1:.4f}' .format(xpos + r * math.sin(math.radians(i)) , ypos + r * math.cos(math.radians(i))))
        print ('G01 X{0:.4f} Y{1:.4f}' .format( xpos, ypos + r))
                
    print ('G00 Z5.0')

hole(11.731625, 8.73125)
hole(65.7225,  8.73125)
hole(113.3475,  8.73125)
hole(191.35725, 21.43125)
hole(183.35625, 40.48125)
hole(138.1125,40.48125)
hole(92.86875,40.48125)
hole(35.71875,40.48125)
hole(11.731625, 59.53125)
hole(36.83, 78.58125)
hole(74.93, 78.58125)
hole(113.03, 78.58125)
hole(160.655, 78.58125)
hole(51.47825, 109.22)
hole(137.95375, 109.22)
