Generates residential floor plans and full drawing sets (DXF + PNG + 3D renderings) for self-built houses and villas. Enforces strict cross-drawing consistency through a centralized building config. Use when the user mentions floor plans, house design, building layout, DXF drawings, room layout optimization, self-built house blueprints, or residential architecture drawings.
Generate professional residential floor plans as DXF (AutoCAD) + PNG (preview) + 3D renderings.
All scripts share one centralized config to guarantee cross-drawing consistency:
scripts/building_config.py ← 唯一数据源 (Single Source of Truth)
├── 基地尺寸 (BW/BH/OW/IW)
├── 层高体系 (F1H/F2H/SLAB/PARAPET → 推导 GL/F1_FL/.../TOP)
├── 平面布局 (F1_X1/F1_Y0/.../F2_NX3 — 每层房间分割坐标)
├── 窗户定义 (SOUTH_WIN/NORTH_WIN/EAST_WIN/WEST_WIN — 全朝向统一)
└── 立面参数 (DARK_STONE_X/SOUTH_DOOR — 外观特征)
scripts/fonts/ ← 内嵌中文字体 (Noto Sans SC 子集, ~530KB, 无需系统字体)
scripts/generate_all.py ← 全套图纸 (从 building_config 导入)
scripts/generate_render_3d.py ← 3D透视渲染 (从 building_config 导入)
核心原则:修改建筑参数时,只改 building_config.py 一处,所有图纸自动同步。禁止在各脚本中硬编码建筑尺寸。
pip install -r requirements.txt
Utility scripts (execute, don't read):
| Script | Purpose |
|---|---|
scripts/building_config.py | Centralized building parameters (edit this to change dimensions) |
scripts/generate_all.py | Generate full drawing set (floor plans, elevations, sections, MEP, renderings) |
scripts/generate_render_3d.py | Generate 3D perspective renderings |
examples/generate_house_dxf.py | Standalone floor plan example (DXF + PNG) |
python scripts/generate_all.py # DXF → ./图纸/ PNG → ./docs/images/
python scripts/generate_render_3d.py # PNG → ./docs/images/
When modifying any drawing, follow these rules to maintain cross-drawing consistency:
building_config.py as SOUTH_WIN/NORTH_WIN/EAST_WIN/WEST_WIN. All scripts (elevations, renderings, 3D) read from the same arrays.GL → F1_FL → F1_CL → F2_FL → F2_CL → ROOF → TOP. Never hardcode intermediate values.F1_X1, F2_NX3, etc.) are defined in config. Both generate_all.py and 3D renderings import the same values.- [ ] Step 1: Confirm requirements (occupants, bedrooms, plot size, floors, style)
- [ ] Step 2: Zone allocation (ground: public + elderly; upper: private)
- [ ] Step 3: Update building_config.py (walls, rooms, windows)
- [ ] Step 4: Door & window placement (verify every room has access)
- [ ] Step 5: Furniture layout (per reference.md standard sizes)
- [ ] Step 6: Circulation check (no dead-end rooms)
- [ ] Step 7: Dimension annotation (segmented + total)
- [ ] Step 8: Run generate_all.py + generate_render_3d.py
- [ ] Step 9: Cross-drawing validation (see checklist below)
Functional:
- [ ] Every room has at least one door with correct swing direction
- [ ] Master bedroom 2 (2F) has en-suite bathroom door
- [ ] Stairwell position matches between floors
- [ ] Kitchen is adjacent to dining area
- [ ] Corridor width ≥ 1.2m throughout
Cross-drawing consistency:
- [ ] Elevation windows match floor plan window_h/window_v positions
- [ ] 3D renderings match elevation window layout exactly
- [ ] No phantom roof volumes or extra building mass in renderings
- [ ] East and west elevations reflect actual room differences
- [ ] Section shows correct slab/parapet/stair positions
- [ ] Building height (TOP) is identical across all drawings
lineweight=50), Interior: 120mm (lineweight=35)fonts/NotoSansSC-Subset*.ttf;DXF 自动检测系统字体(SimHei/PingFang/Noto Sans CJK SC 等)Electrical plans must include:
Plumbing plans must include:
Elevation renderings include:
3D perspective renderings include: