You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.7 KiB
OpenSCAD

//BSP_form();
//BSP_thread(pitch=25.4/14,dia=1.041*25.4,threads = 7,draw_inc=1000);
//**************************************************
//Horrible module to rotate a slice
//**************************************************
module BSP_thread(pitch=1.814,dia=18.613,threads = 1,draw_inc=360){
a_move = (360*threads)/draw_inc;
function x_move(i) = dia-(sin(i*a_move)*dia);
function y_move(i) = dia+(cos(i*a_move)*dia);
function z_move(i) = i * (pitch*threads)/draw_inc;
function z_rot(i) = 90 + (i * a_move);
union(){
for(i = [0:draw_inc])
{
echo(i,x_move(i),y_move(i),z_move(i));
translate([x_move(i),
y_move(i),
z_move(i)])
rotate([90,
0,
z_rot(i)])
linear_extrude(height = 2.2*(threads*3.142*dia)/draw_inc,
center = true,
convexity = 10,
twist = 0,
$fn = 100)
BSP_form(P=pitch,D=dia,AA=55);
}
}
}
//**************************************************
//Flat Thread Form For Extrusion
//**************************************************
module BSP_form( male=true, P=1.814,D=18.613,AA=55,$fn=30){
/* male, is the form a male of female thread
P, Pitch
D, diameter
AA, form angle
*/
tr = P * 0.137329; //end radius
th = P*0.640327; //thread form height
AA2 = AA/2; //functional angle
tvv = cos(AA2)*tr; //height of tangent point
thv = sin(AA2)*tr; //horizontal of tanget
cc = (th)-tr; //end radius circle centre
tc = cc + thv;
thh = tan(AA2)*th;
tbh = thh + tvv;
//echo(tvv,thv,tc,thh);
//**************************************************
//rotate([90,0,0])
union(){
translate([cc,0])circle(r=tr);
polygon(points = [ [0, tbh],
[tc, tvv],
[tc, -tvv],
[0, -tbh]]);
}
1 year ago
}