// FIRST LAYER / box, lift-off lid and a small fit coupon // Units: mm. No physical print test is claimed. Test before full prints. // Change part to "box", "lid", or "coupon". Render F6, then export STL. part = "coupon"; width = 60; depth = 40; height = 20; wall = 2; base = 2; clearance = 0.25; // PER SIDE, not the total difference lid_thickness = 2; plug_depth = 3; eps = 0.01; assert(width > 2*wall && depth > 2*wall && height > base); assert(clearance >= 0 && clearance < 2); module box(w,d,h) { difference() { cube([w,d,h]); translate([wall,wall,base]) cube([w-2*wall,d-2*wall,h-base+eps]); } } module lid(w,d) { // Broad top face lies on bed; locating plug points upward. union() { cube([w,d,lid_thickness]); translate([wall+clearance,wall+clearance,lid_thickness-eps]) cube([w-2*wall-2*clearance,d-2*wall-2*clearance,plug_depth+eps]); } } if (part == "box") box(width,depth,height); else if (part == "lid") lid(width,depth); else if (part == "coupon") { // Smaller footprint and short box, same intended surfaces and clearances. // Print separate trials at 0.15, 0.25, 0.35 mm and label them after printing. box(24,20,7); translate([30,0,0]) lid(24,20); } else assert(false,"part must be box, lid or coupon");