$fn = 32; part = "closed"; ox=80; oy=60; oz=50; wall=3; module rounded_xy(s,r){ linear_extrude(s[2],center=true) offset(r=r) square([s[0]-2*r,s[1]-2*r],center=true); } module box(open=false) { color("#6a5040") difference() { translate([0,0,oz/2]) rounded_xy([ox,oy,oz], 3); translate([0,0,oz/2+wall]) rounded_xy([ox-2*wall, oy-2*wall, oz], 2); // top panel groove translate([0,0,oz-1]) cube([ox-10, oy-10, 3], center=true); } // sliding top panel color("#8a6a50") translate([open?20:0, 0, oz-1.2]) rounded_xy([ox-12, oy-12, 2.2], 1.5); // left panel color("#7a5a42") translate([open?-ox/2+wall/2-1 : -ox/2+wall/2, open?15:0, oz/2]) cube([wall, oy-12, oz-10], center=true); // hidden cam color("#d0b070") translate([10,0, oz/2]) rotate([0,0, open?90:0]) cube([16, 4, 4], center=true); // secret cavity block if (open) color("#c4a070") translate([0,0,12]) cube([24,16,10], center=true); else color("#5a4030") translate([0,0,12]) cube([24,16,10], center=true); } box(part=="open");