$fn = 36; part = "assembly"; pitch = 40; wall = 2.4; rows = 5; cols = 8; module hex_2d(r) { polygon([for (a=[0:60:300]) [r*cos(a), r*sin(a)]]); } function cell_at(c, r) = [(c - (cols-1)/2)*pitch + (r % 2)*pitch/2, (r - (rows-1)/2)*pitch*sqrt(3)/2]; module wall_panel() { color("#7a6a58") difference() { hull() { for (c=[0,cols-1], r=[0,rows-1]) { p = cell_at(c,r); translate([p[0], p[1], 0]) cylinder(d=pitch+14, h=wall); } } for (c=[0:cols-1], r=[0:rows-1]) { p = cell_at(c,r); translate([p[0], p[1], -0.2]) linear_extrude(wall+0.4) hex_2d(pitch/2-2.2); } } } module hook() { color("#d0a070") { linear_extrude(3) hex_2d(pitch/2-2.5); translate([0, 0, 3]) cylinder(d=6, h=6); translate([0, -10, 12]) rotate([70,0,0]) cube([6, 3, 20], center=true); } } module bin() { color("#c4b49a") difference() { linear_extrude(18) hex_2d(pitch/2-2.5); translate([0,0,wall]) linear_extrude(18) hex_2d(pitch/2-2.5-wall); } } if (part=="wall") wall_panel(); else if (part=="hook") hook(); else { wall_panel(); p = cell_at(2,2); translate([p[0], p[1], wall]) hook(); q = cell_at(5,1); translate([q[0], q[1], wall]) bin(); }