# Blooming Façade — complete solver

By Stepan Kukharskiy. A differential-growth form-finding study on thirty full-height parking-façade fins.

## Run the included app

Unzip the package. In its top folder run:

```sh
python3 -m http.server 8080
```

Open http://localhost:8080 in a current browser. No installation or account is required for the app. Do not open index.html directly as a file: module workers require HTTP. Everything needed for simulation and rendering is included locally.

Choose growth, edge concentration, field variation and seed, then press **Grow façade**. Parameter edits reset the mesh. Pause/resume, inspect five adjacent fins, show the growth map, or export all thirty fins as OBJ. The PNG button captures the viewport.

The blue rear edges remain fixed. +300% is additional target length at the peak of the growth field (four times the starting target length); constraints can prevent the mesh from realizing all of that growth. It is not a measure of total building expansion.

Fast study: 6 × 36 cells per fin, 360 iterations. Detailed: 12 × 72 cells per fin, 1,000 iterations. Different resolutions can produce different folds. Detailed mode may take several minutes. The solver runs in a worker, leaving the view responsive. Switching away from the page pauses growth.

## Source layout

- `source/solver.cpp`: complete browser solver, with metric growth, stretch/bending relaxation, fixed attachments, contact projection, conservative motion checks and backtracking.
- `source/reference-solver.cpp`: original standalone detailed solver used for the façade study. Run its compiled executable in an empty output directory; it writes geometry and trajectory files.
- `solver.mjs`, `solver.wasm`: compiled browser solver, included so rebuilding is optional.
- `solver-worker.mjs`: pause/reset/step orchestration.
- `app.mjs`, `index.html`, `style.css`: interactive app and exports.
- `vendor/`: Three.js, OrbitControls and their license.
- `source/verify.mjs`: finite coordinates, fixed edges, zero-growth and changed-seed checks; writes a final float32 snapshot.
- `source/verify-geometry.cpp`: strict triangle-crossing, gap, pin and triangle-area checks on that snapshot.

## Rebuild the browser solver

Install and activate Emscripten (https://emscripten.org/docs/getting_started/downloads.html). Version 6.0.12 was used for this package. In the app folder:

```sh
bash source/build.sh
```

No other dependencies are needed for compilation. Edit `facadeField`, `Model::relax`, boundary conditions or contact settings in `source/solver.cpp`, then rebuild. UI limits and exposed controls are in `app.mjs` and `index.html`.

## Verify a complete default fast solve

Node.js 20+ and a C++17 compiler are needed for these optional checks:

```sh
node source/verify.mjs
c++ -std=c++17 -O3 source/verify-geometry.cpp -o verify-geometry
./verify-geometry verification-final.bin 0
```

The checker reads an unheadered float32 XYZ snapshot, in solver vertex order. Pass 1 for detailed topology. It checks fixed edges against the standard attachment positions, which are seed-independent. Exported OBJ files are intended for modelling software and are not this binary format.

`verification.json` and `geometry-check.json` record checks on the default fast configuration, not every possible parameter combination. Setting REFERENCE_BIN to the original facade.bin additionally compares the first detailed step against the original simulation.

## Scope

This is a surface form-finding experiment, not a structural or fabrication solver. Contact handling can slow or halt growth; it is not a universal guarantee for arbitrary code changes or parameters. Geometry has no panel thickness. New settings and altered geometry should be checked separately.

The city image is an AI-generated architectural interpretation. It is not a solver output. The preview image shows the original detailed model.
