Repository navigation
Description
Status: proposed
Part of #3105 (GP12, the crossing block of #3096). One pull request into ground-plan.
The steps of the block, in build order: GP12.1 #3342, GP12.2a #3343, GP12.2b #3352, GP12.3a #3344, GP12.3b #3353, GP12.4 #3345, GP12.5 #3346, GP12.6 #3347, GP12.7 #3348, GP12.8 #3349.
Read first: #3105 (words, invariants including the thickness rule, the costs). Design on timosPC:
/media/timo/OSM1/tmp/ground-plan/crossings/CASES.md (case 1, 7.1, 7.2, 7.4, 7.6), drawings/c1-overpass.svg,
c4-side-by-side.svg. Short names: gp/ = host/obc-ground-plan/src/, tv/ = builder/web/src/lib/trailview/.
Code places verified on ground-plan ea4da43.
Goal
The crate builds every bridge as one deck: the records of each storey, its faces from one overlay, its mesh, and the
parts of its shell (edge faces, underside, parapets or railings, piers), each with a real thickness. This step changes
no pixel: the viewer draws the decks in GP12.3b. It proves the formats, the closure and the costs first.
Depends on / blocks
- Depends on: GP12.1 (states, end lines A, sheets and storeys), GP12.2b (the deck lines in the near records, the
ordinary end). - Blocks: GP12.3b (the viewer draws what this step builds), GP12.4 (bores use the storey records, mesh and shell).
Design
1. Records of the storeys
- Today
records::near(gp/faces/records/mod.rs:183-190,buildandnear) builds one near block per cell for
level 0 and its far block;cell.rs:94keeps one block per cell; the viewer's corners read one block per cell
(params.blockintv/plan/corners.wgsl,height_ofat:64-80). - New: one near block per cell holds every storey. The lines table holds each line once with its storey (the
field of GP12.2b). The labels of storey k follow storey 0's labels in the one label table, so a mesh corner's 25-bit
label names a label of any storey and no corner needs a block index. The bins list the items of every storey; a
reader of a storey-k label reads only the lines of storey k, and a reader of storey 0 reads other storeys only as
ceilings (GP12.2b). The far block is built for storey 0 only, as today (GP12.6 adds the storey lines to it). - Where A lies inside one way, the stub (storey 0) and the deck (storey k) are two legs of that way and carry its
samples about A, so both read one surface on A. Where A is a joint of two ways, the bake gives the shared vertex one
height; a step slot on A closes what their banks differ. - Estimate: under 2 kB per 20 m road deck (its candidates, labels and bin items). Report the near block's bytes.
2. Deck sheets (O2)
- Today
faces::build(graph, input, rules, cell, level, slopes)(gp/faces/mod.rs:814) builds the faces of one
level;slopes = falseleaves out the slope layer;in_level(:197-206) selects the ways of level k as
w.deck == Some(k - 1). Nothing calls it with a level other than 0. - New:
in_levelfor k ≥ 1 selects the DECK pieces of storey k (GP12.1). Storey 0's selection does not change here
(GP12.3b changes it). Each storey's faces come from the same strokes, round joins, ranks and integer overlay as
storey 0. - A deck stroke is the paved half-width plus
edge_band_m(0.5) on each side. The band is a new surfaceDeckEdge
of the lowest rank of the sheet. Where two ways of one sheet overlap, the rank decides the surface; the band between
them is a flat strip, not a wall. No closing and no merge step: the union is what the overlay gives (CASES 7.1). - Inside a sheet, where two overlapping ways differ in height (below the least room of the pair, GP12.1), the existing
unrelated-owners step stands between them: a riser.
3. The mesh of a storey
- Today
mesh_cell(gp/mesh/mod.rs:422) triangulates storey 0's sharp faces, one ring of ground and the strip. - New: one more constrained triangulation per deck storey, over the sheet's faces only: no ground ring, no strip, no
grid points, no sunk points. The corners take the sheet's labels. The corners on A and on cell lines are locked and
split by the rule that reads only the edge, so two storeys and two cells meet vertex for vertex. The storey
triangles go into runs of their own after storey 0's. - The WASM bridge does not hand the storey runs and the shell to the viewer yet (an option of the bridge, off until
GP12.3b): no byte that the viewer reads changes. The crate's tests and the debug tool use them.
4. The shell (O3), with a real thickness
A shell corner is a point with a label and a height offset. It may carry a second label with its own offset, and
then its height is the lower of the two (a bore's roof under the ground, GP12.4). The corner word has no free bit (2
words: x, y, a 25-bit label, the terrain flag; gp/mesh/mod.rs module comment), so a shell corner takes one or two
more words (estimate: about 0.5 kB per 20 m road deck). The shell is built from each sheet's free outline: an outline
edge that is not an end line, not a cell line and not under another sheet within the height of the part.
| Part | Construction | Thickness |
|---|---|---|
| Edge face | along the free outline, from the deck top down by the deck depth | the edge band, 0.5 m wide |
| Underside | the sheet's triangles again at top less the depth, turned over; a riser where two depths meet | the tile's deck depth; on ladder step 2 down to deck_least_m (0.4 m; a path 0.2 m) |
| Free end | a closed face on the outline where a deck ends with no ground way, or at a cut | the deck depth |
| Parapet (road and rail classes) | on the band of the free outline: a closed box with top, inner, outer and end faces | 0.35 m wide, 1.0 m over the deck (today's PARAPET_M, tv/roads/decks.ts:9; tv/structures/bridges.ts:12) |
Railing (path and track classes, and every deck narrower than railing_width_m 3.5) |
posts every 2 m of stroke metres and a top rail, each a closed box | 0.08 m square, 1.05 m high; a cable 0.04 m (bridges.ts:16) |
| Pier | from the underside to 3 m under the ground, at each baked bridge-pier point |
a closed box, 1.6 m along a road deck, 0.5 m along a path deck, 0.6 of the deck's width (bridges.ts:20) |
- A pier's foot corners take the storey-0 label of the ground at the pier point. A pier whose foot lies inside the
paved outline of a way of any storey under it is left out (B09). - No shell part is a single sheet with a free edge.
- Values in
plan.jsonstructures:railing_width_m3.5, the post spacing 2.0, the pier depth 3.0.
Invariants
- One sheet per storey and set of joined strokes: no two faces of one storey overlap in plan. Check: the planar
partition check (the epic's check 1) per storey over the fixture. - Parapets and railings stand only on the free outline: none crosses a paved face of its storey. Check: crate test.
- Every shell part has its stated thickness and closes on every visible side: every shell edge has two triangles,
except the deck's top edge. Check: a closure test over the fixture. - Two storeys meet only on an end line and share its row of points; two cells give a deck the same vertices. Check:
the border check (the epic's check 2) per storey, and the corners on every A equal on both sides. - On every A that lies inside one way, the stub and the deck differ by less than 1 mm along A (Rust heights); on a
joint the difference is reported per A. Check: crate test. - No pier stands in a way of any storey under it. Check: a count over the fixture, target 0.
- No pixel changes: the bytes that the viewer reads (near block of storey 0's labels, mesh runs that it draws) are
those of the base where no deck exists, and the viewer's views give the same bytes.
Decisions already made by the owner that apply
- "Side-by-side bridges as one deck, small bridges and footbridges, viaducts and the far forms: do as proposed."
- "Overlapping bridges are a super frequent issue": one deck plan for ways that are adjacent or overlap.
- Structure parts are never paper-thin sheets: every part has a real thickness and closed faces.
Not in scope
Drawing anything (GP12.3b). Bores (GP12.4). The far forms (GP12.6). Covered bridges (GP12.7). Rails on a deck
(#3106).
Proofs and pictures required before review
- The debug tool's top-down layers
faces,levels,meshstorey by storey, and a glTF of the shell, at the fixture's
bridges (bridge-top,under-bridge-top,stream-under-bridge-top,footbridge-top46.816817, 8.396239,
cliff-walk-top46.770383, 8.426158,free-decks-top46.824139, 8.423782). The implementer opens each one. - The crate's counts: sheets, storeys, shell parts, piers left out.
Cost to measure
Base: ground-plan at the branch point, and today's bridges.ts meshes of the same bridges.
- Triangles and vertices per bridge (sheet plus shell) against today's mesh, on the GP12 design sample (12 zoom-13
tiles of Lucerne and Engelberg, 192 level-15 nodes,gp12-design/measure/gp12-share.ts). CASES 7.6 estimates about
250 triangles and 3 kB for a 20 m road deck, 180 for a 20 m footbridge, 150 per 10 m of viaduct. - Cell build time native, p50 and p95, over the cells with a deck and over all cells; the storey stages apart.
- Near block and mesh bytes per cell (sum, p50, p95, max). WASM bytes, gzip and raw (the block's 15 to 25 kB).
Risks and the stop rule
- Stop and report if the storey records need a second height function, or if a storey-k reader cannot skip the
other storeys without a new bin format. - Stop and report if one deck plan needs a merge or repair pass, or a case distinction by class pair or place.
- Stop and report if the triangles per bridge or the build time reach twice their base, or the block's WASM passes
25 kB. - After two failed review rounds, stop and report.
Requirements: the verification console could not be checked from this PC (no agent token here). The orchestrator sets
the pull request's Requirements: line.
Deviations in the build (PR #3464)
Code places verified again on ground-plan ff484a4.
- A storey's lines are line entries of their own after the ceiling lines (flag
STOREY, the storey in the leg bits), not the ceiling lines: the ceiling line's words hold the bound's drop, flat ends and stroke half-width where a way line holds its return grade, cut, fill and half-width, and the viewer reads them. - The bins list no candidate item of a storey over the ground: no reader decides a storey-k label by point. The candidates, labels, extras, junction records, blend edges, height segments, discs and centre-line segments of each storey are in the block, after storey 0's.
graph::levelsis not linked on the device in this step: the bridge's featurestoreysis off. With it the device takes +62 kB gzip (levels included); off, +6.4 kB.- The drawn end line is square to the chord of the segment that holds A, through A's foot on that chord (not to the curve's tangent), so a stub leg can end on the same line by the same rule. An end of a deck is open only where storey 0 goes on past it: an A line inside a way is open (the way goes on as its stub); at a way's own end, with an A line (
graph::levelsgives the dead end of a lone deck one) or without, the deck is open only where a ground way and no other deck way meets it. - Storey 0's selection does not change, so invariants 4 (storeys meet on A) and 5 (stub and deck on A) have no test in this step; invariant 5 holds by construction (the deck's line is the whole way).
- Parapets and railings stand on the band only: a run ends where its inner side would stand in a paved face. A post across a cell line is left out.
- Railing posts are triangular prisms with a 0.08 m side (8 triangles, closed), not 0.08 m square boxes (12 triangles): with square posts every 2 m a railing doubled the triangles of today's bridge mesh at one place.
- The crate builds the storeys only with its feature
storeys(on by default for its tests and the debug tool); the bridge depends on it with the default features off and forwards its own feature. So the device links none of the storeys' code. - Shell corners have one label (3 words: x, y with the label, offset); the second label is GP12.4's.
- No "under another sheet" rule for the free outline (no deck over a deck in the fixture). A deck's outline rounds carry no band layers.
- The underside's thin depth on ladder step 2 is
room − least + deck_least_m, at leastdeck_least_m; the ceiling of GP12.2b keeps the tile's depth.
Activity
[-]TrailView ground plan GP12.3: deck sheets: one deck plan per storey, the shell with a real thickness, parapets, railings, piers[/-][+]TrailView ground plan GP12.3a: deck sheets in the crate: storey records, one deck plan per storey, the shell with a real thickness (no pixel change)[/+]timohueser commentedon Nov 11, 2026
From GP12.1 (PR #3367): what this step can read, and what differs from the plan
graph.levels.runscovers every tagged way (non-synthetic deck way, non-water tunnel way) once, in order; untagged ways that end on step 3 also have runs (HIDDEN under the body, OPEN elsewhere).in_levelis unchanged.graph.levels.end_lines(A, Portal, Closed); merged lines list each member way with its station on the merged line, and the members' runs are moved to that station.edge_band_min GP12.1's sheets (the block has no wall value): GP12.4 should add one tostructures.deck(upper)of an untagged upper way is itsdeck_least_m.A1east,p04). The rule "the floor is at or under the terrain" may need a tolerance before doors are drawn (GP12.4, GP12.5).Generated by Claude Code
timohueser commentedon Nov 11, 2026
From GP12.1 (PR #3367) after its review: what this step takes over
graph::builddoes not callgraph::levelsyet: the device does not link the state rule, the ladder and the end lines in GP12.1 (the review's option ii, decided by the orchestrator). Tests, the census and the debug tool calllevelsandcheck_levels(G7 to G9).levelsfrom the cell build and pays its bytes and time. Target: at most 12 kB of WASM gzip for the whole state rule, ladder and end lines, measured in that pull request. If it is more, the rule moves to the bake together with GP12.8 part B.#[inline(never)]at the stage seams (states,runs,deck_ends/place_a,grid,Ctx::at).claude/gp12-1-later(68b3ddd,graph/levels.rssheetsandmerge). GP12.3a builds its sheets from its own overlay; take that code only where its pictures need it.Generated by Claude Code
timohueser commentedon Nov 13, 2026
GP12.3a is in
ground-planthrough #3464 (head 244e28a): the storey records, one deck plan per storey, the storey mesh and the shell with a real thickness, behind the crate featurestoreys(off on the device). No pixel changes: 256 of 256 fixture cells are byte-equal. The reviews are comments on #3464. The pointers for the next steps are comments on #3353 and #3345; the WASM allowance of the block is a comment on #3105.Generated by Claude Code