关于 architect-calculator
Architect Calculator 是一组用于建筑设计初步计算的七个 Python 命令行计算器,面向建筑师和设计团队。它涵盖面积、围护结构、日照、疏散、结构荷载、能耗和成本,并可输出 JSON。
主要功能
- 01计算开发密度、可用面积和停车需求
- 02计算多层构造的 U 值
- 03估算侧窗房间的平均采光系数
- 04按 IBC 计算疏散人数和出口要求
- 05估算结构荷载、能耗及施工成本
- 06通过 JSON 输出供脚本和报告集成
适用场景
- 01根据地块面积与 FAR 估算开发容量
- 02比较墙体或屋面构造的热工性能
- 03初步核查建筑疏散出口和宽度
- 04为方案阶段估算能耗与建设成本
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ abhinavbwj/ skills-architects --skill architect-calculator安装后在 Claude Code 中输入/architect-calculator确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
references/calculator-reference.mdscripts/area_calculator.pycost_calculator.pydaylight_calculator.pyegress_calculator.pyenergy_calculator.pystructural_load_calculator.pyuvalue_calculator.py详细介绍
建筑设计计算器
一套包含七个命令行 Python 计算器的工具,用于快速完成建筑设计计算。每个计算器都通过命令行参数接收参数、验证输入,并生成易读输出或结构化 JSON 输出。
所有脚本均位于 scripts/ 目录中,可通过以下命令运行:
python scripts/<calculator_name>.py [arguments]
为任意命令添加 --json,即可生成结构化 JSON 输出,适用于传递给其他工具或自动化工作流。
1. 面积计算器(area_calculator.py)
根据场地面积和容积率(FAR)计算开发密度指标,包括总建筑面积、净可用面积、住宅单元数量、估算人口和停车位需求。
参数
| 参数 | 标志 | 默认值 | 单位 | 说明 |
|---|---|---|---|---|
| 场地面积 | --site-area | 必填 | m2 | 场地/地块总面积 |
| 容积率 | --far | 必填 | ratio | 允许容积率/地块容积率 |
| 净面积与总面积比 | --ntg-ratio | 0.80 | ratio | 净可用面积占总建筑面积的比例(0.0-1.0) |
| 平均单元面积 | --avg-unit-size | 85 | m2 | 住宅单元的平均面积 |
| 每单元居住人数 | --persons-per-unit | 2.5 | persons | 平均家庭人数 |
| 停车位配比 | --parking-ratio | 1.0 | spaces | 每个住宅单元对应的停车位数量 |
示例
python scripts/area_calculator.py --site-area 5000 --far 2.5 --ntg-ratio 0.82
示例输出
=== Area & Density Calculator ===
Site Area: 5,000.00 m2
Floor Area Ratio: 2.50
---------------------------------------
Gross Floor Area: 12,500.00 m2
Net-to-Gross Ratio: 0.82
Net Gross Area: 10,250.00 m2
---------------------------------------
Average Unit Size: 85.00 m2
Estimated Units: 120
Persons per Unit: 2.50
Estimated Population: 300
---------------------------------------
Parking Ratio: 1.00 spaces/unit
Parking Spaces: 120
2. U 值计算器(uvalue_calculator.py)
通过累加各层的热阻和表面热阻,计算多层墙体、屋顶或地板构造的热传递系数(U 值)。
参数
| 参数 | 标志 | 默认值 | 单位 | 说明 |
|---|---|---|---|---|
| 构造层 | --layers | 必填 | JSON 字符串 | 构造层对象数组 |
| 内表面热阻 | --rsi-internal | 0.13 | m2K/W | 内表面热阻 |
| 外表面热阻 | --rsi-external | 0.04 | m2K/W | 外表面热阻 |
每个构造层对象:{"name": "...", "thickness_mm": N, "conductivity": N}
示例
python scripts/uvalue_calculator.py --layers '[
{"name": "Brick", "thickness_mm": 102, "conductivity": 0.77},
{"name": "Cavity air gap", "thickness_mm": 50, "conductivity": 0.18},
{"name": "Mineral wool", "thickness_mm": 100, "conductivity": 0.035},
{"name": "Concrete block", "thickness_mm": 140, "conductivity": 1.13},
{"name": "Plaster", "thickness_mm": 13, "conductivity": 0.16}
]'
示例输出
=== U-Value Calculator ===
Layer Thickness(mm) Conductivity(W/mK) R-value(m2K/W)
---------------------------------------------------------------------------
Rsi (internal) -- -- 0.1300
Brick 102 0.770 0.1325
Cavity air gap 50 0.180 0.2778
Mineral wool 100 0.035 2.8571
Concrete block 140 1.130 0.1239
Plaster 13 0.160 0.0813
Rse (external) -- -- 0.0400
---------------------------------------------------------------------------
Total R-value: 3.6425 m2K/W
U-value: 0.2745 W/m2K
Passive House target (wall): 0.15 W/m2K -- DOES NOT MEET
Typical code target (wall): 0.30 W/m2K -- MEETS TARGET
3. 日照计算器(daylight_calculator.py)
使用 BRE 简化公式估算侧窗采光房间的平均采光系数。
参数
| 参数 | 标志 | 默认值 | 单位 |
|---|---|---|---|
| 房间宽度 | --room-width | 必填 | m |
| 房间深度 | --room-depth | 必填 | m |
| 房间高度 | --room-height | 必填 | m |
| 窗户宽度 | --window-width | 必填 | m |
| 窗户高度 | --window-height | 必填 | m |
| 窗台高度 | --window-sill-height | 必填 | m |
| 玻璃透光率 | --glazing-transmittance | 0.65 | ratio |
| 平均反射率 | --average-reflectance | 0.50 | ratio |
示例
python scripts/daylight_calculator.py \
--room-width 4.0 --room-depth 6.0 --room-height 3.0 \
--window-width 2.5 --window-height 1.8 --window-sill-height 0.9
示例输出
=== Daylight Factor Calculator ===
Room: 4.00m W x 6.00m D x 3.00m H
Window: 2.50m W x 1.80m H (sill at 0.90m)
---------------------------------------
Window Area: 4.50 m2
Total Room Surface Area: 96.00 m2
Window-to-Floor Ratio: 18.75%
Glazing Transmittance: 0.65
Average Reflectance: 0.50
Visible Sky Angle: 60.1 deg
---------------------------------------
Average Daylight Factor: 2.34%
Assessment: ADEQUATE (target >= 2.0% for habitable rooms)
4. 疏散计算器(egress_calculator.py)
根据 IBC 计算人员荷载、所需出口数量、最小出口宽度以及疏散距离是否符合要求。
参数
| 参数 | 标志 | 默认值 | 描述 |
|---|---|---|---|
| 楼面面积 | --floor-area | 必填 | 净楼面面积,单位为 m2 |
| 使用类型 | --occupancy-type | 必填 | IBC 使用类型(A-1 至 U) |
| 是否安装喷淋系统 | --sprinklered | False | 标志:建筑是否安装喷淋系统 |
| 楼层数 | --num-stories | 1 | 楼层数量 |
示例
python scripts/egress_calculator.py --floor-area 800 --occupancy-type B --sprinklered --num-stories 4
示例输出
=== Egress Calculator ===
Floor Area: 800.00 m2
Occupancy Type: B (Business)
Sprinklered: Yes
Number of Stories: 4
---------------------------------------
Occupant Load Factor: 9.3 m2/person
Occupant Load: 86 persons
---------------------------------------
Required Exits: 2
Min Exit Width (total): 1,376 mm
Width per Exit: 688 mm
Min Door Width: 813 mm (32 inches)
---------------------------------------
Max Travel Distance: 91.0 m (300 ft) [sprinklered]
Max Common Path: 23.0 m (75 ft)
Max Dead End: 15.0 m (50 ft)
COMPLIANCE: Review travel distances on plans.
5. 结构荷载计算器(structural_load_calculator.py)
计算初步结构尺寸设计所需的从属面积重力荷载。
参数
| 参数 | 标志 | 默认值 | 单位 | 描述 |
|---|---|---|---|---|
| 从属面积 | --tributary-area | 必填 | m2 | 柱的从属面积 |
| 楼层数 | --num-floors | 必填 | 整数 | 支撑的楼层数 |
| 恒载 | --dead-load | 4.5 | kN/m2 | 每层恒载 |
| 活载 | --live-load | 自动 | kN/m2 | 活载(根据使用类型自动计算) |
| 使用类型 | --occupancy-type | office | 字符串 | 用于自动选择活载 |
示例
python scripts/structural_load_calculator.py --tributary-area 36 --num-floors 8 --occupancy-type office
示例输出
=== Structural Load Calculator ===
Tributary Area: 36.00 m2
Number of Floors: 8
---------------------------------------
Dead Load: 4.50 kN/m2 per floor
Live Load: 2.50 kN/m2 per floor (office)
Total per Floor: 7.00 kN/m2
---------------------------------------
Load per Floor: 252.00 kN
Total Column Load: 2,016.00 kN (8 floors)
Factored Load: 2,822.40 kN (1.2D + 1.6L)
---------------------------------------
Preliminary Column: ~400x400 mm RC (fc'=35 MPa)
6. 能源计算器(energy_calculator.py)
使用度日法估算年度供暖和制冷能耗需求。
参数
| 参数 | 标志 | 默认值 | 单位 | 描述 |
|---|---|---|---|---|
| 楼面面积 | --floor-area | 必填 | m2 | 空调楼面面积 |
| 围护结构面积 | --envelope-area | 必填 | m2 | 围护结构总面积 |
| 平均 U 值 | --average-u-value | 必填 | W/m2K | 面积加权平均 U 值 |
| 采暖度日数 | --heating-degree-days | 必填 | Kd | 年采暖度日数(基准温度 18C) |
| 制冷度日数 | --cooling-degree-days | 必填 | Kd | 年制冷度日数(基准温度 24C) |
| 通风率 | --ventilation-rate | 0.5 | ACH | 每小时换气次数 |
| 内部得热 | --internal-gains | 5.0 | W/m2 | 内部热增益 |
示例
python scripts/energy_calculator.py \
--floor-area 500 --envelope-area 800 --average-u-value 0.35 \
--heating-degree-days 3000 --cooling-degree-days 500
示例输出
=== Energy Calculator ===
Floor Area: 500.00 m2
Envelope Area: 800.00 m2
Average U-value: 0.35 W/m2K
---------------------------------------
Heating Degree Days: 3,000 Kd
Cooling Degree Days: 500 Kd
Ventilation Rate: 0.50 ACH
Internal Gains: 5.00 W/m2
---------------------------------------
Transmission Loss: 6,720.00 kWh/yr
Ventilation Loss: 4,050.00 kWh/yr
Internal Gains: -2,190.00 kWh/yr
Heating Demand: 8,580.00 kWh/yr
---------------------------------------
Cooling Demand: 2,356.00 kWh/yr
---------------------------------------
Total Demand: 10,936.00 kWh/yr
EUI: 21.87 kWh/m2/yr
Passive House target: 15 kWh/m2/yr -- DOES NOT MEET
7. 成本计算器(cost_calculator.py)
根据建筑类型、质量等级和地理区域估算建造成本。
参数
| 参数 | 标志 | 默认值 | 描述 |
|---|---|---|---|
| GFA | --gfa | 必填 | 总楼面面积,单位为 m2 |
| 建筑类型 | --building-type | 必填 | residential/office/retail/hospital/school/hotel |
| 质量等级 | --quality | standard | basic/standard/premium |
| 区域 | --region | north-america | north-america/europe/middle-east/asia/australia |
| 包含外部工程 | --include-external | False | 标志:包含场地工程 |
示例
python scripts/cost_calculator.py --gfa 5000 --building-type office --quality premium --region europe
示例输出
=== Construction Cost Calculator ===
Gross Floor Area: 5,000.00 m2
Building Type: Office
Quality Level: Premium
Region: Europe
---------------------------------------
Base Cost Rate: 2,800.00 USD/m2
Construction Cost: 14,000,000 USD
---------------------------------------
Professional Fees (12%): 1,680,000 USD
Contingency (7.5%): 1,050,000 USD
External Works: --
---------------------------------------
Total Development Cost: 16,730,000 USD
Cost per m2 (total): 3,346.00 USD/m2
方法参考
每个计算器的详细公式和方法记录在 references/calculator-reference.md 中。
错误处理
所有计算器都会验证输入并提供清晰的错误消息:
- 缺少必填参数时会显示用法帮助
- 超出范围的值会被拒绝,并显示说明性消息
- 无效的使用类型会列出可接受的值
- 格式错误的 JSON 输入会显示预期格式
集成
JSON 输出(--json 标志)可用于与以下工具和系统集成:
- 流水线中的其他脚本
- 电子表格工具(解析 JSON)
- Web 仪表板
- 自动化报告系统
- BIM 参数注入
评论
支持 Markdown