$fn=64; // --- Parameters --- tile_size = 50; // Length and width of the road tile base_thickness = 5; // Total thickness of the tile at the highest point (sidewalk) road_depth = 1.5; // Depth of the road relative to the sidewalk road_width = 30; // Width of the road surface line_width = 2; // Width of the center dividing lines line_length = 8; // Length of each center line segment line_spacing = 8; // Space between center lines line_height = 0.6; // Height of the center lines (raised for 3D printing) module straight_road() { road_thickness = base_thickness - road_depth; union() { difference() { // Main solid tile block translate([-tile_size/2, -tile_size/2, 0]) cube([tile_size, tile_size, base_thickness]); // Subtract the road surface (extended in Y and Z to ensure manifold geometry) translate([-road_width/2, -tile_size/2 - 1, road_thickness]) cube([road_width, tile_size + 2, road_depth + 1]); } // Add raised center lines num_lines = floor(tile_size / (line_length + line_spacing)); total_lines_length = (num_lines * line_length) + ((num_lines - 1) * line_spacing); start_y = -tile_size/2 + (tile_size - total_lines_length) / 2; for (i = [0 : num_lines - 1]) { // Overlap slightly in Z (-0.01) to ensure manifold union translate([-line_width/2, start_y + i * (line_length + line_spacing), road_thickness - 0.01]) cube([line_width, line_length, line_height + 0.01]); } } } // Render the model straight_road();