Skip to content

Walls: repair T-junction cracks; rise to a raised upper floor - #1208

Merged
wass08 merged 2 commits into
mainfrom
wawa/fix-pass-nov3
Nov 3, 2026
Merged

wass08 merged 2 commits into
mainfrom
wawa/fix-pass-nov3

Conversation

@wass08

@wass08 wass08 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Two wall fixes from a fix pass:

  • No more dotted light leaks on baked walls. Opening cuts and finish-band splits left T-junctions (a vertex lying on a neighbour triangle's edge without being shared). They look closed at full precision, but the bake's position quantization opens them into dotted bright cracks along wall seams and around windows. repairWallTJunctions now splits each affected triangle at the vertices on its edges, joining each one to the opposite corner, so no vertex is invented. Material groups are assigned first and carried to the pieces, so no face is reclassified. Band splitting also interpolates seam vertices from a canonical endpoint, so both triangles on an edge get a bit-identical vertex. Walls without T-junctions are returned untouched.
  • No slot under Floor 1 over an unraised building. Floor 1 is one plane, lifted by the tallest foundation under it. A second ground plate without a foundation kept the plain storey height, leaving a gap the size of the other plate's lift. A base plate that carries the storey above (the same upperStoreyFootprints set that lifts it) now tops out at that storey's floor: its walls grow taller and its floor stays on grade, so no foundation is forced on it. A plate with nothing above keeps its own height.

Golden rebaseline (byte goldens in viewer/src/systems/wall): only the 40 fixture walls that had T-junctions changed (3199 → 0). Against the previous build, volume differs by ≤ 5e-8, per-material area by ≤ 7e-7 m², and bounds are identical. The other 18 walls stay byte-identical.

How to test

  1. Bake (or export to GLB and quantize) a house with windows and doors. Open it in a glTF viewer: interior walls show no dotted light seams at band heights or around openings.
  2. Draw two separate ground-floor rooms with Floor 1 over both. Give one a foundation (floor height above ground). The other building's ground-floor walls rise to meet Floor 1 with no gap, and its floor stays on the ground with no foundation band.
  3. A separate ground-floor room with nothing above keeps its normal wall height.

Automated (run locally): bun test src in packages/core (6515 pass), packages/viewer (951 pass), packages/nodes (5185 pass), packages/editor (2829 pass); tsc --build for core and viewer. New tests: wall-t-junctions.test.ts (fails with 117 T-junctions on a windowed wall without the repair) and the shed case in floor-foundation-lift.test.ts (fails with a 0.5 m gap without the fix).

Screenshots / screen recording

Not added yet.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

🤖 Generated with Claude Code


Note

Medium Risk
Changes wall mesh generation and storey covering-plane math used for wall tops; both are regression-tested but affect visible geometry and multi-plate floor stacks.

Overview
Fixes two wall-related issues: baked mesh light leaks and gaps under a raised upper floor over an unraised neighbour.

T-junction repair (viewer) adds repairWallTJunctions, wired through new finishWallFaces after material classification and finish-band splitting. Triangles whose edges carry another vertex are split so neighbours share vertices—avoiding cracks when GLB export quantizes positions. Finish-band clipping now interpolates seam vertices from a canonical edge endpoint so adjacent triangles get identical seam coordinates. Golden hashes and CSG disposal expectations are rebaselined (same volume/bounds within tight tolerances).

Storey wall height (core) updates resolveCoveringSlabContext so base plates listed in upperStoreyFootprints for the level above cap their footprint plane at max(authoredHeight + lift, floorToFloorHeight). Walls on an unraised plate under an extended upper floor grow to the lifted storey floor while the plate stays on grade (no forced foundation). A new test covers extending Floor 1 over a shed after lifting the house footprint.

Reviewed by Cursor Bugbot for commit a69fba5. Bugbot is set up for automated code reviews on this repo. Configure here.

wass08 and others added 2 commits November 3, 2026 15:17
Opening cuts (three-bvh-csg) and finish-band splits left vertices lying on
neighbouring triangles' edges. At full precision the seams look closed, but a
baked GLB quantizes positions and those T-junctions open into dotted light
leaks along wall seams and around openings.

- repairWallTJunctions splits each triangle at the vertices on its edges by
  joining them to the opposite corner (no invented vertices), carrying the
  source triangle's material group so faces are never reclassified; walls
  without T-junctions are returned untouched.
- Band splitting interpolates seam vertices from a canonical endpoint so both
  triangles on an edge get a bit-identical vertex.
- Goldens: the 40 fixture walls that had T-junctions are rebaselined (3199 -> 0);
  volume, bounds and per-material area match within 5e-8 / 7e-7; the other 18
  stay byte-identical.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Floor 1 is one plane, lifted by the tallest foundation under it. A second
ground plate without a foundation kept its walls at the plain storey height,
leaving a slot under Floor 1 the size of the other plate's lift.

A base plate that carries the storey above (upperStoreyFootprints, the same
set that lifts that storey) now tops out at the upper storey's floor, so its
walls and ceiling bound rise to meet it. Its floor stays on grade: no
foundation is forced on it. A plate with nothing above keeps its own height.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@wass08
wass08 merged commit 44aaac5 into main Nov 3, 2026
5 checks passed
@wass08
wass08 deleted the wawa/fix-pass-nov3 branch November 4, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant