r = 35;
h = 20.32;
thickness = 2;
shield_cap(r,h,thickness);
module shield_cap(r,h,thickness){
difference(){
top(r,h);
translate([0,0,-thickness]){top(r-thickness,h-thickness);}
}
intersection(){
union(){
difference(){
union(){
translate([-thickness/2,thickness-r,0]){cube([thickness,2*r-thickness*2,h]);}
translate([thickness-r,-thickness/2,0]){cube([2*r-thickness*2,thickness,h]);}
}
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);}
}
rotate([0,0,45]){
translate([0,0,h/2]){
difference(){
cube([sqrt(2*pow(r/1.6,2)),sqrt(2*pow(r/1.6,2)),h],center=true);
cube([sqrt(2*pow(r/1.6,2))-thickness*2,sqrt(2*pow(r/1.6,2))-thickness*2,h*2],center=true);
}
}
}
}
translate([0,0,-thickness]){top(r-thickness,h-thickness);}
}
}
module top(r,h){
difference(){
intersection(){
translate([-r,-r,0]){cube([2*r,2*r,h]);}
cylinder(h=h, r=r,$fn=100);
}
translate([0,0,h/5]){
difference(){
translate([-r,-r,0]){cube([r*2,r*2,h+1]);}
resize([0,0,h*5/3]){sphere(r=r,$fn=100);}
}
}
}
}