$fn = 64; // --- Parameters --- unit_height = 10; // Base height of a single unit (mm) height_units = 3; // Multiplier for total height hex_radius = 25; // Outer radius of each hexagon (center to corner) wall_thickness = 1.5; // Thickness of the exterior walls bottom_thickness = 2.0; // Thickness of the solid bottom floor // --- Calculated Variables --- total_height = unit_height * height_units; // Distance between centers of adjacent touching hexagons (flat-to-flat) center_dist = hex_radius * sqrt(3); // Inner radius calculated to maintain exact wall thickness on the flat sides inner_radius = hex_radius - (wall_thickness / cos(30)); // --- Modules --- // Distributes geometry to the 7 hex cluster positions (1 center, 6 surrounding) module cluster_positions() { // Center position children(); // 6 surrounding positions for(i = [0:5]) { rotate([0, 0, i * 60]) translate([center_dist, 0, 0]) children(); } } // Single hexagon properly oriented so flats face adjacent neighbors module hex_prism(r, h) { rotate([0, 0, 30]) cylinder(r=r, h=h, $fn=6); } // --- Main Geometry --- difference() { // Main solid outer body cluster_positions() hex_prism(r=hex_radius, h=total_height); // Hollow out the bins translate([0, 0, bottom_thickness]) cluster_positions() // +1 height ensures a clean manifold cut at the top surface hex_prism(r=inner_radius, h=total_height + 1); }