Zoning¶
Automatic thermal zoning for EnergyPlus models. Splits a 2-D building
footprint into thermal zones and creates all Zone,
BuildingSurface:Detailed, and (optionally) Construction:AirBoundary
objects needed for simulation.
Quick Start¶
from idfkit import new_document, create_building, ZoningScheme
from idfkit.zoning import footprint_rectangle
doc = new_document()
create_building(
doc,
name="Office",
footprint=footprint_rectangle(50, 30),
floor_to_floor=3.5,
num_stories=3,
zoning=ZoningScheme.CORE_PERIMETER,
)
# 3 stories × 5 zones (4 perimeter + 1 core) = 15 zones
print(len(doc["Zone"])) # 15
Zoning Schemes¶
create_building supports three zoning strategies via the zoning parameter:
| Scheme | Zones per floor | Description |
|---|---|---|
BY_STOREY |
1 | One zone per floor (default). |
CORE_PERIMETER |
5 | Four orientation-based perimeter zones plus an interior core zone. |
CUSTOM |
User-defined | Caller supplies named zone polygons via custom_zones. |
By Storey (default)¶
The simplest scheme — one thermal zone per floor:
from idfkit import new_document, create_building
doc = new_document()
create_building(
doc,
name="Warehouse",
footprint=[(0, 0), (40, 0), (40, 20), (0, 20)],
floor_to_floor=4.0,
num_stories=2,
)
print(len(doc["Zone"])) # 2
Core-Perimeter¶
Splits each floor into four perimeter zones (North, East, South, West) and one interior core zone. The perimeter depth defaults to 4.57 m (15 ft) per ASHRAE 90.1 Appendix G and the DOE prototype buildings.
from idfkit import new_document, create_building, ZoningScheme
from idfkit.zoning import footprint_rectangle
doc = new_document()
create_building(
doc,
name="Office",
footprint=footprint_rectangle(50, 30),
floor_to_floor=3.5,
num_stories=3,
zoning=ZoningScheme.CORE_PERIMETER,
)
# 3 stories × 5 zones = 15 zones
print(len(doc["Zone"])) # 15
You can override the perimeter depth:
from idfkit import new_document, create_building, ZoningScheme
from idfkit.zoning import footprint_rectangle
doc = new_document()
create_building(
doc,
name="Office",
footprint=footprint_rectangle(50, 30),
floor_to_floor=3.5,
num_stories=1,
zoning=ZoningScheme.CORE_PERIMETER,
perimeter_depth=3.0, # 3 m instead of the default 4.57 m
)
Note
When the footprint is too small for the requested perimeter depth (i.e. the inradius is less than 0.5 m after insetting), zoning automatically falls back to a single zone per floor.
Custom Zoning¶
Supply your own named zone polygons per floor using custom_zones.
Each entry is a (name, polygon) tuple:
from idfkit import ZoneFootprint, ZoningScheme, create_building, new_document
doc = new_document()
create_building(
doc,
name="Lab",
footprint=[(0, 0), (30, 0), (30, 20), (0, 20)],
floor_to_floor=3.5,
num_stories=1,
zoning=ZoningScheme.CUSTOM,
custom_zones=[
ZoneFootprint("Wet Lab", [(0, 0), (15, 0), (15, 20), (0, 20)]),
ZoneFootprint("Dry Lab", [(15, 0), (30, 0), (30, 20), (15, 20)]),
],
)
print(len(doc["Zone"])) # 2
Air Boundaries¶
Set air_boundary=True to apply Construction:AirBoundary to all
inter-zone walls. This is useful for open-plan spaces where zone
boundaries are notional rather than physical:
from idfkit import new_document, create_building, ZoningScheme
from idfkit.zoning import footprint_rectangle
doc = new_document()
create_building(
doc,
name="Open Office",
footprint=footprint_rectangle(50, 30),
floor_to_floor=3.5,
num_stories=1,
zoning=ZoningScheme.CORE_PERIMETER,
air_boundary=True,
)
# A Construction:AirBoundary object is created automatically
print(len(doc["Construction:AirBoundary"])) # 1
Multi-Story Boundary Conditions¶
For multi-story buildings, inter-story floors and ceilings are
automatically linked with Surface boundary conditions:
| Story | Floor BC | Ceiling BC |
|---|---|---|
| Ground floor | Ground |
Surface (story above) |
| Mid floors | Surface (story below) |
Surface (story above) |
| Top floor | Surface (story below) |
Outdoors (Roof) |
Footprint Helpers¶
Pre-built footprint generators for common commercial building shapes.
All return a list of (x, y) tuples in counter-clockwise order.
footprint_rectangle¶
from idfkit.zoning import footprint_rectangle
fp = footprint_rectangle(50, 30)
# [(0, 0), (50, 0), (50, 30), (0, 30)]
footprint_l_shape¶
from idfkit.zoning import footprint_l_shape
fp = footprint_l_shape(width=40, depth=10, wing_width=15, wing_depth=20)
footprint_u_shape¶
from idfkit.zoning import footprint_u_shape
fp = footprint_u_shape(width=40, depth=30, courtyard_width=20, courtyard_depth=15)
footprint_t_shape¶
from idfkit.zoning import footprint_t_shape
fp = footprint_t_shape(base_width=20, base_depth=15, top_width=40, top_depth=10)
footprint_h_shape¶
from idfkit.zoning import footprint_h_shape
fp = footprint_h_shape(width=40, depth=30, courtyard_width=20, courtyard_depth=10)
footprint_courtyard¶
from idfkit.zoning import footprint_courtyard
fp = footprint_courtyard(outer_width=50, outer_depth=40, inner_width=30, inner_depth=20)
Using Footprint Helpers with create_building¶
All footprint helpers plug directly into create_building:
from idfkit import new_document, create_building, ZoningScheme
from idfkit.zoning import footprint_l_shape
doc = new_document()
create_building(
doc,
name="L-Wing",
footprint=footprint_l_shape(40, 10, 15, 20),
floor_to_floor=3.5,
num_stories=2,
zoning=ZoningScheme.CORE_PERIMETER,
)
ZonedBlock (Describe-then-Apply)¶
ZonedBlock is a frozen dataclass alternative that validates all
parameters up front. Call build() to realise the geometry.
This describe-then-apply pattern lets you inspect computed properties
before committing to a document.
from idfkit import new_document, ZonedBlock, ZoningScheme
from idfkit.zoning import footprint_rectangle
block = ZonedBlock(
name="Office",
footprint=footprint_rectangle(50, 30),
floor_to_floor=3.5,
num_stories=3,
zoning=ZoningScheme.CORE_PERIMETER,
)
print(f"Building height: {block.height} m") # 10.5
print(f"Floor area: {block.floor_area} m²") # 1500.0
print(f"Total floor area: {block.total_floor_area} m²") # 4500.0
doc = new_document()
objects = block.build(doc)
print(len(objects)) # all created Zone + BuildingSurface:Detailed objects
API Reference¶
Automatic thermal zoning for EnergyPlus models.
Splits a 2-D building footprint into thermal zones using one of several
standard schemes and creates all Zone, BuildingSurface:Detailed,
and (optionally) Construction:AirBoundary objects needed for
simulation.
Three zoning schemes are provided:
- by_storey - one zone per floor.
- core_perimeter - four orientation-based perimeter zones plus an interior core zone per floor. Perimeter depth defaults to 4.57 m (15 ft) per ASHRAE 90.1 Appendix G and the DOE prototype buildings.
- custom - the caller supplies named polygons for each floor.
Footprint helpers for common commercial shapes (rectangle, L, U, T, H, courtyard) are included so users never have to compute vertices by hand.
Examples:
from idfkit import new_document
from idfkit.zoning import (
ZoningScheme,
create_building,
footprint_rectangle,
)
doc = new_document()
zones = create_building(
doc,
name="Office",
footprint=footprint_rectangle(50, 30),
floor_to_floor=3.5,
num_stories=3,
zoning=ZoningScheme.CORE_PERIMETER,
perimeter_depth=4.57,
)
ZoneFootprint
dataclass
¶
Named 2-D polygon for one thermal zone on one floor.
Source code in src/idfkit/zoning.py
ZonedBlock
dataclass
¶
Describes a building block with a zoning strategy.
This is a pure data object. Call build() to realise the
geometry in an IDFDocument.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Base name for zones and surfaces. |
footprint |
Sequence[tuple[float, float]]
|
2-D footprint as |
floor_to_floor |
float
|
Floor-to-floor height in metres. |
num_stories |
int
|
Number of above-ground stories. |
zoning |
ZoningScheme
|
Zoning strategy. |
perimeter_depth |
float
|
Perimeter zone depth (metres), used only
when |
custom_zones |
list[ZoneFootprint] | None
|
Per-floor named zone polygons, used only when
|
air_boundary |
bool
|
Whether to use |
Source code in src/idfkit/zoning.py
864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 | |
floor_area
property
¶
Single-floor footprint area in square metres.
height
property
¶
Total building height in metres.
total_floor_area
property
¶
Total floor area across all stories in square metres.
build(doc)
¶
Realise the zoned geometry in the document.
Returns:
| Type | Description |
|---|---|
list[IDFObject]
|
All created IDFObject instances. |
Source code in src/idfkit/zoning.py
ZoningScheme
¶
Bases: Enum
Thermal zoning strategy.
Attributes:
| Name | Type | Description |
|---|---|---|
BY_STOREY |
One zone per floor. |
|
CORE_PERIMETER |
Core + 4 perimeter zones per floor. |
|
CUSTOM |
User-supplied zone polygons per floor. |
Source code in src/idfkit/zoning.py
create_building(doc, name, footprint, floor_to_floor, num_stories=1, *, zoning=ZoningScheme.BY_STOREY, perimeter_depth=ASHRAE_PERIMETER_DEPTH, custom_zones=None, air_boundary=False)
¶
Create a fully-zoned building in one call.
This is the primary entry point for the zoning module. It combines footprint definition, zoning strategy, and multi-story extrusion into a single function call.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc
|
IDFDocument
|
The document to add objects to. |
required |
name
|
str
|
Base name for zones and surfaces (e.g. |
required |
footprint
|
Sequence[tuple[float, float]]
|
2-D footprint as |
required |
floor_to_floor
|
float
|
Floor-to-floor height in metres. |
required |
num_stories
|
int
|
Number of above-ground stories. |
1
|
zoning
|
ZoningScheme
|
Zoning strategy (default: one zone per floor). |
BY_STOREY
|
perimeter_depth
|
float
|
Depth of perimeter zones in metres.
Only used when |
ASHRAE_PERIMETER_DEPTH
|
custom_zones
|
list[ZoneFootprint] | None
|
Named zone polygons, required when |
None
|
air_boundary
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
list[IDFObject]
|
All created IDFObject instances. |
Examples:
Core-perimeter zoning for a 3-story office:
```python
from idfkit import new_document
from idfkit.zoning import (
ZoningScheme,
create_building,
footprint_rectangle,
)
doc = new_document()
create_building(
doc,
name="Office",
footprint=footprint_rectangle(50, 30),
floor_to_floor=3.5,
num_stories=3,
zoning=ZoningScheme.CORE_PERIMETER,
)
```
Source code in src/idfkit/zoning.py
970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 | |
footprint_courtyard(outer_width, outer_depth, inner_width, inner_depth, origin=(0.0, 0.0))
¶
Return a courtyard (donut) footprint as a single slit polygon.
The polygon traces the outer boundary counter-clockwise, steps into the inner courtyard through a slit at the bottom-right corner, traces the courtyard clockwise, and returns. This is a valid simple polygon that EnergyPlus can handle.
```text
┌──────────────────┐
│ ┌────────────┐ │
│ │ courtyard │ │
│ └────────────┘ │
└──────────────────┘
```
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outer_width
|
float
|
Outer bounding box width (X). |
required |
outer_depth
|
float
|
Outer bounding box depth (Y). |
required |
inner_width
|
float
|
Courtyard width (X), must be < outer_width. |
required |
inner_depth
|
float
|
Courtyard depth (Y), must be < outer_depth. |
required |
origin
|
tuple[float, float]
|
|
(0.0, 0.0)
|
Source code in src/idfkit/zoning.py
footprint_h_shape(width, depth, courtyard_width, courtyard_depth, origin=(0.0, 0.0))
¶
Return an H-shaped footprint (counter-clockwise).
Two symmetrical courtyards are cut from the left and right sides of the bounding rectangle.
```text
┌──────┐ ┌──────┐
│ └────┘ │
│ connector │
│ ┌────┐ │
└──────┘ └──────┘
```
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
Overall width (X). |
required |
depth
|
float
|
Overall depth (Y). |
required |
courtyard_width
|
float
|
Width of each courtyard notch (X). |
required |
courtyard_depth
|
float
|
Depth of each courtyard notch (Y). |
required |
origin
|
tuple[float, float]
|
|
(0.0, 0.0)
|
Source code in src/idfkit/zoning.py
footprint_l_shape(width, depth, wing_width, wing_depth, origin=(0.0, 0.0))
¶
Return an L-shaped footprint (counter-clockwise).
The base rectangle runs from the origin along width (X) and
depth (Y). A shorter wing extends upward from the left side
with dimensions wing_width x wing_depth.
```text
┌────────┐
│ wing │
│ │
├────────┴──────────┐
│ base │
└───────────────────┘
```
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
Base width (X). |
required |
depth
|
float
|
Base depth (Y). |
required |
wing_width
|
float
|
Wing width (X), must be <= width. |
required |
wing_depth
|
float
|
Wing depth (Y), added above the base. |
required |
origin
|
tuple[float, float]
|
|
(0.0, 0.0)
|
Source code in src/idfkit/zoning.py
footprint_rectangle(width, depth, origin=(0.0, 0.0))
¶
Return a rectangular footprint (counter-clockwise).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
Dimension along the X axis (metres). |
required |
depth
|
float
|
Dimension along the Y axis (metres). |
required |
origin
|
tuple[float, float]
|
|
(0.0, 0.0)
|
Source code in src/idfkit/zoning.py
footprint_t_shape(base_width, base_depth, top_width, top_depth, origin=(0.0, 0.0))
¶
Return a T-shaped footprint (counter-clockwise).
A narrower base rectangle is centred below a wider top bar.
```text
┌──────────────────────┐
│ top bar │
└───┐ ┌───┘
│ base │
└──────────────┘
```
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_width
|
float
|
Width of the stem (X). |
required |
base_depth
|
float
|
Depth of the stem (Y). |
required |
top_width
|
float
|
Width of the top bar (X), must be >= base_width. |
required |
top_depth
|
float
|
Depth of the top bar (Y). |
required |
origin
|
tuple[float, float]
|
|
(0.0, 0.0)
|
Source code in src/idfkit/zoning.py
footprint_u_shape(width, depth, courtyard_width, courtyard_depth, origin=(0.0, 0.0))
¶
Return a U-shaped footprint (counter-clockwise).
The overall bounding box is width x depth. A rectangular
courtyard is cut from the top centre of the footprint.
```text
┌──────┐ ┌──────┐
│ │ │ │
│ └────┘ │
│ │
└──────────────────┘
```
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
Overall width (X). |
required |
depth
|
float
|
Overall depth (Y). |
required |
courtyard_width
|
float
|
Width of the courtyard opening (X). |
required |
courtyard_depth
|
float
|
Depth of the courtyard from the top edge (Y). |
required |
origin
|
tuple[float, float]
|
|
(0.0, 0.0)
|
Source code in src/idfkit/zoning.py
See Also¶
- Geometry Builders -- Shading blocks and utility functions
(
bounding_box,scale_building,set_default_constructions) - Geometry -- Lower-level 3D primitives, coordinate transforms, and surface intersection
- Visualization -- 3D rendering of building geometry