$fn = 64; // --- Parameters --- hex_outer_radius = 20; // Outer radius of a single hexagon (center to point) wall_thickness = 1.5; // Thickness of the shared walls and outer walls floor_thickness = 1.5; // Thickness of the bottom floor unit_height = 25; // Total height of the bin (1 unit) // --- Calculated Values --- // Apothem is the distance from the center to the flat edge apothem_out = hex_outer_radius * cos(30); // Distance between centers to share exactly 'wall_thickness' center_dist = 2 * apothem_out - wall_thickness; // Inner radius to maintain consistent wall thickness hex_inner_radius = hex_outer_radius - (wall_thickness / cos(30)); // Centers for the 7 hexagons (1 center, 6 surrounding at 60-degree intervals) centers = [ [0, 0], [center_dist * cos(0), center_dist * sin(0)], [center_dist * cos(60), center_dist * sin(60)], [center_dist * cos(120), center_dist * sin(120)], [center_dist * cos(180), center_dist * sin(180)], [center_dist * cos(240), center_dist * sin(240)], [center_dist * cos(300), center_dist * sin(300)] ]; // --- Geometry --- difference() { // Outer solid body union() { for (c = centers) { translate([c[0], c[1], 0]) // Rotate 30 degrees so flat edges face the adjacent centers rotate([0, 0, 30]) cylinder(h=unit_height, r=hex_outer_radius, $fn=6); } } // Inner hollow cavities for (c = centers) { translate([c[0], c[1], floor_thickness]) rotate([0, 0, 30]) // Height + 1 ensures clean manifold subtraction through the top cylinder(h=unit_height + 1, r=hex_inner_radius, $fn=6); } }