Detached ADU & Garage Apartment Floor Plan Math: Setbacks, Egress Windows & 1/4-Inch Scale PDFs in TypeScript
Homeowners planning a detached backyard ADU, garage apartment, or finished egress basement usually hit the same two bottlenecks: first, discovering their lot's rear and side setbacks shrink the buildable rectangle far mo
Homeowners planning a detached backyard ADU, garage apartment, or finished egress basement usually hit the same two bottlenecks: first, discovering their lot's rear and side setbacks shrink the buildable rectangle far more than expected; second, discovering a bedroom window or stair landing fails IRC R310 emergency escape and rescue opening rules after framing starts.
When we built PlanCaliber's ADU & Basement Floor Plan Studio, we encoded both the buildable lot envelope AND exact IRC R310 egress checks directly in TypeScript so you can verify footprint geometry before paying for full construction drawings.
1. Computing the Buildable Backyard ADU Envelope
Start with the parcel width, rear yard depth, zoning side/rear setbacks, and maximum local ADU square-footage cap (commonly 800, 850, 1,000, or 1,200 sq ft across US municipalities):
export interface LotEnvelopeInput {
lotWidthFt: number;
availableRearDepthFt: number;
sideSetbackFt: number; // e.g., 4 ft in CA/WA/OR ADU rules, 5-10 ft elsewhere
rearSetbackFt: number; // e.g., 4 ft rear setback
mainHouseSeparationFt: number; // often 6-10 ft fire separation between structures
maxAllowedSqFt: number; // local cap, e.g., 850 or 1000 sq ft
}
export interface BuildableFootprint {
maxWidthFt: number;
maxDepthFt: number;
envelopeSqFt: number;
effectiveMaxSqFt: number;
fits28x36GarageApt: boolean;
fits20x30OneBedAdu: boolean;
}
export function solveAduEnvelope(input: LotEnvelopeInput): BuildableFootprint {
const maxWidthFt = Math.max(0, input.lotWidthFt - input.sideSetbackFt * 2);
const maxDepthFt = Math.max(
0,
input.availableRearDepthFt - input.rearSetbackFt - input.mainHouseSeparationFt
);
const envelopeSqFt = Math.floor(maxWidthFt * maxDepthFt);
const effectiveMaxSqFt = Math.min(envelopeSqFt, input.maxAllowedSqFt);
return {
maxWidthFt,
maxDepthFt,
envelopeSqFt,
effectiveMaxSqFt,
fits28x36GarageApt: maxWidthFt >= 36 && maxDepthFt >= 28 && input.maxAllowedSqFt >= 1008,
fits20x30OneBedAdu: maxWidthFt >= 30 && maxDepthFt >= 20 && input.maxAllowedSqFt >= 600,
};
}
Test this live with your own parcel dimensions in our free ADU Size & Setback Calculator, or load our 36'x28' Garage Apartment & Workshop CAD Template directly in the browser.
2. IRC R310 Egress Window Geometry Check (Double-Hung vs. Casement)
Every sleeping room in a detached ADU or finished basement requires an emergency escape and rescue opening. The mistake that catches contractors off guard is confusing nominal rough-opening size with actual net clear opening when the sash is open:
- Minimum net clear opening area:
5.7sq ft (5.0sq ft at grade floor) - Minimum net clear opening height:
24" - Minimum net clear opening width:
20" - Maximum finished sill height above floor:
44"
A 36" x 48" double-hung window looks big on paper (12 sq ft nominal), yet only the bottom half opens, cutting clear height to ~21" and failing IRC R310.2.1! Switching that same opening to a single casement hinge clears 32" x 44" (9.78 sq ft) and passes with room to spare.
export interface EgressCheckInput {
netClearWidthIn: number;
netClearHeightIn: number;
sillHeightFromFloorIn: number;
isGradeFloor: boolean;
}
export function checkIrcR310Egress(w: EgressCheckInput) {
const netAreaSqFt = (w.netClearWidthIn * w.netClearHeightIn) / 144;
const minAreaSqFt = w.isGradeFloor ? 5.0 : 5.7;
const failures: string[] = [];
if (w.netClearWidthIn < 20) failures.push('Net clear width < 20 in (IRC R310.2.1)');
if (w.netClearHeightIn < 24) failures.push('Net clear height < 24 in (IRC R310.2.1)');
if (netAreaSqFt < minAreaSqFt) {
failures.push(`Net clear area ${netAreaSqFt.toFixed(2)} sq ft < ${minAreaSqFt} sq ft min`);
}
if (w.sillHeightFromFloorIn > 44) {
failures.push(`Sill height ${w.sillHeightFromFloorIn} in > 44 in max (IRC R310.2.2)`);
}
return {
pass: failures.length === 0,
netAreaSqFt: Number(netAreaSqFt.toFixed(2)),
failures,
};
}
Verify any basement or ADU window plus window-well dimensions (9 sq ft min area, 36" projection, ladder if > 44" deep) in our free IRC Egress Window Calculator.
3. From Editable 2D/3D ADU Template to Scaled 1/4"=1'-0" PDF & .DXF
Instead of drawing an ADU from scratch or paying $49/mo for bloated CAD subscriptions you only need for one weekend, open any of PlanCaliber's pre-dimensioned US ADU templates (420 sq ft Studio, 600 sq ft 1-Bed, 850 sq ft 2-Bed, 750 sq ft In-Law Suite, or 28'x36' Garage Apartment) free in your browser:
- Drag walls, doors, windows, kitchen appliances, and laundry clearances to fit your exact lot setbacks.
- Inspect live 3D cutaway view and automatic exterior/interior dimension strings (
ft-in). - Download a free
1400x1050watermarked proof PNG to share with family or contractors, or unlock clean deliverables once with no subscription:-
$9Print Pass: Clean unwatermarked 2-sheet vector PDF (A-101Floor Plan +M-101Materials Schedule),2400pxPNG, vector SVG, custom title block, and permanent re-edits. -
$19Single Plan Full CAD Pack: 5-sheet1/4"=1'-0"vector PDF (A-101,A-102Framing/Dimensions,E-101Electrical,A-201Elevations,M-101Finish Schedule), layered AutoCAD R12.DXFacross 8 AIA layers (A-WALL,A-DOOR,A-GLAZ,A-CABN,A-FURN,E-POWR,A-ROOM,A-DIMS), 3D.OBJ, Framing & Drywall.CSVtakeoff, and 14-day instant refund.
-
Launch the ADU & Basement Floor Plan Studio free right now.
Note: PlanCaliber layouts and IRC calculators are for preliminary design, feasibility planning, and estimating only. Always verify local zoning setbacks, utility easements, and building code requirements on site and with your local Authority Having Jurisdiction (AHJ).
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.