1 |
Clear=0.175; // size of tolerance zone |
1 |
Clear=0.175; // size of tolerance zone |
2 |
thickness = 2; // global wall thickness |
2 |
thickness = 2; // global wall thickness |
3 |
height = 15; // height of one screen element |
3 |
height = 15; // height of one screen element |
4 |
screen_radius = 75/2; // outer radius of screen |
4 |
screen_radius = 75/2; // outer radius of screen |
5 |
tube_radius=30/2; // inner radius of the space for a sensor |
5 |
tube_radius=30/2; // inner radius of the space for a sensor |
6 |
screen_bevel = 10; // bevel of outer screen wall |
6 |
screen_bevel = 10; // bevel of outer screen wall |
7 |
num_ribs = 3; // number of holding ribs |
7 |
num_ribs = 3; // number of holding ribs |
8 |
cap_radius = screen_radius * 1.5; |
8 |
cap_radius = screen_radius * 1.5; |
9 |
inner_ring_thickness = thickness *2; |
9 |
inner_ring_thickness = thickness *2; |
10 |
|
10 |
|
11 |
|
11 |
|
12 |
angle_sep = 360/num_ribs; |
12 |
angle_sep = 360/num_ribs; |
13 |
|
13 |
|
14 |
cap_height = cap_radius - sqrt(cap_radius*cap_radius - (screen_radius - screen_bevel)*(screen_radius - screen_bevel)); |
14 |
cap_height = cap_radius - sqrt(cap_radius*cap_radius - (screen_radius - screen_bevel)*(screen_radius - screen_bevel)); |
15 |
|
15 |
|
16 |
difference () { |
16 |
difference () { |
17 |
|
17 |
|
18 |
union() { |
18 |
union() { |
19 |
//cap outer shell |
19 |
//cap outer shell |
20 |
intersection () { |
20 |
intersection () { |
21 |
translate ([0,0,-cap_radius + height + cap_height]) |
21 |
translate ([0,0,-cap_radius + height + cap_height]) |
22 |
sphere(cap_radius, $fn=100); |
22 |
sphere(cap_radius, $fn=100); |
23 |
|
23 |
|
24 |
//screen outer shell |
24 |
//screen outer shell |
25 |
cylinder (h=screen_radius*(height/screen_bevel),r1=screen_radius ,r2=0,$fn=100); |
25 |
cylinder (h=screen_radius*(height/screen_bevel),r1=screen_radius ,r2=0,$fn=100); |
26 |
} |
26 |
} |
27 |
|
27 |
|
28 |
// cap hook |
28 |
// cap hook |
29 |
translate ([0,0,height + (cap_height-thickness)]) |
29 |
translate ([0,0,height + (cap_height-thickness)]) |
30 |
difference () { |
30 |
difference () { |
31 |
cylinder (h=height/2,r1=screen_radius/4,r2=screen_radius/4 - thickness,$fn=100); |
31 |
cylinder (h=height/2,r1=screen_radius/4,r2=screen_radius/4 - thickness,$fn=100); |
32 |
|
32 |
|
33 |
translate ([0,screen_radius/4,2.5]) |
33 |
translate ([0,screen_radius/4,2.5]) |
34 |
rotate ([90,0,0]) |
34 |
rotate ([90,0,0]) |
35 |
cylinder (h=screen_radius/2,r=3, $fn=100); |
35 |
cylinder (h=screen_radius/2,r=3, $fn=100); |
36 |
|
36 |
|
37 |
translate ([-screen_radius/4,0,2.5]) |
37 |
translate ([-screen_radius/4,0,2.5]) |
38 |
rotate ([0,90,0]) |
38 |
rotate ([0,90,0]) |
39 |
cylinder (h=screen_radius/2,r=3, $fn=100); |
39 |
cylinder (h=screen_radius/2,r=3, $fn=100); |
40 |
} |
40 |
} |
41 |
|
41 |
|
42 |
|
42 |
|
43 |
} |
43 |
} |
44 |
|
44 |
|
45 |
union() { |
45 |
union() { |
46 |
intersection () { |
46 |
intersection () { |
47 |
//cap inner cavity |
47 |
//cap inner cavity |
48 |
translate ([0,0,-cap_radius + height + cap_height ]) |
48 |
translate ([0,0,-cap_radius + height + cap_height ]) |
49 |
sphere(cap_radius-thickness, $fn=100); |
49 |
sphere(cap_radius-thickness, $fn=100); |
50 |
|
50 |
|
51 |
//screen inner cavity (height is solved by triangle similarity) |
51 |
//screen inner cavity (height is solved by triangle similarity) |
52 |
translate ([0,0, -Clear/2 ]) |
52 |
translate ([0,0, -Clear/2 ]) |
53 |
cylinder (h=(screen_radius - thickness)*(height/screen_bevel),r1=screen_radius - thickness ,r2=0,$fn=100); |
53 |
cylinder (h=(screen_radius - thickness)*(height/screen_bevel),r1=screen_radius - thickness ,r2=0,$fn=100); |
54 |
} |
54 |
} |
55 |
} |
55 |
} |
56 |
} |
56 |
} |
57 |
|
57 |
|
58 |
|
58 |
|
59 |
|
59 |
|
60 |
// center ribs |
60 |
// center ribs |
61 |
for (i = [0 : (num_ribs-1)]) { |
61 |
for (i = [0 : (num_ribs-1)]) { |
62 |
rotate ([90,0,angle_sep * i]) |
62 |
rotate ([90,0,angle_sep * i]) |
63 |
translate ([0,0,-thickness/2]) |
63 |
translate ([0,0,-thickness/2]) |
64 |
linear_extrude (height = thickness, convexity = 10) |
64 |
linear_extrude (height = thickness, convexity = 10) |
65 |
polygon(points=[[0, cap_height + height],[tube_radius + thickness - Clear, 0],[screen_radius - thickness,0],[screen_radius - screen_bevel - thickness,height]]); |
65 |
polygon(points=[[0, cap_height + height],[tube_radius + thickness - Clear, 0],[screen_radius - thickness,0],[screen_radius - screen_bevel - thickness,height]]); |
66 |
|
66 |
|
67 |
} |
67 |
} |