$fn=64; // --- Parameters --- hex_radius = 20; // Radius of a single hexagon (center to point) base_thickness = 2; // Thickness of the solid bottom layer raised_thickness = 1.5; // Thickness of the raised hex tiles grid_gap = 1.2; // Width of the gap between raised hexes rings = 3; // 3 rings around center = 37 hexes total // --- Modules --- module hex_prism(r, h) { // $fn=6 creates a perfect hexagon when using cylinder cylinder(r=r, h=h, $fn=6); } module 37_hex_baseplate() { union() { // Continuous solid base layer for (q = [-rings : rings]) { for (r = [-rings : rings]) { // Axial coordinate distance formula for hex grid if (abs(q) + abs(r) + abs(q+r) <= rings * 2) { x_pos = sqrt(3) * hex_radius * (q + r/2); y_pos = 1.5 * hex_radius * r; translate([x_pos, y_pos, 0]) // Add 0.1 overlap to ensure a perfectly manifold watertight base hex_prism(r=hex_radius + 0.1, h=base_thickness); } } } // Raised individual hex tiles for (q = [-rings : rings]) { for (r = [-rings : rings]) { if (abs(q) + abs(r) + abs(q+r) <= rings * 2) { x_pos = sqrt(3) * hex_radius * (q + r/2); y_pos = 1.5 * hex_radius * r; // Overlap Z by 0.01 to ensure manifold union with base translate([x_pos, y_pos, base_thickness - 0.01]) hex_prism(r=hex_radius - grid_gap, h=raised_thickness + 0.01); } } } } } // --- Render --- 37_hex_baseplate();