# Customized where-dial gear cutting #1308

Open
opened this issue Nov 6, 2019 · 1 comment
Assignees

 Here's the hacky script to generate a numeric wheredial. Need to load the output into inkscape, select the words, convert object to path, and then save as dxf. Should cut 3mm acrylic with: engrave 250 50, cut at 12 70 ```import math def dsin(a): return math.sin(math.radians(a)) def dcos(a): return math.cos(math.radians(a)) svgtemplate = """ """ txtbit = """ %s """ words = ["zero", ("one",1), ("two",1), "three", "four", "five", "six", "seven", "eight", "nine", "ten", ("eleven",3)] ginnerrad = 61 gouterrad = 66 gearteeth = 60 toothang = 360/gearteeth toothtransrad = 10 toothwidth = toothang*0.39 toothtrans = toothang*0.05 circlerad = 85 textrad = 74 triangleinnerrad = 66.9 triangleouterrad = 70 triangledegwidth = 3 stxtblock = [ ] for i, w in enumerate(words): dpos = 0 if type(w) == tuple: dpos = w[1] w = w[0] dpos += len(w)*2 stxtblock.append(txtbit%(i/len(words)*360-dpos, w)) txtblock = "\n".join(stxtblock) strianglepath = [ ] for i in range(len(words)): ttip = i/len(words)*360 tleft = ttip-triangledegwidth/2 tright = ttip+triangledegwidth/2 strianglepath.append("M%.3f,%.3f" % (triangleinnerrad*dsin(ttip), triangleinnerrad*dcos(ttip))) strianglepath.append("L%.3f,%.3f" % (triangleouterrad*dsin(tleft), triangleouterrad*dcos(tleft))) strianglepath.append("L%.3f,%.3f" % (triangleouterrad*dsin(tright), triangleouterrad*dcos(tright))) strianglepath.append("Z") trianglepath = " ".join(strianglepath) toothstartang = -(toothang-toothwidth-2*toothtrans)/2 sgearpath = ["M%.3f,%.3f" % (gouterrad*dsin(toothstartang), gouterrad*dcos(toothstartang))] for i in range(gearteeth): t0 = i*toothang+toothstartang t4 = (i+1)*toothang+toothstartang t3 = t4 - toothtrans t2 = t3 - toothwidth t1 = t2 - toothtrans sgearpath.append("A%.3f %.3f 0 0 0 %.3f,%.3f" % (gouterrad, gouterrad, gouterrad*dsin(t1), gouterrad*dcos(t1))) sgearpath.append("A%.3f %.3f 0 0 0 %.3f,%.3f" % (toothtransrad, toothtransrad, ginnerrad*dsin(t2), ginnerrad*dcos(t2))) sgearpath.append("A%.3f %.3f 0 0 0 %.3f,%.3f" % (ginnerrad, ginnerrad, ginnerrad*dsin(t3), ginnerrad*dcos(t3))) sgearpath.append("A%.3f %.3f 0 0 0 %.3f,%.3f" % (toothtransrad, toothtransrad, gouterrad*dsin(t4), gouterrad*dcos(t4))) gearpath = " ".join(sgearpath) fout = open("test4.svg", "w") fout.write(svgtemplate.format(circlerad=circlerad, textrad=textrad, textblock=txtblock, gearpath=gearpath, trianglepath=trianglepath)) fout.close()```