$fn = 64; // --- Parameters --- hex_radius = 16; // Outer radius of a single hexagon wall_thickness = 1.2; // Thickness of the bin walls floor_thickness = 1.2; // Thickness of the bottom floor unit_height = 10; // Height of one unit units = 2; // Number of height units // --- Calculated Values --- height = unit_height * units; F = sqrt(3) * hex_radius; // Flat-to-flat distance // Centers of the 3 hexagons forming an equilateral triangle pos1 = [0, 0]; pos2 = [F, 0]; pos3 = [F/2, F * sqrt(3)/2]; // Centroid for centering the final model cx = (pos1[0] + pos2[0] + pos3[0]) / 3; cy = (pos1[1] + pos2[1] + pos3[1]) / 3; // --- Modules --- module hex_shape(r) { // Rotate 30 degrees so flat sides align for adjacent placement rotate(30) circle(r = r, $fn = 6); } module outer_profile() { union() { translate(pos1) hex_shape(hex_radius); translate(pos2) hex_shape(hex_radius); translate(pos3) hex_shape(hex_radius); } } // --- Main Assembly --- translate([-cx, -cy, 0]) { difference() { // Outer solid shape linear_extrude(height) { outer_profile(); } // Inner hollow shape (single continuous compartment) translate([0, 0, floor_thickness]) { linear_extrude(height + 1) { // Extrude past the top to prevent Z-fighting offset(delta = -wall_thickness) outer_profile(); } } } }