Writing a Deterministic IFC Chapter 10 Egress-Width and Dead-End Corridor Validator for Trade Show Layouts in TypeScript
Building browser CAD software for event and exhibition floor plans presents a clean computational geometry problem: how do you translate municipal building and fire code rules (specifically International Fire Code Chapte
Building browser CAD software for event and exhibition floor plans presents a clean computational geometry problem: how do you translate municipal building and fire code rules (specifically International Fire Code Chapter 10 and NFPA 101) into fast, deterministic, zero-latency browser validation as users drag booths, banquet tables, and exit doors across a canvas?
General vector drawing tools treat a 10x10 trade show booth or a 60-inch banquet table as inert polygons. A code-aware CAD engine has to evaluate effective clear corridor widths, dead-end pocket lengths, zoned occupant loads, and aggregate egress door capacity in real time.
Below is the exact TypeScript architecture we use to validate trade show and assembly layouts deterministically in the browser.
1. Separating Physical Footprints from Clear Egress Envelopes
The most common geometric mistake in event floor-plan software is computing aisle clearance from bare furniture edges. Under IFC Section 1018.3 and 1020.3:
- Seated banquet tables require an occupied chair pull-out envelope (typically 18 inches beyond the table perimeter) before measuring clear aisle width.
- Exhibition booths (
10' x 10'or10' x 20') must keep all displays inside lease lines, while primary exit-access aisles for 50+ occupants must maintain at least 44 inches unobstructed clear width (36 inches for secondary aisles serving < 50 occupants; trade shows typically specify 8 to 10 feet between booth rows to preserve 44 inches clear during peak crowd flow).
We represent every placed fixture by both its physical bounding box (for drafting) and its inflated obstruction polygon (for egress routing):
export interface RectFt {
id: string;
kind: 'booth' | 'table_round' | 'table_rect' | 'stage' | 'bar';
x: number;
y: number;
w: number;
h: number;
chairMarginFt: number; // 1.5 ft (18") for seated tables, 0 for walled booths
}
export function getEgressObstacle(item: RectFt): {
minX: number;
minY: number;
maxX: number;
maxY: number;
} {
const pad = item.chairMarginFt;
return {
minX: item.x - pad,
minY: item.y - pad,
maxX: item.x + item.w + pad,
maxY: item.y + item.h + pad
};
}
2. Computing Minimum Clear Corridor Width via Spatial Sweeps
To detect pinch points between adjacent booth rows or between a bar queue and an exterior wall, we run a fast pairwise axis-aligned clearance check (with spatial hashing for 200+ fixtures):
export interface PinchViolation {
aId: string;
bId: string;
clearInches: number;
requiredInches: number;
codeRef: string;
}
export function checkPairwiseClearance(
a: ReturnType<typeof getEgressObstacle> & { id: string },
b: ReturnType<typeof getEgressObstacle> & { id: string },
requiredInches: number
): PinchViolation | null {
const overlapX = Math.min(a.maxX, b.maxX) - Math.max(a.minX, b.minX);
const overlapY = Math.min(a.maxY, b.maxY) - Math.max(a.minY, b.minY);
// Only adjacent parallel edges form a pass-through aisle
if (overlapX > 0 && overlapY <= 0) {
const gapIn = Math.abs(overlapY) * 12;
if (gapIn > 0.5 && gapIn < requiredInches) {
return {
aId: a.id,
bId: b.id,
clearInches: Number(gapIn.toFixed(1)),
requiredInches,
codeRef: requiredInches >= 44 ? 'IFC 1018.3 / 1020.3 (44 in main)' : 'IFC 1018.3 (36 in min)'
};
}
}
if (overlapY > 0 && overlapX <= 0) {
const gapIn = Math.abs(overlapX) * 12;
if (gapIn > 0.5 && gapIn < requiredInches) {
return {
aId: a.id,
bId: b.id,
clearInches: Number(gapIn.toFixed(1)),
requiredInches,
codeRef: requiredInches >= 44 ? 'IFC 1018.3 / 1020.3 (44 in main)' : 'IFC 1018.3 (36 in min)'
};
}
}
return null;
}
Why the gapIn > 0.5 guard? In trade show halls, back-to-back 10x10 booths share a pipe-and-drape back wall (gap = 0"). They are intentionally contiguous, not a narrow walkway. Ignoring zero-gap abutting booths while flagging any gap between 0.5" and 44" cleanly catches real aisle pinch points without false positives on booth blocks.
3. Detecting Dead-End Corridors (> 20 ft) and Travel Distance on a Walkable Grid
Under IFC Section 1020.5, dead-end corridors in assembly and exhibition halls generally cannot exceed 20 feet (or up to 50 feet only under specific fully sprinklered Group B/M exceptions, never unsprinklered assembly halls). Meanwhile, maximum exit access travel distance is 200 feet unsprinklered or 250 feet fully sprinklered (IFC Table 1017.2).
On a 1 ft x 1 ft discretized room grid (e.g., 60 x 90 = 5,400 cells - trivial in JS, taking < 1.5 ms):
- Mark cells intersecting any inflated
getEgressObstacleas blocked. - Run a multi-source Dijkstra / BFS outward from every exit door cell to compute exact walkable shortest-path distance
distToExit[cell]to the nearest exit. - For dead-end detection, find any walkable corridor cell whose open-walkable graph path only reaches exits through a single articulation choke point (or compute degree-1 skeleton branches) whose path length from the branch tip to the nearest junction offering two independent routes exceeds
20 ft.
export function computeRequiredExitWidthIn(
occupantLoad: number,
sprinklered: boolean
): number {
// IFC Section 1005.3.2: 0.2 in/occupant unsprinklered, 0.15 in/occupant sprinklered
const factor = sprinklered ? 0.15 : 0.2;
return Number((occupantLoad * factor).toFixed(1));
}
export function requiredExitCount(occupantLoad: number): number {
// IFC Table 1006.3.4(1) / 1006.2.1 (Group A assembly)
if (occupantLoad < 50) return 1;
if (occupantLoad <= 500) return 2;
if (occupantLoad <= 1000) return 3;
return 4;
}
4. Putting Geometry, Code Rules, and Vector Export Together
Once the deterministic rules pass in TypeScript, the exact same geometry tree serializes directly into:
- A scaled
1/8"=1'-0"or1/16"=1'-0"3-sheet vector PDF submittal packet (FP-101,FP-102,FP-103), and - A true 1:1 7-layer AutoCAD R2000 ASCII
.DXFfile so venues or licensed engineers can open the drawing natively without redrawing a single line.
You can explore the live trade show and Fire Marshal CAD compliance workflow at https://www.egresscad.com/guides/trade-show-expo-booth-floor-plan-fire-code.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.