Wall Assembly Optimizer
Ranking 572 wall assemblies by carbon, cost and comfort, and letting you build the winner in 3D.
4 min readOpen the live tool
What I shipped
CU Boulder’s BEST Center scored 572 wall assemblies on six metrics (carbon, energy, cost, R-value, sound, strength) in an Excel workbook. It worked if you knew which cells to touch, and it quietly got a few things wrong. Not the vibe.
I owned the rebuild end to end and shipped it as a production web app: pick a climate zone, weight what matters, get a ranked shortlist in milliseconds, then build the winner as a 3D wall. Try it live .
How it works
The data never changes at runtime, so there’s no database. The workbook is extracted to JSON once, a FastAPI service holds all 572 rows in memory, and the Next.js front end is a static export. Every request is a pure function of its inputs.
Ranking is a weighted sum model: min–max normalize each metric, invert where lower is better, weight, sum. The engine is plain Python with no framework imports, which made the key test possible: match the workbook’s own results to 1e-12.
- 572all rowsheld in memory
- 71zone facetzone 5, no glazing
- ≤ 71thresholdscost ≤ $250, RSI ≥ 3…
- 0–1min–maxinvert ↓ metrics
- Σ wᵢxᵢweighted sumweights rescaled to 1
- #1…nsortby score, then name
rank_assemblies().Matching the workbook while fixing it
A port that silently disagrees with its source is worse than none. I kept the workbook’s behaviour exactly, except in three places where it was wrong, each pinned by a test.
| Workbook | What went wrong | What the API does |
|---|---|---|
| Weights must sum to 1 | Its own presets don't: 0.166667 × 6 = 1.000002 and 0.1667 × 6 = 1.0002, so two sheets score the same input differently. | Accepts any non-negative weights and rescales them. A test asserts engine = workbook ÷ Σw. |
| Ranks with LARGE / MATCH / INDEX | MATCH returns the first row with a score, so on a tie one wall is listed twice and the other vanishes. | Sorts by (−score, name). Every wall appears once, in a stable order. |
| Comparison note “A is N% lower” | Hard-coded on every row, even for higher-is-better metrics and rows where B wins. | A real per-metric winner and a signed percentage difference. |

The 3D playground
Ranking says which wall. The playground shows what it does with windows in it: three.js via react-three-fiber, live carbon, cost and R-value, and export to GLB, STL, CSV or PNG.
The finding that surprised me most: glass on a fifth of the wall cuts its effective R-value by 76% (R-23.5 to R-5.5). A table of per-m² values hides that. In 3D, it’s obvious. Lowkey the biggest unlock of the whole project.
Shipping it
- Cheap and warm. Both apps on one Azure App Service B1 plan, about $13 a month, with no cold starts.
- Fail fast. The API refuses to start on a bad dataset, and a health check feeds a live status light.
- Hardened. HSTS, a CORS allowlist, docs off in production, no leaked stack traces.
Results
Zone 5 under the five built-in profiles: fiber cement on 2x6 wins on carbon and cost; CMU with XPS wins when sound or strength matter.
| Profile | Dominant weights | Top pick in zone 5 | Score |
|---|---|---|---|
| Equal | all at 1/6 | EIFS_CMU_XPS | 0.658 |
| Carbon | carbon 40%, energy 30% | FiberCement_2x6_FGBatt | 0.852 |
| Cost | cost 40%, RSI 20% | FiberCement_2x6_FGBatt | 0.711 |
| Thermal | RSI 40%, STC 20% | Limestone_2x6_SprayFoam | 0.615 |
| Acoustic | STC 50% | EIFS_CMU_XPS | 0.722 |
Exact parity with the workbook, 154 tests across server and client, and a live link anyone can open. Shipped, tested, and honestly kind of a W.
