$fn = 64; // --- Parameters --- tile_size = 60; // Size of the square tile base_height = 3; // Height of the road surface sidewalk_height = 2; // Height of the sidewalk above the road road_width = 30; // Width of the road corner_radius = 5; // Radius of the intersection sidewalk corners // Connector settings connector_holes = true; // Include holes for connecting pegs hole_radius = 2.5; // Radius for connection pegs hole_depth = 4; // Depth of connection holes // --- Main Geometry --- difference() { union() { // Main base (road level) translate([0, 0, base_height/2]) cube([tile_size, tile_size, base_height], center=true); // Sidewalk blocks (four corners) for (rot = [0, 90, 180, 270]) { rotate([0, 0, rot]) sidewalk_block(); } } // Optional connector holes on all 4 sides if (connector_holes) { for (rot = [0, 90, 180, 270]) { rotate([0, 0, rot]) translate([0, tile_size/2 + 0.1, base_height/2]) rotate([90, 0, 0]) cylinder(r=hole_radius, h=hole_depth + 0.1); } } } // --- Modules --- module sidewalk_block() { // Slight Z overlap to ensure a manifold 3D-printable mesh z_overlap = 0.1; translate([0, 0, base_height - z_overlap]) { hull() { // Rounded corner facing the center of the intersection translate([road_width/2 + corner_radius, road_width/2 + corner_radius, 0]) cylinder(r=corner_radius, h=sidewalk_height + z_overlap); // Far outer corner of the tile translate([tile_size/2 - 0.1, tile_size/2 - 0.1, 0]) cube([0.1, 0.1, sidewalk_height + z_overlap]); // Edge along the Y-axis road translate([road_width/2, tile_size/2 - 0.1, 0]) cube([0.1, 0.1, sidewalk_height + z_overlap]); // Edge along the X-axis road translate([tile_size/2 - 0.1, road_width/2, 0]) cube([0.1, 0.1, sidewalk_height + z_overlap]); } } }