$fn=64; // --- Parameters --- hex_spacing = 25; // Distance between hex centers wall_thickness = 1.6; // Thickness of walls between compartments floor_thickness = 1.6; // Thickness of the bottom base unit_height = 15; // Height of 1 unit // Calculated radii for the hexagons (vertex-to-vertex) r_in = (hex_spacing - wall_thickness) / sqrt(3); r_out = (hex_spacing + wall_thickness) / sqrt(3); // Generate the 19 coordinate positions for the hex grid module hex_positions() { for (q = [-2 : 2]) { for (r = [-2 : 2]) { if (abs(q + r) <= 2) { // Axial to Cartesian conversion x = hex_spacing * (q + r/2); y = hex_spacing * sqrt(3)/2 * r; translate([x, y, 0]) children(); } } } } // Main bin module module 19_hex_bin() { difference() { // Outer solid shell (unions overlapping hexagons) hex_positions() rotate([0, 0, 30]) cylinder(r=r_out, h=unit_height, $fn=6); // Inner compartment cutouts // Translated up by floor_thickness, extending past the top to ensure manifold cut hex_positions() translate([0, 0, floor_thickness]) rotate([0, 0, 30]) cylinder(r=r_in, h=unit_height, $fn=6); } } // Render the model 19_hex_bin();