Short focused day. We built the modular building shell process — an automated pipeline that takes a set of room definitions and produces a complete architectural shell.
The pipeline
Given room volumes and their connections, the shell process:
- Generates floor slabs for each room
- Builds walls along room boundaries
- Identifies shared walls between adjacent rooms
- Cuts openings (doors, archways, windows) into shared walls
- Adds ceiling planes
- Resolves cross-references between rooms that share geometry
Each step is a function that transforms the geometry model. Steps can be skipped or replaced — if you want rooms without ceilings (open-air courtyards), skip step 5. If you want transparent walls (for debugging), replace step 2 with a wireframe renderer.
The shared wall problem
This was the interesting engineering challenge. When Room A and Room B are adjacent, they share a wall. If both rooms generate that wall, you get z-fighting — two surfaces occupying the same 3D space. The renderer can’t decide which to draw, so it flickers between them. If neither room generates the wall, you get a hole.
The naive solution is “check if a wall already exists at that position,” but that requires spatial queries and floating-point comparisons that are fragile. Our solution: deterministic ownership. Shared walls are always owned by the room with the lower ID. Room 1 builds the wall between rooms 1 and 2. Room 2’s wall generation skips that face entirely.
This is simple, but it has an important property: the ownership decision is local. Room 2 doesn’t need to check if Room 1 has built the wall. It just checks its own ID against its neighbor’s ID and decides. No coordination, no queries, no race conditions.
Cross-reference resolution
Openings in shared walls need special handling. The door between rooms 1 and 2 is cut into room 1’s wall (since room 1 owns it), but the opening needs to be visible from room 2’s perspective as well. The cross-reference (xref) system tracks which openings affect which rooms and ensures the visual geometry is consistent from both sides.
This is the piece that connects the abstract room definitions from the Factory/Resolver to actual renderable architecture. Room volumes go in, a building comes out. Tomorrow we start generating those room volumes procedurally.