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.
Not in JavaScript yet
Generating zoned blocks from a footprint is available in Python and is not in JavaScript today. A temporary gap, not a boundary. The port is tracked in idfkit-js#16.
The full entry, including the vocabulary this capability owns, is on the capability parity page.
Quick Start¶
from idfkit import new_document, create_block, ZoningScheme
from idfkit.zoning import footprint_rectangle
doc = new_document()
create_block(
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_block 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_block
doc = new_document()
create_block(
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_block, ZoningScheme
from idfkit.zoning import footprint_rectangle
doc = new_document()
create_block(
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_block, ZoningScheme
from idfkit.zoning import footprint_rectangle
doc = new_document()
create_block(
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_block, new_document
doc = new_document()
create_block(
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_block, ZoningScheme
from idfkit.zoning import footprint_rectangle
doc = new_document()
create_block(
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 (base_elevation=0) |
Ground |
Surface (story above) |
Elevated ground floor (base_elevation>0) |
Outdoors |
Surface (story above) |
| Mid floors | Surface (story below) |
Surface (story above) |
| Top floor | Surface (story below) |
Outdoors (Roof) |
Stacked Blocks (Setbacks)¶
Buildings with setbacks — where upper floors have a smaller footprint —
are modelled as separate blocks stacked with base_elevation, then
connected with link_blocks:
from idfkit import new_document, create_block, link_blocks
from idfkit.zoning import footprint_rectangle
doc = new_document()
# 5-story base
create_block(
doc,
name="Base",
footprint=footprint_rectangle(50, 30),
floor_to_floor=3.5,
num_stories=5,
)
# 3-story tower with a setback, stacked on top of the base
create_block(
doc,
name="Tower",
footprint=footprint_rectangle(40, 24),
floor_to_floor=3.5,
num_stories=3,
base_elevation=17.5, # 5 × 3.5 m
)
# Auto-detect and link roof/floor pairs at z=17.5
linked = link_blocks(doc)
link_blocks finds all roof and floor surfaces at shared elevations,
splits roofs that partially overlap a floor, and sets mutual Surface
boundary conditions between the new ceiling and floor. The original
roof is shrunk to cover only the remaining exposed area.
To link only specific blocks by name, pass lower and upper:
For finer control, use the lower-level adjacency API directly.
Footprint Helpers¶
Pre-built footprint generators for common commercial building shapes.
All return a list of (x, y) tuples in counter-clockwise order.
A footprint you write by hand may be in either order. create_block, ZonedBlock and
add_shading_block reverse a clockwise footprint, so the block is never built inside-out, and
raise ValueError for one with no area. counter_clockwise_footprint() does the same
normalisation for your own code.
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_block¶
All footprint helpers plug directly into create_block:
from idfkit import new_document, create_block, ZoningScheme
from idfkit.zoning import footprint_l_shape
doc = new_document()
create_block(
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_block,
footprint_rectangle,
)
doc = new_document()
zones = create_block(
doc,
name="Office",
footprint=footprint_rectangle(50, 30),
floor_to_floor=3.5,
num_stories=3,
zoning=ZoningScheme.CORE_PERIMETER,
perimeter_depth=4.57,
)
ASHRAE_PERIMETER_DEPTH = 4.57
module-attribute
¶
ZoneFootprint
dataclass
¶
Named 2-D polygon for one thermal zone on one floor.
Source code in 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 |
base_elevation |
float
|
Elevation of the ground floor in metres. Use this to stack blocks at different heights for setbacks. |
Source code in idfkit/zoning.py
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 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 | |
air_boundary = False
class-attribute
instance-attribute
¶
base_elevation = 0.0
class-attribute
instance-attribute
¶
custom_zones = None
class-attribute
instance-attribute
¶
floor_area
property
¶
Single-floor footprint area in square metres.
floor_to_floor
instance-attribute
¶
footprint
instance-attribute
¶
height
property
¶
Total building height in metres.
name
instance-attribute
¶
num_stories = 1
class-attribute
instance-attribute
¶
perimeter_depth = ASHRAE_PERIMETER_DEPTH
class-attribute
instance-attribute
¶
total_floor_area
property
¶
Total floor area across all stories in square metres.
zoning = ZoningScheme.BY_STOREY
class-attribute
instance-attribute
¶
build(doc)
¶
Realise the zoned geometry in the document.
Returns:
| Type | Description |
|---|---|
list[IDFObject]
|
All created IDFObject instances. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in 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 idfkit/zoning.py
create_block(doc, name, footprint, floor_to_floor, num_stories=1, *, zoning=ZoningScheme.BY_STOREY, perimeter_depth=ASHRAE_PERIMETER_DEPTH, custom_zones=None, air_boundary=False, base_elevation=0.0)
¶
Create a fully-zoned building block 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.
For setback buildings, create multiple blocks at different elevations and link them with link_blocks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc
|
AnyIDFDocument
|
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
|
base_elevation
|
float
|
Elevation of the ground floor in metres.
Defaults to 0. When > 0, the ground-floor boundary
condition is |
0.0
|
Returns:
| Type | Description |
|---|---|
list[IDFObject]
|
All created IDFObject instances. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Examples:
Core-perimeter zoning for a 3-story office:
```python
from idfkit import new_document
from idfkit.zoning import (
ZoningScheme,
create_block,
footprint_rectangle,
)
doc = new_document()
create_block(
doc,
name="Office",
footprint=footprint_rectangle(50, 30),
floor_to_floor=3.5,
num_stories=3,
zoning=ZoningScheme.CORE_PERIMETER,
)
```
Source code in idfkit/zoning.py
1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 | |
create_courtyard_block(doc, name, outer, courtyards, floor_to_floor, num_stories=1, *, air_boundary=False, base_elevation=0.0)
¶
Create a block with one or more courtyards cut out of its footprint.
EnergyPlus surfaces cannot have holes, so the footprint outer minus
courtyards is split into hole-free pieces with
polygon_difference_parts_2d
and each piece becomes one zone per story, named
"<name> Part <k>" ("<name> Story <n> Part <k>" for several
stories), largest piece first. The pieces are built as CUSTOM
zones of a single block, so the walls along the cuts between pieces
are interior walls (Surface boundary, paired with the neighbouring
piece's wall) rather than exterior walls, and the courtyard facades are
exterior walls. The pieces come from one planar overlay, so wherever
two of them touch they carry the same vertices, which is what the
reversed-edge wall pairing needs. No surface has repeated or
coincident vertices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc
|
AnyIDFDocument
|
The document to add objects to. |
required |
name
|
str
|
Base name for zones and surfaces. |
required |
outer
|
Sequence[tuple[float, float]]
|
Outer 2-D footprint as |
required |
courtyards
|
Sequence[Sequence[tuple[float, float]]]
|
Polygons to cut out of outer. They may touch or cross the outer boundary, which leaves a notch instead of a hole. |
required |
floor_to_floor
|
float
|
Floor-to-floor height in metres. |
required |
num_stories
|
int
|
Number of above-ground stories. |
1
|
air_boundary
|
bool
|
If |
False
|
base_elevation
|
float
|
Elevation of the ground floor in metres. |
0.0
|
Returns:
| Type | Description |
|---|---|
list[IDFObject]
|
All created IDFObject instances. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If outer or a courtyard has fewer than three
vertices (for example a single polygon passed as
courtyards instead of a list of polygons), or if the
courtyards cover the whole footprint, or if |
Examples:
A 50 x 40 m block around a centred 20 x 10 m courtyard:
```python
from idfkit import new_document
from idfkit.zoning import create_courtyard_block, footprint_rectangle
doc = new_document()
create_courtyard_block(
doc,
"Office",
footprint_rectangle(50, 40),
[footprint_rectangle(20, 10, origin=(15, 15))],
floor_to_floor=3.5,
num_stories=2,
)
```
Source code in idfkit/zoning.py
1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 | |
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.
Deprecated
Use footprint_courtyard_parts
for hole-free pieces, or
create_courtyard_block to build
the block directly. This function emits a DeprecationWarning and
will be removed in a future release.
The polygon traces the outer boundary counter-clockwise, steps into the courtyard through a zero-width slit from the left edge, traces the courtyard clockwise, and returns along the slit. The area is right, but the slit vertex appears twice and the slit is traversed in both directions, so create_block turns it into two overlapping, opposite-facing exterior walls and a self-touching floor and roof, which EnergyPlus rejects. EnergyPlus surfaces cannot have holes, so a courtyard has to be split into several simple pieces.
```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 idfkit/zoning.py
footprint_courtyard_parts(outer_width, outer_depth, inner_width, inner_depth, origin=(0.0, 0.0))
¶
Return a centred-courtyard footprint as hole-free pieces.
EnergyPlus surfaces cannot have holes, so the ring around the
courtyard is cut by a vertical line through the courtyard's centre
into two U-shaped halves. The pieces are simple, counter-clockwise,
free of repeated or coincident vertices, and do not overlap; their
areas add up to outer_width * outer_depth - inner_width * inner_depth.
The two cut edges are shared exactly, so passing the pieces as
CUSTOM zones of one block (which
create_courtyard_block does)
makes them interior walls.
```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)
|
Returns:
| Type | Description |
|---|---|
list[list[tuple[float, float]]]
|
The pieces, largest first. |
Examples:
>>> from idfkit.geometry import polygon_area_2d
>>> parts = footprint_courtyard_parts(50, 40, 20, 10)
>>> parts[0]
[(0.0, 0.0), (25.0, 0.0), (25.0, 15.0), (15.0, 15.0), (15.0, 25.0), (25.0, 25.0), (25.0, 40.0), (0.0, 40.0)]
>>> sum(polygon_area_2d(p) for p in parts)
1800.0
Source code in 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 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 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 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 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 idfkit/zoning.py
link_blocks(doc, lower=None, upper=None)
¶
Link stacked building blocks at shared elevations.
Detects roof and floor surfaces at matching elevations, splits
surfaces where the footprints differ, and sets Surface boundary
conditions between the resulting ceiling/floor pairs.
Can be called in two ways:
link_blocks(doc)— auto-detect all stacked blocks.link_blocks(doc, "Base", "Tower")— link only the named blocks (surfaces whose zone name starts with the given prefix).
Uses the lower-level detect_horizontal_adjacencies, split_horizontal_surface_by_regions, and link_horizontal_surfaces functions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc
|
AnyIDFDocument
|
The document containing the blocks. |
required |
lower
|
str | None
|
Optional name prefix for the lower block. |
None
|
upper
|
str | None
|
Optional name prefix for the upper block. |
None
|
Returns:
| Type | Description |
|---|---|
list[IDFObject]
|
All created or modified surface objects. |
Examples:
Setback building with a podium and tower:
```python
from idfkit import new_document
from idfkit.zoning import create_block, link_blocks, footprint_rectangle
doc = new_document()
create_block(doc, "Base", footprint_rectangle(50, 30), 3.5, num_stories=5)
create_block(doc, "Tower", footprint_rectangle(40, 24), 3.5, num_stories=3, base_elevation=17.5)
linked = link_blocks(doc)
```
Source code in idfkit/zoning.py
1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 | |
See Also¶
- Geometry Builders -- Shading blocks, horizontal adjacency detection, surface splitting, and utility functions
- Geometry -- Lower-level 3D primitives, coordinate transforms, and surface intersection
- Visualization -- 3D rendering of building geometry