clw =true; // direction of spiral p = 1.4; // pitch of thread spiral n = 12; // number of 'threads' res = 100; // number of 'steps' in circle db = 26.9; // diam of os of spiral at base dt = 24.91; // diam of spiral at top // for non tapered thread, make dt =db; d = 1; // diam of 'wire' //////////////////// use t = n*res; //total number of steps s = (res/360)*db/2; // width of profile v = p/res; // vertical shift per inc of rotation //a = 360/res; // angle per step a=clw==true ? +360/res : -360/res; module profile1(){ circle (d,$fn=3); translate([-2.72,0]) square([5-d/2,d*1.72],true); //circle (d=d) // whatever 'profile' you like // square(d,true); } module profile(){ translate ([-0.160083*p,p/2]) rotate([0,0,-86.6]) prof(p); translate([-2.5,0]) square([5.5-d/2,p],true); } module xsec(v){ $fn=80; s=(res/360)*v; translate([v-(d/2),0,0]) rotate([90,0,0]) linear_extrude(s/2) profile(); } module screw(){ for (i=[0:1:t]){ k=db-(i*(db-dt)/t); translate([0,0,i*v]) rotate([0,0,i*a]) xsec(k/2); } } screw(); // remove above line and uncomment below for tapered plug. /* $fn=80; // make tapered threaded stop end intersection(){ sphere(18.5); // difference(){ union(){ screw(); cylinder (h=15,d=dt-5); // fill core } translate ([-50,-50,15])cube(100); // cut off top } } // head translate([0,0,-4.9]) cube([db+5,db+5,10],true); cylinder(d=db+2,h=0.5); */