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, and #3273 (the far look as strokes: the far block, stroke pages of level 17 and 16). Design on
timosPC: /media/timo/OSM1/tmp/ground-plan/crossings/CASES.md 7.5 and 7.6, drawings/c5-viaduct.svg panels B to D.
Short names: gp/ = host/obc-ground-plan/src/, tv/ = builder/web/src/lib/trailview/. Code places verified on
ground-plan ea4da43.
Goal
From far away a bridge is the same deck with fewer parts, and a tunnel mouth is a dark plate in its frame. The far
ground never paints a bridge or a tunnel floor onto the terrain. One model draws a structure at every distance: the
old bridge and tunnel meshes stop on the plan path.
Depends on / blocks
- Depends on: GP12.3a and GP12.3b (deck sheets, states in the faces), GP12.4 (bores, frames), and TrailView ground plan: far cells build only their lines, and the pages of level 17 and 16 are drawn as strokes #3273 pull request B2 (the
viewer draws the far block's stroke pages). - Blocks: GP12.7 (the far ribbon of a roof uses this step's far forms); TrailView ground plan GP19: the ground plan becomes the only path, the old code goes, docs, budgets, merge into develop #3110 (GP19) deletes the old files after it.
Design
1. The page rule: storey 0 only
- The lookup pages (level 18) and the stroke pages (levels 17 and 16, TrailView ground plan: far cells build only their lines, and the pages of level 17 and 16 are drawn as strokes #3273) paint storey 0 only. Since GP12.3b,
in_level(gp/faces/mod.rs:197-206) reads the states: a DECK or HIDDEN station is not on storey 0, an OPEN
station is. The far block (gp/faces/records/far.rs, built fromrecord_linesof the ground level) therefore
holds the right lines with no rule of its own. Check it: no deck or hidden stretch in a far block's ground lines;
every open stretch in it. - This removes TrailView ground plan: far cells build only their lines, and the pages of level 17 and 16 are drawn as strokes #3273's fault 2 ("a grey track mouth at a bridge end, a streak on a deck") on the plan path.
2. The far forms (CASES 7.5)
- Data. The far block gains a part of storey lines: per DECK piece its line (samples, half-width, the edge band,
the depth, the edge feature's height), per pier point its position, and per portal line its position, direction
and opening. Estimate: about 40 bytes per 10 m of deck at the far block's sample spacing, 32 bytes per portal.
Report the far block's bytes per cell before and after. - Build. The crate builds the far forms' triangles in the far build of a cell (
records::far_block,
cell::far_request; and in a full build with its far block), from the same states, sheets and lines as the near
build, as a small mesh beside the far block. One model: the near sheet and the far form come from one source. - Forms:
| Thing | Distance | Form | Thickness |
|---|---|---|---|
| Deck | the mesh range to about 2 km | a box per stretch: top, two edge faces as tall as deck plus parapet, underside | the edge band and the deck depth: never a single sheet |
| Deck | past about 2 km, while wider than a pixel | a ribbon: top and two edge faces | the edge faces keep the depth |
| Pier | to about 2 km | a plate of the pier's width, as tall as the pier | closed (two faces and the ends) |
| Portal | to about 2 km | one dark plate in the frame's outline | the frame's depth |
| Portal | past about 2 km | nothing: the way ends at the hill |
A deck shorter than 10 m has no far form: past the mesh range the page shows the way over the water (CASES case 1).
- Draw. The far forms draw with the structure pipeline and its casters, and the structure pipeline discards a far
form's fragment whereplan_meshedholds (the predicate of GP12.3b: there the cell's mesh draws, and its sheets
draw). Nothing fades: the mesh hands over by cells. A near sheet and its far form never draw at one place, and no
structure is missing between them. - The ground under a far deck. The stamp's trough is off on the plan path at levels 16 to 18 (GP12.2b); this step
turns it off at the far levels too (nodeStamps,tv/terrain/bins.ts:1048, levels underNEAR). Where the terrain
stands over a far deck's underside (a deck in a cut, on a slope), a page holds it under the deck by GP12.2b's
ceiling, from the far block's deck lines. Count such places on box B first; if there are none in the gallery's far
views, write the count down and leave the ceiling out of the pages.
3. What stops on the plan path
structureMeshes(tv/structures/node.ts) does not callbridges()andtunnels()with the plan; the interim
hand-over of GP12.3b and GP12.4 (the discard of the old meshes whereplan_meshedholds) goes. The portal holes are off since GP12.4.- The stamps layer (
planner/trailview-stamps,tv/terrain/stamp-bake.ts) bakes the owner nodes' structure meshes
with the plan: it then holds no bridge and no tunnel mesh. Its bytes shrink; rebake it locally for the shots
(obc data update local) and report its bytes before and after. - The eye's floor on a deck or in a bore (
floorsOf,tv/structures/node.ts;Structures.floor) reads the lines,
not the meshes: it stays. - The default path keeps
bridges.ts,tunnels.tsandroads/decks.tsuntil GP19 (TrailView ground plan GP19: the ground plan becomes the only path, the old code goes, docs, budgets, merge into develop #3110).
Invariants
- One model at every distance: on the plan path no structure has two meshes at one place, and none is missing at the
mesh range. Check: three views of one bridge and one portal from before, inside and past the line of the meshed cells. - No page paints a DECK or HIDDEN stretch; every OPEN stretch is painted. Check: a crate test over the fixture's far
blocks. - The far forms keep their edge faces and depth: no single-sided sheet shows an edge at any distance. Check: a test
of the far mesh's closure, and the far gallery views. - A far form comes from the same states as the near sheet: a crossing on step 3 has no far deck. Check: crate test.
- The default path does not change.
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."
- One road model near and far, artifact-free by construction at every distance; no separate far system.
- The far field may be a second renderer of the same lines, if it looks the same (the owner's decision on TrailView ground plan: far cells build only their lines, and the pages of level 17 and 16 are drawn as strokes #3273).
- Structure parts are never paper-thin sheets: the far forms keep an edge band.
Not in scope
Roofs far (GP12.7). The stroke renderer itself (#3273). Far water under decks (#3107).
Proofs and pictures required before review
- Add far cameras to the gallery (
gallery/views.json): one per viaduct and per mouth, at about 600 m, 1.2 km and
2.5 km:B01,B14,p08,R09,T15,T02,B1,T07. Shoot them before and after with the near cameras of
all 50 places; one before | after sheet per place; a verdict table. The implementer opens every sheet. - Expected:
B01,p08,B14whole at every distance with no grey band; the farT02andB1with a dark opening,
no ground in it; no bridge missing and no doubled deck at the line of the meshed cells. - The hand-over views of invariant 1 at
B01and at the fixture'sbridge-topplace. - The owner sees the sheets and gives his OK before the merge.
Cost to measure
Base: ground-plan at the branch point; develop's head for the frame.
- Far forms: triangles per km of deck and per portal (CASES 7.6 estimate: 6 to 8 per 20 to 40 m of deck, 2 per
portal), against today's farbridges.tsandtunnels.tsmeshes of the same structures. - The far block's bytes per cell; the far build's time per cell (
cell::far_request), p50 and p95. - The stamps layer's bytes (it loses the structure meshes).
- Frame:
zoom-outofflights.json,walk,valley-drive, andluz, against the base and develop's head. - WASM bytes, gzip and raw (the block's 15 to 25 kB; report the step's share; stop past 25 kB in total).
Risks and the stop rule
- Stop and report if the far forms need a second set of states, a page rule of their own, or a pixel discard in the
terrain. - Stop and report if the far forms cost more than today's far structure meshes on the GPU by twice or more.
- Stop and report if TrailView ground plan: far cells build only their lines, and the pages of level 17 and 16 are drawn as strokes #3273 B2 changes the far block's layout in a way that this step cannot extend; agree the format
with TrailView ground plan: far cells build only their lines, and the pages of level 17 and 16 are drawn as strokes #3273 first. - 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.
Activity
timohueser commentedon Nov 13, 2026
From GP12.3b part A (PR #3470), for GP12.6
The levels of the way graph (
graph::levels) now run in the feature bake (features revision 18), on every zoom-16 cell of each zoom-13 tile with a road way. The zoom-13 tiles carry per road way the tagslevels(the states D/B/O/H and the end lines A/P/C, in metres along the stroke),storeyandslab(specs/trailview-features.md, Structures). The device reads them withgraph::level_tags::read; it does not rungraph::levels. The bake uses the rule tables of its own build: a change of a level rule (cover,lift_max_m,open_max_m, the least rooms, the class rows) or of the code of the levels takes a new bake, a new revision and a fixture rebake (make-fixture.py features, about 10 s); the testthe_tiles_carry_the_levels_of_each_cellfails until then. A way of a cell margin reads the levels of the cell that owns it, so cells agree by construction. The low zooms carry no level tags.For this step: a far form that needs the states reads the zoom-13 tags; the far tiles hold none.
Generated by Claude Code
timohueser commentedon Nov 14, 2026
GP12.3b part B (#3482) builds the interim mechanism that this step ends:
structures/bridges.tsbuilds a bridge's faces into their own index range (MeshBuilder.bridge,StructureMesh.decks). With the ground plan they draw with their own pipeline (BRIDGESofstructures.wgsl),which discards each pixel where a cell's mesh draws, by the same dither as a cut piece's fade (
plan_shareofplan/cells.wgsl); the casters discard there too (bridge_caster). The structures bind the plan cells at their ownbinding by an include swap (
plan/cells-buffer.wgsl,structures/plan-cells.wgsl).MeshBuilder.beside).Generated by Claude Code
timohueser commentedon Nov 14, 2026
A note from the fix round of GP12.3b part B (#3482) for the far forms.
Near the eye, each deck now shows what it is made of, by the rule of the old bridges (
segmentofstructures/bridges.ts), per deck way: a road on beams and a railway are concrete, a bridge that hangs is steel, anyother is dark timber; a railing is light wood on timber, else steel; a timber deck's top that the old viewer did not
count as paved is of planks. The device writes this into each storey line's finish word (bits 21 to 23 from
records::BUILD_SHIFT; the material field is now 4 bits). A far form can read the same bits, so that a bridge keepsits material from near to far.
Generated by Claude Code