t = 50; w = 20; wi = 15; h = 5; d = 1; aw = 4; at = 5; ad = 2; cr = 2; support_fraction = 0.5; module round_corner(r, h) { translate([-r, -r, 0]) difference() { cube([r, r, h]); cylinder(h=h, r=r, $fn=50); } } module side() { w2 = (w-wi)/2; s = support_fraction * (w2 - d); translate([0, t, 0]) rotate([90, 0, 0]) linear_extrude(height = t, convexity=2) polygon([[0,0], [0,h], [w2,h], [w2,h-d], [d,h-d-s], [d,0]]); } difference() { union() { // base plate cube([w, t, d]); // back cube([w, d, h]); // sides and top side(); translate([w, 0, 0]) mirror() side(); } union() { // retainer hole translate([(w-aw)/2, t-at-ad, 0]) cube([aw, at, 2*d]); // round vertical corners translate([0, 0, 0]) rotate(a=180) round_corner(r=cr, h=h); translate([w, 0, 0]) rotate(a=270) round_corner(r=cr, h=h); translate([w, t, 0]) rotate(a=0 ) round_corner(r=cr, h=h); translate([0, t, 0]) rotate(a=90 ) round_corner(r=cr, h=h); } }