Rev Author Line No. Line
3894 vinchi9 1 r = 35;
2 h = 20.32;
3 thickness = 2;
4  
5 shield_cap(r,h,thickness);
6  
7 module shield_cap(r,h,thickness){
8 difference(){
9 top(r,h);
10 translate([0,0,-thickness]){top(r-thickness,h-thickness);}
11 }
12 intersection(){
13 union(){
14 difference(){
15 union(){
16 translate([-thickness/2,thickness-r,0]){cube([thickness,2*r-thickness*2,h]);}
17 translate([thickness-r,-thickness/2,0]){cube([2*r-thickness*2,thickness,h]);}
18 }
19 rotate([0,0,45]){cube([sqrt(2*pow(r/1.6,2))-thickness*2,sqrt(2*pow(r/1.6,2))-thickness*2,h*2],center=true);}
20 }
21 rotate([0,0,45]){
22 translate([0,0,h/2]){
23 difference(){
24 cube([sqrt(2*pow(r/1.6,2)),sqrt(2*pow(r/1.6,2)),h],center=true);
25 cube([sqrt(2*pow(r/1.6,2))-thickness*2,sqrt(2*pow(r/1.6,2))-thickness*2,h*2],center=true);
26 }
27 }
28 }
29 }
30  
31 translate([0,0,-thickness]){top(r-thickness,h-thickness);}
32 }
33 }
34  
35 module top(r,h){
36 difference(){
37 intersection(){
38 translate([-r,-r,0]){cube([2*r,2*r,h]);}
39 cylinder(h=h, r=r,$fn=100);
40 }
41 translate([0,0,h/5]){
42 difference(){
43 translate([-r,-r,0]){cube([r*2,r*2,h+1]);}
44 resize([0,0,h*5/3]){sphere(r=r,$fn=100);}
45 }
46 }
47 }
48  
49 }