$fn = 64; // --- PARAMETERS --- length = 200; // Overall length of the chest width = 80; // Overall width of the chest base_height = 60; // Height of the bottom tray lid_height = 40; // Height of the top arch wall = 3; // Wall thickness hole_radius = 15; // Radius of the cable entry/exit holes lip_height = 4; // Height of the alignment lip clearance = 0.5; // Tolerance for easy closing band_width = 10; // Width of the decorative bands band_thickness = 2; // Thickness of the decorative bands // --- LAYOUT --- // The base and lid are placed side-by-side to print without supports base_assembly(); translate([0, width + band_thickness * 2 + 15, 0]) lid_assembly(); // --- MODULES --- module base_assembly() { difference() { union() { // Main body cube([length, width, base_height]); // Alignment lip (inner rim) translate([wall/2, wall/2, base_height]) cube([length - wall, width - wall, lip_height]); // Decorative bands translate([length * 0.15, -band_thickness, 0]) cube([band_width, width + 2*band_thickness, base_height]); translate([length * 0.85 - band_width, -band_thickness, 0]) cube([band_width, width + 2*band_thickness, base_height]); // Front lock detail (bottom half) translate([length/2 - 7.5, -band_thickness - 1, base_height - 15]) cube([15, band_thickness + 2, 15]); } // Inner hollow cavity translate([wall, wall, wall]) cube([length - 2*wall, width - 2*wall, base_height + lip_height + 1]); // Cable holes cable_holes(); } } module lid_assembly() { difference() { union() { // Main arched lid arch(length, width, lid_height); // Decorative bands translate([length * 0.15, -band_thickness, 0]) intersection() { cube([band_width, width + 2*band_thickness, lid_height + band_thickness]); arch(length, width + 2*band_thickness, lid_height + band_thickness); } translate([length * 0.85 - band_width, -band_thickness, 0]) intersection() { cube([band_width, width + 2*band_thickness, lid_height + band_thickness]); arch(length, width + 2*band_thickness, lid_height + band_thickness); } // Front lock detail (top half) translate([length/2 - 7.5, -band_thickness - 1, 0]) cube([15, band_thickness + 2, 15]); } // Inner hollow cavity translate([wall, wall, 0]) arch(length - 2*wall, width - 2*wall, lid_height - wall); // Cutout receiver for the base alignment lip translate([wall/2 - clearance, wall/2 - clearance, -1]) cube([length - wall + 2*clearance, width - wall + 2*clearance, lip_height + 1 + clearance]); } } module arch(l, w, h) { // Creates a flat-bottomed half-cylinder scaled to fit the width and height difference() { translate([0, w/2, 0]) scale([1, 1, h / (w/2)]) rotate([0, 90, 0]) cylinder(r = w/2, h = l); // Remove the bottom half of the cylinder to keep it flat on Z=0 translate([-1, -w, -h*2]) cube([l + 2, w * 3, h * 2]); } } module cable_holes() { // Left cable hole translate([-1, width/2, wall + hole_radius]) rotate([0, 90, 0]) cylinder(r = hole_radius, h = wall + 2); translate([-1, width/2 - hole_radius, wall]) cube([wall + 2, hole_radius * 2, hole_radius]); // Right cable hole translate([length - wall - 1, width/2, wall + hole_radius]) rotate([0, 90, 0]) cylinder(r = hole_radius, h = wall + 2); translate([length - wall - 1, width/2 - hole_radius, wall]) cube([wall + 2, hole_radius * 2, hole_radius]); }