include module case(){ color("lightblue") translate([ -( lidwidth- casewidth)/2 , -casedepth, caseheight-lidheight]) { // draw the handle first, because of bad rendering in the difference function translate([(lidwidth-handlewidth)/2, -handledepth, -((102-15)/2)-handleheight/2]) { difference(){ cube(size=[handlewidth, handledepth, handleheight], center=false); translate([gapoffset, handledepth-gapdepth, -10]) { cube(size=[handlewidth-(gapoffset*2), gapdepth+10, handleheight+20], center=false); } } } // now draw the lid cube(size=[lidwidth, casedepth, lidheight], center=false); // and draw the body translate([(lidwidth-casewidth)/2, 0, -caseheight+lidheight]) { cube(size=[casewidth, casedepth, caseheight-lidheight], center=false); } } } case();