Skip to content

Commit f6bb8c1

Browse files
committed
void update boundary provenance
1 parent 2efda6c commit f6bb8c1

4 files changed

Lines changed: 598 additions & 7 deletions

File tree

docs/void/plan-face-provenance.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@
44

55
Track which portions of resulting solids come from which sketch extrude regions, including after union/subtract, while keeping storage compact and spline-ready.
66

7+
## Execution Status (2026-03-02)
8+
9+
Completed:
10+
11+
1. Plan authored and staged into phased implementation.
12+
2. Debug visualization toggles added to preferences and wired to solids runtime:
13+
3. Boundary loop rendering from GeometryStore.
14+
4. Segment rendering from GeometryStore.
15+
5. Segment/surface/region ID labels (overlay text).
16+
6. Fixed world/local debug overlay transform bug:
17+
7. GeometryStore points are world-space; line geometry parented under solids root must convert world -> root local because `space.WORLD` is rotated -90deg on X.
18+
19+
In progress:
20+
21+
1. Converting this plan into code-level milestone execution with strict acceptance checks.
22+
23+
Next up:
24+
25+
1. Add first `surface_patch_id` selection plumbing (read-only pass-through).
26+
2. Thread Manifold relation metadata through kernel adapters.
27+
3. Start mixed-face partition scaffold from seeded `surface_patches`.
28+
729
## Decisions
830

931
1. Primary provenance is `boundary/region/surface-patch`, not raw triangle ownership.
@@ -120,6 +142,7 @@ This enables deterministic attribution from boolean output back to input generat
120142

121143
1. Add `surface_patches` schema and runtime index container.
122144
2. Introduce generic segment schema (`kind + geom`) with current line/arc emitters.
145+
3. Add compatibility normalizer for older docs (missing `surface_patches`).
123146

124147
### Phase 2: Kernel Metadata Plumbing
125148

@@ -163,6 +186,39 @@ Regression guardrails:
163186
1. No persisted triangle tables in doc snapshots.
164187
2. No schema changes required to add spline segment kind later.
165188
3. Selection never reports mixed-source face entities.
189+
4. Any debug/runtime geometry under solids root must explicitly convert GeometryStore world coordinates to root-local coordinates.
190+
191+
## Implementation Checklist
192+
193+
Phase 1:
194+
195+
1. Done: update `src/void/api/geometry_store.js` schema to include `surface_patches` and runtime topology patch map container.
196+
2. Done: extend `buildGeometryStoreSnapshot()` in `src/void/api/solids.js` to emit seeded `surface_patches` per face-loop with source-region candidate fields.
197+
3. In progress: keep current face-key canonical mapping intact while adding optional patch ID fields.
198+
199+
Phase 2:
200+
201+
1. Update `src/void/solid/kernel.js` mesh conversion to preserve manifold relation fields:
202+
2. Input pass-through where provided (`runOriginalID`, `runIndex`, `faceID`, etc.).
203+
3. Output pass-through into rebuild intermediate structures.
204+
4. Add worker payload support for relation arrays when present.
205+
206+
Phase 3:
207+
208+
1. Implement mixed-source detection in `src/void/solid/rebuild.js`.
209+
2. Add per-surface local partition pass and emit patch boundaries.
210+
3. Assign one canonical `source_region_id` per patch.
211+
212+
Phase 4:
213+
214+
1. Extend selection resolver and solids hit mapping to prefer patch IDs over raw face IDs.
215+
2. Add properties/tree hover mapping from extrude profile -> patch IDs.
216+
3. Remove coarse fallback once parity checks pass.
217+
218+
Phase 5:
219+
220+
1. Add deterministic integration tests for union/subtract split-face provenance.
221+
2. Remove temporary migration branches and finalize docs.
166222

167223
## Acceptance Criteria
168224

src/void/api/geometry_store.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ function createGeometryStoreApi(getApi) {
1313
segments: [],
1414
points: [],
1515
regions: [],
16+
surface_patches: [],
1617
topology: {
1718
surface_to_segments: {},
18-
segment_to_surfaces: {}
19+
segment_to_surfaces: {},
20+
patch_to_tris: {},
21+
tri_to_patch: {}
1922
},
2023
meta: {
2124
feature_count: 0,
@@ -35,9 +38,16 @@ function createGeometryStoreApi(getApi) {
3538
out.segments = Array.isArray(out.segments) ? out.segments : [];
3639
out.points = Array.isArray(out.points) ? out.points : [];
3740
out.regions = Array.isArray(out.regions) ? out.regions : [];
41+
out.surface_patches = Array.isArray(out.surface_patches) ? out.surface_patches : [];
3842
out.topology = out.topology && typeof out.topology === 'object'
3943
? out.topology
4044
: base.topology;
45+
out.topology.patch_to_tris = out.topology.patch_to_tris && typeof out.topology.patch_to_tris === 'object'
46+
? out.topology.patch_to_tris
47+
: {};
48+
out.topology.tri_to_patch = out.topology.tri_to_patch && typeof out.topology.tri_to_patch === 'object'
49+
? out.topology.tri_to_patch
50+
: {};
4151
out.meta = out.meta && typeof out.meta === 'object'
4252
? out.meta
4353
: base.meta;
@@ -84,6 +94,7 @@ function createGeometryStoreApi(getApi) {
8494
state.segments = Array.isArray(snapshot.segments) ? snapshot.segments : [];
8595
state.points = Array.isArray(snapshot.points) ? snapshot.points : [];
8696
state.regions = Array.isArray(snapshot.regions) ? snapshot.regions : [];
97+
state.surface_patches = Array.isArray(snapshot.surface_patches) ? snapshot.surface_patches : [];
8798
state.topology = snapshot.topology && typeof snapshot.topology === 'object'
8899
? snapshot.topology
89100
: state.topology;

0 commit comments

Comments
 (0)