$fn = 64; // --- Parameters --- hex_radius = 20; // Circumradius of a single base hexagon height_units = 3; // Bin height in units unit_height = 10; // Height of a single unit in mm wall_thickness = 1.6; // Thickness of the outer walls floor_thickness = 1.6; // Thickness of the bottom floor // --- Calculated Variables --- total_height = height_units * unit_height; // Distance between centers in a standard pointy-top hex grid dx = sqrt(3) * hex_radius; dy = 1.5 * hex_radius; // Single hexagon profile (pointy top) module hex_profile() { rotate([0, 0, 30]) circle(r=hex_radius, $fn=6); } // Outer triangular shape spanning 3 hexes, centered at origin module bin_profile() { translate([-dx/2, -dy/3]) { hull() { translate([0, 0]) hex_profile(); translate([dx, 0]) hex_profile(); translate([dx/2, dy]) hex_profile(); } } } // Main Bin Geometry difference() { // Outer shell linear_extrude(total_height) { bin_profile(); } // Inner cavity (hollowed out) // offset(r=-wall_thickness) cleanly shrinks the profile and rounds the interior corners translate([0, 0, floor_thickness]) { linear_extrude(total_height + 1) { // +1 prevents z-fighting on rendering offset(r=-wall_thickness) bin_profile(); } } }