Lock staircase to its fixed 12x10 size in GPT plans
Browse filesThe staircase is a fixed structural block; the light GPT render now snaps it
to 12x10 and never resizes it. Verified across plot sizes and road sides.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- core/pdf_templates.py +6 -0
core/pdf_templates.py
CHANGED
|
@@ -2829,8 +2829,14 @@ def build_from_spec(spec, name, plot_w, plot_h, road_side, selected_optional,
|
|
| 2829 |
# RAW "AI-generated" look: nudge the walls. Overlaps are allowed in the
|
| 2830 |
# raw plan; the clamp keeps everything inside the box.
|
| 2831 |
rooms = _jitter(rooms, lx0, ly0, lx1, ly1, jitter, random.Random(seed))
|
|
|
|
|
|
|
|
|
|
| 2832 |
else:
|
| 2833 |
# OPTIMISED: enforce the hard rules on the clean tiling (light touch).
|
|
|
|
|
|
|
|
|
|
| 2834 |
rooms = _carve_pooja_ne(rooms, layout_w, layout_h)
|
| 2835 |
rooms = _separate_pooja_from_wet(rooms)
|
| 2836 |
rooms = _shrink_oversized(rooms, lx0, ly0, lx1, ly1)
|
|
|
|
| 2829 |
# RAW "AI-generated" look: nudge the walls. Overlaps are allowed in the
|
| 2830 |
# raw plan; the clamp keeps everything inside the box.
|
| 2831 |
rooms = _jitter(rooms, lx0, ly0, lx1, ly1, jitter, random.Random(seed))
|
| 2832 |
+
# The staircase is a FIXED structural block — keep it exactly 12x10 even
|
| 2833 |
+
# in the jittered raw plan.
|
| 2834 |
+
rooms = _snap_staircase(rooms, lx0, ly0, lx1, ly1)
|
| 2835 |
else:
|
| 2836 |
# OPTIMISED: enforce the hard rules on the clean tiling (light touch).
|
| 2837 |
+
# Lock the staircase to its FIXED 12x10 size FIRST; the freed slack is
|
| 2838 |
+
# reclaimed by the gap-fill below, so it never renders bigger/smaller.
|
| 2839 |
+
rooms = _snap_staircase(rooms, lx0, ly0, lx1, ly1)
|
| 2840 |
rooms = _carve_pooja_ne(rooms, layout_w, layout_h)
|
| 2841 |
rooms = _separate_pooja_from_wet(rooms)
|
| 2842 |
rooms = _shrink_oversized(rooms, lx0, ly0, lx1, ly1)
|