Real zoning codes (New York's 1916 Zoning Resolution is the classic case) do not dictate a building's exact shape — they define a maximum buildable envelope from a few numeric limits, and the architect fills it however they like. This simulator builds that envelope floor by floor:
Base: full lot coverage up to the street-wall height H0
Setback: above H0, each side steps in by
inset(h) = (h − H0) / setbackSlope
until the footprint shrinks to the tower plate
Tower: footprint clamped to towerCoverage% × lot area,
continues straight up from there
Stop when: cumulative floor area ≥ FAR × lot area,
or stories built = height limit
Each 12 ft story is added only if the running total of floor area is still under the FAR cap (Floor Area Ratio × lot area) — the single number that limits total bulk regardless of shape. If a floor would push the total over the cap, its footprint is scaled down to exactly use the remaining allowance, so the top floor is often a sliver rather than a full plate.
- Height limit — the absolute cap on how many stories may be built, independent of FAR.
- FAR cap — total gross floor area allowed, as a multiple of lot area; this is usually the binding constraint on dense sites.
- Setback slope — how many feet the wall must step back for every foot gained in height above the street wall; a shallow slope (large number) lets the base stay wide much longer, a steep slope narrows it fast into a tower.
- Tower coverage — the minimum footprint (as % of lot area) the envelope is allowed to shrink to before it stops narrowing and rises as a slender tower — this is what lets a building reach the height limit on a FAR that a pure pyramid could never sustain.
Population capacity is a standard planning heuristic: 80% of gross floor area is assumed net-residential, at roughly 800 ft² of net floor area per resident (typical for mixed unit sizes) — capacity ≈ 0.8 × floorArea / 800.