+// dome module from https://github.com/Sembiance/common/blob/master/openscad/dome.scad, Public Domain
+module dome(d=5, h=2, hollow=false, wallWidth=0.5) {
+ sphereRadius = (pow(h, 2) + pow((d/2), 2) ) / (2*h);
+ translate([0, 0, (sphereRadius-h)*-1]) {
+ difference() {
+ sphere(sphereRadius);
+ translate([0, 0, -h]) cube([2*sphereRadius, 2*sphereRadius, 2*sphereRadius], center=true);
+ if(hollow) sphere(sphereRadius-wallWidth);
+ }
+ }
+}
+