sba0Àa€À_ __namea0c__scriptTimport math import fab from fab import shapes title('wedm') w_d = 0.5 #mm c_d = 0.375*25.4 #mm c_l = 1.*25.4 bore_diam = 3 pitch = 10. # helix angle #lambda = 4.5 #degrees c = shapes.cylinder(0,0,0,c_l,c_d) w = shapes.cylinder(.7*c_d,-.3,-2*c_d,2*c_d,w_d) w = fab.shapes.rotate_x(w,90) w = fab.shapes.rotate_x(w,7.5) ww = w sweep_profile = shapes.translate(w,0,0,0) | shapes.translate(w,0,0,w_d) | shapes.translate(w,0,0,2*w_d) | shapes.translate(w,0,0,3*w_d) | shapes.translate(w,w_d,0,-w_d) | shapes.translate(w,w_d,0,4*w_d) resolution = 50 # steps/rev d_theta = 360./resolution #100 steps/rev d_z = pitch/resolution for i in range(resolution): ww |= shapes.translate(shapes.rotate_z(sweep_profile,i*d_theta),0,0,i*d_z) out = c&~ww out = out&~shapes.cylinder(0,0,0,c_l,bore_diam) output('c', out)