Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -235,8 +235,8 @@ class AdvancedGridOptimizer:
|
|
| 235 |
linewidth = 4.0 if is_corner else 3.0
|
| 236 |
|
| 237 |
# Create lot shape with appropriate height
|
| 238 |
-
if is_corner
|
| 239 |
-
# Corner lot with splay for conventional
|
| 240 |
if i == 0: # First corner
|
| 241 |
vertices = [
|
| 242 |
(x_pos + splay_size, 8), # Start after splay
|
|
@@ -270,7 +270,7 @@ class AdvancedGridOptimizer:
|
|
| 270 |
ax1.plot([x_pos + width - splay_size, x_pos + width],
|
| 271 |
[8, 8 + splay_size], 'white', linewidth=2, alpha=0.8)
|
| 272 |
else:
|
| 273 |
-
# Regular lot
|
| 274 |
lot = FancyBboxPatch((x_pos, 8), width, lot_height,
|
| 275 |
boxstyle="round,pad=0.1",
|
| 276 |
facecolor=face_color,
|
|
@@ -289,13 +289,15 @@ class AdvancedGridOptimizer:
|
|
| 289 |
zorder=2)
|
| 290 |
ax1.add_patch(glow)
|
| 291 |
|
| 292 |
-
# Add lot information (positioned
|
| 293 |
-
|
| 294 |
|
| 295 |
-
|
|
|
|
| 296 |
ha='center', va='center', fontsize=16, fontweight='bold', color='white')
|
| 297 |
|
| 298 |
-
|
|
|
|
| 299 |
ha='center', va='center', fontsize=14, fontweight='bold', color='white')
|
| 300 |
|
| 301 |
# Lot type
|
|
@@ -310,14 +312,15 @@ class AdvancedGridOptimizer:
|
|
| 310 |
spec = {**spec, 'type': 'Custom'}
|
| 311 |
|
| 312 |
lot_type_text = spec['type']
|
| 313 |
-
if is_corner
|
| 314 |
lot_type_text = "CORNER"
|
| 315 |
|
| 316 |
# Add build type for MD
|
| 317 |
if self.development_mode == 'medium_density' and 'build' in spec:
|
| 318 |
lot_type_text += f"\n{spec['build']}"
|
| 319 |
|
| 320 |
-
|
|
|
|
| 321 |
ha='center', va='center', fontsize=11,
|
| 322 |
bbox=dict(boxstyle="round,pad=0.3", facecolor='#545D51',
|
| 323 |
edgecolor='white', alpha=0.9), color='white')
|
|
@@ -1076,14 +1079,15 @@ class AdvancedGridOptimizer:
|
|
| 1076 |
else:
|
| 1077 |
report += f"- **{width:.1f}m** × {count} ({percentage:.1f}%): Custom Width\n"
|
| 1078 |
|
| 1079 |
-
# Corner analysis
|
| 1080 |
-
if
|
| 1081 |
report += f"\n### CORNER ANALYSIS\n"
|
| 1082 |
report += f"- **Front Corner**: {solution[0][0]:.1f}m with 3m × 3m splay\n"
|
| 1083 |
report += f"- **Rear Corner**: {solution[-1][0]:.1f}m with 3m × 3m splay\n"
|
| 1084 |
report += f"- **Balance**: {abs(solution[0][0] - solution[-1][0]):.1f}m difference\n"
|
| 1085 |
|
| 1086 |
report += f"\n### DESIGN FEATURES\n"
|
|
|
|
| 1087 |
if self.development_mode == 'medium_density':
|
| 1088 |
if self.md_load_type == 'rear':
|
| 1089 |
report += f"- 7m rear laneway provides vehicle access and services\n"
|
|
@@ -1093,7 +1097,6 @@ class AdvancedGridOptimizer:
|
|
| 1093 |
report += f"- Compact lots maximize dwelling yield\n"
|
| 1094 |
report += f"- Potential for duplex/triplex on wider lots (≥7m)\n"
|
| 1095 |
else:
|
| 1096 |
-
report += f"- Corner splays provide safe sight lines at intersections\n"
|
| 1097 |
report += f"- All lots have identical rear alignment for visual consistency\n"
|
| 1098 |
report += f"- Diverse lot mix ensures varied streetscape\n"
|
| 1099 |
report += f"- SLHC lots grouped for efficient garbage collection\n"
|
|
|
|
| 235 |
linewidth = 4.0 if is_corner else 3.0
|
| 236 |
|
| 237 |
# Create lot shape with appropriate height
|
| 238 |
+
if is_corner:
|
| 239 |
+
# Corner lot with splay for both conventional and MD
|
| 240 |
if i == 0: # First corner
|
| 241 |
vertices = [
|
| 242 |
(x_pos + splay_size, 8), # Start after splay
|
|
|
|
| 270 |
ax1.plot([x_pos + width - splay_size, x_pos + width],
|
| 271 |
[8, 8 + splay_size], 'white', linewidth=2, alpha=0.8)
|
| 272 |
else:
|
| 273 |
+
# Regular lot
|
| 274 |
lot = FancyBboxPatch((x_pos, 8), width, lot_height,
|
| 275 |
boxstyle="round,pad=0.1",
|
| 276 |
facecolor=face_color,
|
|
|
|
| 289 |
zorder=2)
|
| 290 |
ax1.add_patch(glow)
|
| 291 |
|
| 292 |
+
# Add lot information (positioned inside the lot)
|
| 293 |
+
lot_center_y = 8 + lot_height / 2 # Center of the lot
|
| 294 |
|
| 295 |
+
# Lot number at top of lot interior
|
| 296 |
+
ax1.text(x_pos + width/2, lot_center_y + lot_height/3, f'L{lot_num}',
|
| 297 |
ha='center', va='center', fontsize=16, fontweight='bold', color='white')
|
| 298 |
|
| 299 |
+
# Width in middle
|
| 300 |
+
ax1.text(x_pos + width/2, lot_center_y, f'{width:.1f}m',
|
| 301 |
ha='center', va='center', fontsize=14, fontweight='bold', color='white')
|
| 302 |
|
| 303 |
# Lot type
|
|
|
|
| 312 |
spec = {**spec, 'type': 'Custom'}
|
| 313 |
|
| 314 |
lot_type_text = spec['type']
|
| 315 |
+
if is_corner:
|
| 316 |
lot_type_text = "CORNER"
|
| 317 |
|
| 318 |
# Add build type for MD
|
| 319 |
if self.development_mode == 'medium_density' and 'build' in spec:
|
| 320 |
lot_type_text += f"\n{spec['build']}"
|
| 321 |
|
| 322 |
+
# Type label at bottom of lot interior
|
| 323 |
+
ax1.text(x_pos + width/2, lot_center_y - lot_height/3, lot_type_text,
|
| 324 |
ha='center', va='center', fontsize=11,
|
| 325 |
bbox=dict(boxstyle="round,pad=0.3", facecolor='#545D51',
|
| 326 |
edgecolor='white', alpha=0.9), color='white')
|
|
|
|
| 1079 |
else:
|
| 1080 |
report += f"- **{width:.1f}m** × {count} ({percentage:.1f}%): Custom Width\n"
|
| 1081 |
|
| 1082 |
+
# Corner analysis
|
| 1083 |
+
if len(solution) >= 2:
|
| 1084 |
report += f"\n### CORNER ANALYSIS\n"
|
| 1085 |
report += f"- **Front Corner**: {solution[0][0]:.1f}m with 3m × 3m splay\n"
|
| 1086 |
report += f"- **Rear Corner**: {solution[-1][0]:.1f}m with 3m × 3m splay\n"
|
| 1087 |
report += f"- **Balance**: {abs(solution[0][0] - solution[-1][0]):.1f}m difference\n"
|
| 1088 |
|
| 1089 |
report += f"\n### DESIGN FEATURES\n"
|
| 1090 |
+
report += f"- Corner splays provide safe sight lines at intersections\n"
|
| 1091 |
if self.development_mode == 'medium_density':
|
| 1092 |
if self.md_load_type == 'rear':
|
| 1093 |
report += f"- 7m rear laneway provides vehicle access and services\n"
|
|
|
|
| 1097 |
report += f"- Compact lots maximize dwelling yield\n"
|
| 1098 |
report += f"- Potential for duplex/triplex on wider lots (≥7m)\n"
|
| 1099 |
else:
|
|
|
|
| 1100 |
report += f"- All lots have identical rear alignment for visual consistency\n"
|
| 1101 |
report += f"- Diverse lot mix ensures varied streetscape\n"
|
| 1102 |
report += f"- SLHC lots grouped for efficient garbage collection\n"
|