Add experimental routed CSG surfaces

This commit is contained in:
Meta Vens 2026-05-07 08:31:23 +01:00
commit 053b244295
7 changed files with 431 additions and 34 deletions

View file

@ -19,9 +19,17 @@ The script builds `vg_csg` in release mode and writes JSONL to
- emitted triangle, fragment, and warning counts
- demand-frontier `candidate_pairs` and `rejected_pairs`
The `vg_csg` fixture measures the stable-tree path after warmup. `Assembler`
caches evaluated output by generation, so repeated `build()` calls on an
unchanged graph return the cached mesh. Dirty generations still rebuild.
The `vg_csg` fixture measures:
- `stable`: cached output after warmup
- `dirty`: full rebuild through the current ordered assembler
- `routed`: experimental surface-router rebuild, falling back to the ordered
assembler outside its current single-source, single-candidate subtractive
convex contract. The fixture only emits routed records for supported cases.
`Assembler` caches evaluated output by generation, so repeated `build()` calls
on an unchanged graph return the cached mesh. Dirty and routed generations
still rebuild.
## Scenarios
@ -91,6 +99,17 @@ new kernel path; they expose the ordered brush stream as affected source/operato
pairs and rejected bounds pairs so future router/index work can prove it is
refusing real work rather than merely rearranging it.
The first routed surface experiment is intentionally narrow. It cleans a single
subtractive convex cut into boundary polygons instead of closed fragment boxes,
but dense repeated cutters currently create surface-piece explosion. Keep dense
rotated subtraction on the ordered kernel until the category router has compact
frontier batching and scratch storage.
Current routed lesson: for `single_center_cut`, routed output emits 48 boundary
triangles instead of the fragment carver's 72 closed-fragment triangles. That is
cleaner surface output, not yet faster output. The implementation still moves
owned polygon vectors around, so it is a topology proof before it is a hot path.
## Latest Local Baseline
Captured on 2026-05-07 with `.\tools\run_csg_perf.ps1 -UseRealtimeCsgCpp`: