-
Notifications
You must be signed in to change notification settings - Fork 0
/
slug_top10.scad
61 lines (51 loc) · 1.81 KB
/
slug_top10.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// slug top - 10mm slug top
//
// mates to 4-40 screw
//
function scaler(n) = n * 0.254 * 1.02;
// convert 1/100 inch to millimeters
// with 1.02 shrink factor
function anti_scaler(n) = (n / 0.254) / 1.02;
// bottle cap 1-27/32" inside thread, 1-7/8 inside of cap
// 1/8" pitch, 370 degrees, inside height btwn 3/8" and 13/32"
// thread diameter 1/32" (approximately)
$to=scaler(12.6)/2; // about 1/8"
$ww=9.5/2 - $to; // wall width for 9.5mm
$bt=1; // 1mm bottom thickness
$ch=scaler(12.5); // 1/8" height
$tp=scaler(100/40); // thread pitch 1/40" 4-40
$tb=scaler(4); // .04" gap from top
// max diameter 0.1112. 0.0950
$td=scaler(0.8); // thread depth 0.008"
$aa=360*4; // total angular thread motion
$dy=0.1; // delta Y for loops
$ii=6; // 3 degrees iteration on thread
// accuracy parameters
$fn=30; // number of faces in shape
union()
{
color("red")
translate([0,0,0]) // top of bottle cap
linear_extrude(height=$bt)
circle($to+$ww, center=true);
color("magenta")
difference()
{
translate([0,0,$bt-1]) // position of bottle cap ring
linear_extrude(height=$ch)
circle($to+$ww, center=true);
translate([0,0,$bt]) // position of bottle cap ring
linear_extrude(height=$ch+1)
circle($to, center=true);
};
// threads on bottle cap - a bit hackish but it works
color("yellow")
for(i3=[0:$ii:$aa])
{
translate([cos(i3)*$to,sin(i3)*$to,$bt+$ch - $tb - $td - ($tp*$aa/360) + ($tp*i3/360)]) //$ph+scaler(10)+$ww+$ch])
rotate(a=[90,-90,i3])
linear_extrude(height=$ww*2, center=true)
//circle($td, center=true);
polygon(points=[[-$td,scaler(1)], [$td,-scaler(1)], [0,1.5*$td]], $center=true); // equilateral triangle
}
};