Metadata-Version: 2.5
Name: cadbuildr-architecture
Version: 0.1.0
Summary: Buildings as code: grids and levels, layered walls with IRC stud framing, doors and windows, stairs, slabs and footings, columns and beams, roofs, guards, rooms and floor plans, with building-code checks
Author: CADbuildr Team
License: MIT
License-File: LICENSE
Requires-Python: <4.0.0,>=3.10.0
Requires-Dist: cadbuildr-foundation<0.4.0,>=0.3.0
Requires-Dist: numpy<3.0.0,>=2.2.6
Description-Content-Type: text/markdown

# cadbuildr-architecture

## Summary

Buildings as code for CADbuildr: grids, layered walls with IRC stud framing, doors, windows, stairs, slabs, columns, beams, roofs, guards, rooms and a demo house, built from cited tables, placed by connect and code-checked.

## Tags

cad, python, library, architecture, building, bim, framing, irc, stairs, roof, walls

## Status

yellow

## Guidelines

- Dimensions come from `standards.py` (cited) or inputs; typical values are marked `Estimated`.
- Place every element with `ground` / `connect`; members connect to the member they bear on.
- Code compliance is a `__checks__` issue; inputs that cannot be built raise named errors.
- Parts record volume and box from the profiles they build, so tests need no kernel.
- Keep the package self-contained (foundation + numpy) so it can move to its own repo.

## Dependencies

### Upstream

- cadbuildr-foundation

### Downstream

- (none)

## Overview

Buildings as code, as a CADbuildr library (`pip install cadbuildr-architecture`,
`import cadbuildr.architecture`, library id `architecture`). Every element is
real construction geometry built from cited dimensions, placed with
`ground` / `connect`, and checked against a building code in `__checks__`.

- **Grids and levels** (`grid.py`): `Grid` (lettered axes along X, numbered
  along Y), `Levels`, and `GridDatum`, the grid as anchors (`GridNode` on every
  intersection and level).
- **Layered walls** (`walls.py`): `Wall` is its layers outside to inside, at
  their real thicknesses (`Exterior 2x4/2x6`, `Interior 2x4`, `Masonry cavity
  (EN)`, `CMU 8in`, or your own `WallLayer` list). Openings are cut through every
  layer. The units are hosted by `connect`, and walls join at L corners and
  T junctions through `WallEnd` / `WallFace` (the joins close loops, so a wrong
  length fails).
- **Stud framing** (`framing.py`): `StudFrame` per IRC R602. Studs at 16" / 24"
  (406 / 610 mm) or 400 / 600 mm on centre, a single bottom plate and a double
  top plate, king and jack studs, and built-up headers sized from IRC Table
  R602.7 with a plywood or foam spacer. Windows get sills and cripples, and the
  bottom plate is cut at doors. Dressed lumber per PS 20-20 / CSA O141 (2x4 =
  38 x 89 mm), with eased edges.
- **Doors and windows** (`openings.py`): `Door` comes in US pre-hung sizes
  (2'0"..3'0" x 6'8") and DIN 18101 sizes (885 x 2010 with a rebated leaf). It
  has jambs with stops, a threshold, and a hollow-core or solid leaf with a lock
  bore, handing LH / RH / LHR / RHR, and a revolute swing. `Window` has US
  "3050" sizes or metric sizes on the 125 mm grid (EN 14351-1). Its operations
  are fixed, casement / tilt-turn, awning, hopper, single-hung and sliding.
  Each window has a timber frame and sash, a 4-16-4 IGU (EN 1279) and an IRC
  R310 net clear opening.
- **Stairs** (`stairs.py`): `stair_layout` sizes a stair by the 2R + G rule.
  `StairFlight` has cut 2x12 stringers, nosed treads, risers and a handrail.
  `Stair` builds straight, L or U stairs with landings and posts. Checks:
  IRC R311.7 (riser <= 196, tread >= 254, headroom >= 2032, width >= 914,
  nosing, flight rise, landing, handrail), or `code="DIN 18065"` /
  `"UK ADK"`.
- **Slabs, footings, columns, beams** (`structure.py`): `Slab` is a
  slab-on-grade with a thickened edge (IRC R506 / R403.1). There are
  `StripFooting` / `PadFooting` footings. `Column` and `Beam` take W / HE / IPE
  sections with root fillets, hollow SHS / HSS, timber, or built-up lumber
  (AISC v16.0, EN 10365). `PostAndBeamBay` puts all of them on a grid.
- **Floor decks** (`floors.py`): `FloorDeck` has joists, rims and an OSB
  subfloor, with bearings, floor seats and floor edges.
- **Roofs** (`roofs.py`): `Roof` frames a gable, hip or shed roof by pitch.
  Rafters are placed at spacing, with birdsmouth seats, tails and ridge plumb
  cuts. A ridge board at least as deep as the plumb cut (R802.3), hips and
  jacks, a fascia, sheathing, barge rafters and the gable-end infill complete
  it. Checks: R905 minimum pitch, ridge depth, bearing, and birdsmouth depth.
- **Guards** (`guards.py`): `Guard` has posts, rails, a cap and balusters.
  Checks: IRC R312 (914 mm height, the 102 mm sphere) or UK ADK.
- **Rooms and plans** (`rooms.py`): `Room` and `FloorPlan` report areas and
  volumes (sloped ceilings included). Checks: R304 area and dimension, R305
  ceiling height, and an R310 egress opening in sleeping rooms.
- **Demo house** (`building.py`): `DemoHouse` is a slab, six walls, a door,
  four windows, a loft deck, a stair to the loft, loft guards and a 12:12
  gable roof. It has four rooms and a schedule in `report()`.

Lengths are millimetres or strings with units: `"6'8\""`, `"92-5/8\""`,
`"2.4 m"`, `"80 in"` (`units.length`).

```python
from cadbuildr.foundation import show
from cadbuildr.architecture import DemoHouse, Wall, Stair

house = DemoHouse()
print(house.report()["total_area_m2"])
assert [i for i in house.check() if i["severity"] == "error"] == []
show(house)

wall = Wall(length="12'", wall_type="Exterior 2x4", openings="window:4':3050@2'")
stair = Stair(total_rise=3000, kind="L", turn="left")
```

```bash
python -m cadbuildr.foundation.library manifest cadbuildr.architecture
echo '{"item": "architecture:Stair", "inputs": {"total_rise": 3000, "kind": "U"}}' | python -m cadbuildr.foundation.library eval
```

Agent recipes: [`SKILL.md`](SKILL.md) (mirror:
`threepointo/skills/libraries/cadbuildr_architecture.md`). Content plan:
`docs/specs/plan_library-content_00003/packages/architecture.md`.
