# Replication and original generation guide

Read FINDINGS.md before using these rules. **Measured** means observed in the supplied release; **Proposed** means a future modeling choice. None of these distributions is a regulation or minimum-space standard.

## Replicate a source example

1. Start with `example_apartments.json`: six inspected source groups with exact room WKT, source keys, heights/elevations and spatially associated context elements. The matching six-panel image is `apartment_examples.png`. `sample_floor_elements.parquet` keeps full selected floor context for broader inspection.
2. Use metres. Preserve site-local +x east/+y north and the source floor/terrain-relative elevation; keep any display recentering as a reversible translation. Do not overlay different site origins as though they were one georeferenced city.
3. Keep semantic layers: areas, walls/railings/columns, doors/windows and fixtures. Preserve original keys/types. SHAFT and VOID are not habitable rooms; PUBLIC/COMMERCIAL areas are not apartment interiors. Distinguish ROOM from BEDROOM.
4. Import 2D source polygons as exact planar rings, including holes. For a 3D schematic, extrude each separator/fixture from its own elevation for its own height. Source windows can start at differing elevations; do not subtract every opening down to the floor. Assign areas as semantic floor zones rather than adding duplicate full-height room solids over walls.
5. Create opening voids in the relevant wall geometry and validate Boolean outputs. Walls and openings can intersect deliberately in source plan layers: the source records do not promise finished nonoverlapping 3D solids. Default heights do not establish fabrication accuracy.
6. Validate ring orientation, areas, units, dimensional bounds, intersections, openings, missing pieces and counts. For solids, check naked edges/closure and the saved/exported result in the target CAD application. Use a new file/layer and preserve existing user work. No Rhino document was modified by this study.

`example_apartments.local.geojson` is a local-engineering-coordinate feature collection of room polygons. It is NOT WGS84 longitude/latitude; do not load it as geographic GeoJSON without explicitly handling the local coordinates. The richer JSON/WKT export is the preferred CAD input.

## Generate an original apartment: proposed minimum pipeline

1. **Choose a family and brief.** For the first prototype, use one floor, 2.5/3.5/4.5 source-room families and a chosen total net area inside that family's measured band. The budget, number of occupants and exterior shell are user inputs. Do not sample an apartment silhouette by unioning every room MRR; these are enclosing boxes, not footprints.
2. **Choose a coherent room program.** Sample a whole eligible reference program conditional on source room count, then perturb dimensions. Preserve type relationships; 3.5 source rooms usually means living/dining + two generic/private rooms, with kitchen/bath/hall in addition. Resolve intended bedroom use explicitly. Separate kitchen polygons can be openly connected to living/dining.
3. **Allocate a joint area budget.** Use `generation_reference.json`, `conditional_room_budgets.json` and `cohort.csv` (selected columns; full version is regenerated by the analysis). Conditional bands and actual program rows are available. Reserve circulation before fitting bedrooms. A 3.5-room reference is around 82 m² net, with a median 12% hall share. Individual quantile medians do not sum to a coherent apartment: normalize the budget jointly and preserve observed correlations where possible.
4. **Construct a circulation graph before packing polygons.** A hall-centered family is supported by sample edges. Provide an explicit entrance node, accessible routes to rooms, sensible privacy and connections among kitchen/living/outdoor zones. Do not force every apartment into a corridor family; open layouts are present. Sample edge counts alone are not a trained graph grammar.
5. **Pack and shape rooms in local orientation.** Start private rooms/baths close to rectangles, then allow recesses for walls and fixtures. Allow more complex living/dining and hall outlines. Match areas, aspect and fill together. For an ideal rectangle only, `short = sqrt(area/aspect)` and `long = sqrt(area*aspect)`; this formula does not preserve area for a low-fill nonrectangular room. Check clear widths along routes, not just MRR or source biggest-rectangle width.
6. **Place wet rooms, structure and services.** Nearness of kitchen/bathroom is a measured distribution, not a mandatory adjacency or plumbing-stack proof. Add explicit wall/shaft/fixture geometry and test fixtures/clearances. Do not infer structural walls from thickness alone. Keep interior and external wall assignments explicit rather than guessing them from source WALL labels.
7. **Place facade openings and exterior spaces.** Source bedrooms/generic rooms usually have windows. Provide facade access and test daylight for intended occupied uses; source windowlessness is not a design permission. The measured 0.84/0.95 m door polygon spans are starting references, not accessible clear widths. Choose door type, swing and clear opening deliberately. Sample balconies/loggias with conditional size rather than attaching the same balcony to every room. Keep source-net and semantic-exterior accounting separate.
8. **Orient and evaluate in actual context.** Retain north; consider sun, noise and privacy using the intended site. Source climate/ratings can condition scenarios, but source solar/view/noise numbers cannot be copied onto a new layout as its performance. Rerun appropriate simulations or label proxies clearly. Do not optimize a single location-rating field as a floor-plan score.
9. **Reject failures before aesthetic variation.** Require valid nonoverlapping room polygons, an explicit shell and wall budget, all required rooms, a connected entrance-rooted passage graph, real unobstructed portals, correct opening elevations and fixture/route clearances. Check physical construction/egress/accessibility requirements against applicable authoritative rules separately when a real project requires them.
10. **Validate generalization and originality.** Hold out whole sites. Compare room/program/shape distributions and use actual circulation/clearance tests on generated cases. Check nearest source layouts to identify direct copies; dimension perturbation alone does not establish originality. Have Theo review a small set of generated plans before broadening the generator.

## Priority of evidence

- Strongest: complete element inventory, exact joins, measured areas and source room-count weights.
- Useful descriptive priors: conditional size/program budgets, aspect/fill distributions, source opening spans and semantic exterior prevalence.
- Provisional: inferred passage graph, wet-core proposals, fixture-clearance choices and architectural quality judgments.
- Not established: code compliance, national representativeness, verified accessibility, structural feasibility, construction accuracy, generator quality or legal novelty/originality.

The next useful modeling checkpoint is a small parameterized prototype with several original single-floor plans and explicit validity/circulation checks, followed by Theo's layout review. It has not been built as part of this research.
