feat(junction): edit complex cutbacks and corners

This commit is contained in:
que01 committed 2026-09-08 14:30:43 +08:00
1 parent d0e1f62f2b
commit 80f122be46
15 files changed
+354 -38

No files matched your search

+12 -6
View File
@@ -316,14 +316,20 @@ then `structureFromTopology(topology, shape, center, features)`. Projection is
`cluster:<id>`. The legacy singular field is null at this unscoped entry point.
- `GET /api/edit-state?junction=<node>` preserves the node selection contract;
`?cluster=<id>` selects a cluster. Preview uses the equivalent `selection`
object. A selected editable cluster publishes only `cluster-carriageway-width`
handles for its external carriageways.
- A `cluster-carriageway-width` anchor contains `clusterId`, stable
object. A selected editable cluster publishes `cluster-carriageway-width`,
`cluster-carriageway-cutback`, and `cluster-corner-radius` handles only for
its external geometry.
- A cluster carriageway anchor contains `clusterId`, stable
`carriagewayKey`, `sourceNodeIds`, and `sourceRoadIds`. Replay matches all
source identity; a missing or changed source is stale with `anchor-missing`.
The solver stores accepted values in `clusterPlans`, and `compileGeometry()`
applies them to the matching complex-junction approach before geometry is
generated. It must not widen unrelated member-node approaches.
The solver stores width and cutback values separately, and `compileGeometry()`
applies them only to the matching complex-junction approach before geometry is
generated.
- A cluster corner anchor contains its stable adjacent-arm `cornerKey` and the
two representative carriageway keys. It is replayed against the same
source-sorted arm grouping used by `resolveComplexJunctionTopology()`. The
complex generator reads a local radius by that `cornerKey`; no other corner is
rewritten.
- Preview and save both evaluate the same candidate through the resolver and
`compileGeometry()`. Save rejects every `severity: error` diagnostic before
writing the edit document.
+7 -7
View File
@@ -281,15 +281,15 @@ reuse the unscoped singular structure when its ref differs. A missing structure
stays unavailable. Use `junctionEditSelection(ref)` for edit-state and preview
requests so a cluster never falls back to the last selected road or node.
## 17. Complex carriageway width editing
## 17. Complex geometry editing
Complex JunctionTools consumes the same v2 `EditSession`, `PreviewRequester`,
`ParameterPanel`, and map handle callbacks as ordinary junctions. The only
editable handle in this stage is `cluster-carriageway-width` with a
`cluster-carriageway` anchor. Before edit mode, a selected cluster loads its
scoped manifest so `canEditJunction()` can use an editable server handle as the
capability signal. Once enabled, those same handles are rendered on the map and
in the panel; `App.tsx` resolves the anchor snapshot from `sourceRoadIds[0]`.
`ParameterPanel`, and map handle callbacks as ordinary junctions. Editable
handles are `cluster-carriageway-width`, `cluster-carriageway-cutback`, and
`cluster-corner-radius`. The first two use a `cluster-carriageway` anchor; a
corner anchor is resolved to its representative carriageway only to create the
snapshot. Before edit mode, a selected cluster loads its scoped manifest so
`canEditJunction()` can use an editable server handle as the capability signal.
Do not add a cluster-local draft, preview, undo, or save flow.
Compiler structure provenance supplies cluster hotspots and external road IDs.