// A cylinder that matches cube() module cylinder2(dim) { translate([0, dim[1]/2, dim[2]/2]) rotate(90, [0, 1, 0]) cylinder(dim[0], dim[1]/2, dim[2]/2); } module rcube(dim, r=3) { hull() { for (x = [r, dim[0]-r]) { for (y = [r, dim[1]-r]) { translate([x, y, 0]) cylinder(dim[2], r, r); } } } } module rbox(dim, wall=3, r=10) { w = dim[0]; d = dim[1]; h = dim[2]; difference() { rcube(dim, r); translate([wall, wall, wall]) rcube(dim - [wall*2, wall*2, 0], r); } } function midx(a, b) = (a[0] - b[0])/2;