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