$fn=64; // Parametric variables for TinyTown foundation base base_width = 50; base_length = 60; footing_height = 3; slab_height = 5; step_inset = 2.5; peg_spacing_x = 30; peg_spacing_y = 40; peg_radius = 2; peg_height = 2.5; module foundation() { union() { // Bottom footing translate([-base_width/2, -base_length/2, 0]) cube([base_width, base_length, footing_height]); // Main foundation slab // Overlapped on Z by 0.1mm to ensure a manifold/watertight mesh translate([-(base_width - step_inset*2)/2, -(base_length - step_inset*2)/2, footing_height - 0.1]) cube([base_width - step_inset*2, base_length - step_inset*2, slab_height + 0.1]); // Alignment pegs for placing a building on top for (x = [-1, 1]) { for (y = [-1, 1]) { translate([x * (peg_spacing_x/2), y * (peg_spacing_y/2), footing_height + slab_height - 0.1]) cylinder(h=peg_height + 0.1, r=peg_radius); } } } } foundation();