$fn = 64; // --- Parameters --- // Base grid dimensions (2x2 tile) grid_unit = 20; tile_x = grid_unit * 2; tile_y = grid_unit * 2; // Heights and thicknesses base_height = 3; sidewalk_width = 3; sidewalk_height = 1; entrance_width = 14; // Parking space dimensions spot_depth = 11; spot_width = 7.5; num_spots = 4; line_w = 0.8; // Extrusion width for 3D printing line_h = 0.4; // 2 layers at 0.2mm for visible lines // --- Geometry --- union() { // 1. Main solid base cube([tile_x, tile_y, base_height]); // 2. Raised sidewalk border translate([0, 0, base_height]) difference() { cube([tile_x, tile_y, sidewalk_height]); // Inner cutout for the parking lot surface translate([sidewalk_width, sidewalk_width, -0.1]) cube([tile_x - sidewalk_width*2, tile_y - sidewalk_width*2, sidewalk_height + 0.2]); // Cutout for the entrance/exit (front edge) translate([(tile_x - entrance_width)/2, -0.1, -0.1]) cube([entrance_width, sidewalk_width + 0.2, sidewalk_height + 0.2]); } // 3. Raised parking lines (painted lines) translate([0, 0, base_height]) { // Calculate starting Y to center the parking spots vertically y_start = (tile_y - (num_spots * spot_width)) / 2; // Left side parking spots for (i = [0 : num_spots]) { translate([sidewalk_width, y_start + (i * spot_width), 0]) cube([spot_depth, line_w, line_h]); } // Left dividing line translate([sidewalk_width + spot_depth, y_start, 0]) cube([line_w, (num_spots * spot_width) + line_w, line_h]); // Right side parking spots for (i = [0 : num_spots]) { translate([tile_x - sidewalk_width - spot_depth, y_start + (i * spot_width), 0]) cube([spot_depth, line_w, line_h]); } // Right dividing line translate([tile_x - sidewalk_width - spot_depth - line_w, y_start, 0]) cube([line_w, (num_spots * spot_width) + line_w, line_h]); // Entrance dividing line (center dashed line) translate([(tile_x - line_w)/2, sidewalk_width + 2, 0]) cube([line_w, 4, line_h]); translate([(tile_x - line_w)/2, sidewalk_width + 8, 0]) cube([line_w, 4, line_h]); } }