t = 50; w = 20; wi = 15; h = 5; d = 1; aw = 4; at = 5; ad = 2; cr = 2; module round_corner(r, h) { translate([-r, -r, 0]) difference() { cube([r, r, h]); cylinder(h=h, r=r, $fn=50); } } difference() { union() { cube([w,t,h]); }; union() { // rail negative translate([d, d, d]) cube([w-2*d,t,h-2*d]); translate([(w-wi)/2, d, h-d]) cube([wi, t, d]); // 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); } }