feat: SFO, LAX, both bridges, a road that reads as a road, and aeroplanes that move
**The aeroplanes were stuck because the wire could not describe motion.** `WireAircraft` carried position, altitude and heading and nothing else, so the client could only interpolate between the last two observations: every aircraft replayed a segment it had already flown, arrived at the newest known point, and sat still until the next poll landed five to fifteen seconds later. The feed had the missing numbers the whole time and the server threw them away. Sampled live from `api.adsb.lol/v2/point` while writing this — `gs` ground speed, `track`, `baro_rate`, plus `r` registration and `t` type designator. They are on the wire now in SI, aircraft dead-reckon along their own track and correct toward the truth when a fix lands, and the click card an anonymous visitor gets says "B739 · N68834". That last part is the enrichment FR24 was wanted for, obtained from an ODbL feed we may actually republish. **SFO and LAX exist.** A new `engine/airports.ts` composes an airport from runways, taxiways, aprons and terminal masses, with markings drawn on a canvas rather than modelled; the pattern of the runways is what the eye recognises from altitude, long before any building does. SFO is the two crossing pairs on the bay fill; LAX is the four parallels either side of the terminal horseshoe, plus the Southland fields under the traffic that actually flies there. **The Golden Gate and the Bay Bridge are those bridges.** One kit in `engine/bridges.ts`, because a suspension bridge is a repeated tower, a catenary main cable, a series of hangers and a deck — so both are configurations rather than two private implementations. The Bay Bridge carries the real 2013 topology: two suspension towers west of Yerba Buena, one east, then the piered causeway. The freeway stopped being a wireframe overlay and became a road, with shoulders, a median, and lane markings as texture. **And the board got faster while all of that landed.** California went from 728,744 triangles and 562 draw calls to 391,169 and 371 — headroom from 2.8% to 47.8%. The Bay Area board is 506,550 triangles lighter than before this work. Two things paid for it: - `transmission: 0.08` on the aircraft cockpit glass. three.js runs a full transmission backdrop pass whenever any rendered material has transmission above zero, re-drawing the entire opaque scene into a second target every frame — so the city was rendering terrain, every block and every freeway piece TWICE. Measured by patching only that number in a copy of the built bundle: 703,267 tris / 562 draws with it, 398,608 / 371 without. The material was already `transparent: true, opacity: 0.86`, so it was buying nothing. - Flatness-adaptive terrain LOD, which collapses runs of lattice cells wherever the height and colour agree with the quad replacing them. The coastline is provably untouched — a patch collapses only when every point is on land and agrees about `park` — and a test asserts the drawn footprint matches the cell-by-cell area to 1e-6. `createTerrain` got *faster*: the vertices it stops emitting cost more than the flatness scan costs to run. **The budget now watches the boards this was built on.** There was no `bay-area` or `socal` cell — so SFO, LAX and both bridges all landed in frames nothing measured, which is how a cap you do not have looks from the inside. Both are in the matrix now with caps set from measurement, and the rationale lives in the harness because JSON cannot hold a comment. Two known defects ship with this, both recorded in TODO.md rather than hidden: - `bay-area.desktop` drops about one frame in twenty (p50 16.7, p95 33.3). It is desktop-only and not fill rate — mobile runs the same 2.26 M triangles at a comparable pixel count and holds 16.7 flat — which points at the 2048 shadow map desktop uses against handheld's 1024. Measured at the commit before this work with the same harness: identical p95 33.3. Pre-existing, and invisible until the cell existed. - The aeroplane glyph is still about 1.5x the Golden Gate's main span at chapter zoom, down from 2.5x. `GLYPH_MAX_SCALE` is 52 because the raw scale at the far end of the California orbit is 51.0 at a 60-degree field of view, and 26 — tried first — put the glyph at 0.0123 of the frame against the 0.012 where the wings stop resolving. The real fix is to clamp against the camera's focus distance rather than the aircraft's, which is a signature change. Tests 1020 -> 1137. Typecheck, build, eight budget cells, no-binaries, provenance, zero-config boot, dependency licences, arena source hashes and the UI smoke across two viewports and two access tiers all pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+290
-40
@@ -44,6 +44,7 @@
|
||||
* nothing there but water and the flanks of two mountain ranges.
|
||||
*/
|
||||
|
||||
import type { Airport } from "../engine/airports.ts";
|
||||
import type { Bridge, City, District, Hill, Landmark, LatLng } from "../engine/types.ts";
|
||||
|
||||
/**
|
||||
@@ -1222,43 +1223,265 @@ export const MARIN_101: LatLng[] = [
|
||||
[38.012, -122.538],
|
||||
];
|
||||
|
||||
/**
|
||||
* Runways, drawn as roads because that is exactly what they are at this scale:
|
||||
* a pale straight strip laid on flat ground.
|
||||
*
|
||||
* Worth the eight lines. SFO's crossing pairs on their square of fill are the
|
||||
* one shape on the Peninsula's bay edge you can name from ten thousand feet,
|
||||
* and the reason San Jose's downtown is short is standing on the other one.
|
||||
*/
|
||||
export const SFO_RUNWAYS: LatLng[][] = [
|
||||
[
|
||||
[37.6151, -122.36],
|
||||
[37.6229, -122.3948],
|
||||
],
|
||||
[
|
||||
[37.6171, -122.3594],
|
||||
[37.6249, -122.3942],
|
||||
],
|
||||
[
|
||||
[37.633, -122.3709],
|
||||
[37.605, -122.3791],
|
||||
],
|
||||
[
|
||||
[37.6335, -122.3735],
|
||||
[37.6055, -122.3817],
|
||||
],
|
||||
];
|
||||
// ---- Airports -------------------------------------------------------------
|
||||
|
||||
export const SJC_RUNWAYS: LatLng[][] = [
|
||||
[
|
||||
[37.3705, -121.9385],
|
||||
[37.3555, -121.9195],
|
||||
/**
|
||||
* San Francisco International, on the fill at the bay edge below the city.
|
||||
*
|
||||
* The board has had real aircraft over it since the ADS-B layer landed, and
|
||||
* every one of them was descending onto nothing. This is the ground they were
|
||||
* descending onto.
|
||||
*
|
||||
* ## The headings are the whole of it
|
||||
*
|
||||
* SFO is two crossing pairs, and that pattern is its signature from any
|
||||
* altitude a board camera sits at: long before a terminal is a terminal, the
|
||||
* eye reads four bars making an X on a square of fill. So the numbers below
|
||||
* that matter most are the two bearings, and they are **true**, not the
|
||||
* magnetic ones the runways are named after.
|
||||
*
|
||||
* A runway designator is magnetic and rounded to the nearest ten degrees. San
|
||||
* Francisco's declination is about 13.5° east, so "28R" is a runway pointing
|
||||
* **298.6° true** and "1L" one pointing **26.5°**. Building from the painted
|
||||
* numbers instead would lay the whole airport thirteen degrees out and put the
|
||||
* 28s on a heading that misses the city they point at. The two check against
|
||||
* each other and against history: at the ~17° east declination of the years the
|
||||
* designators were assigned, 118.6° true is 101.6° magnetic — "10" — and 26.5°
|
||||
* true is 9.5° magnetic — "01".
|
||||
*
|
||||
* The two pairs are **92.1° apart**, which is the other thing worth being exact
|
||||
* about. SFO crosses at very nearly a right angle; an airfield whose runways
|
||||
* cross at seventy degrees is a different airport, and reads as a generic one.
|
||||
*
|
||||
* ## The relative geometry
|
||||
*
|
||||
* Everything is placed from the airport reference point at 37.6189, −122.3750,
|
||||
* which is what makes the four runways consistent with each other rather than
|
||||
* four independent guesses:
|
||||
*
|
||||
* - **10L/28R** is 11,870 ft (3,618 m). **10R/28L** is 11,381 ft (3,469 m),
|
||||
* 229 m — 750 ft — to its south-south-west. That separation is the famous
|
||||
* one: the closest parallel pair in the United States used for simultaneous
|
||||
* approaches, and the reason every SFO arrival in low cloud is a single-file
|
||||
* arrival. The 28 thresholds sit abeam each other at the shoreline, so the
|
||||
* 149 m 10R/28L gives away comes off its western end.
|
||||
* - **1L/19R** is 7,650 ft (2,332 m). **1R/19L** is 8,650 ft (2,637 m), 213 m
|
||||
* — 700 ft — to its east-south-east. The 01 thresholds sit abeam at the
|
||||
* south end and the extra length runs north.
|
||||
*
|
||||
* The 28 thresholds land ~70 m inside the bay edge traced in `PENINSULA`, which
|
||||
* is not luck: that outline was drawn with "SFO's bay edge — the runways are
|
||||
* built out onto the mud" written on the vertex, and now they are.
|
||||
*
|
||||
* Terminals are **massed rather than surveyed**. The horseshoe is right — the
|
||||
* International Terminal across the west end, Terminals 1 and 3 as the arms
|
||||
* reaching east, Terminal 2 and the garages in the court, the tower in the
|
||||
* middle of it — and it sits in the wedge between the west ends of the 28s and
|
||||
* the south ends of the 01s, which is where SFO's terminals are. Individual
|
||||
* boarding-area fingers are not modelled: at 94 m per scene unit a boarding
|
||||
* area is two pixels, and the aircraft parked against it are not.
|
||||
*/
|
||||
export const SFO: Airport = {
|
||||
id: "KSFO",
|
||||
name: "San Francisco International",
|
||||
lat: 37.6189,
|
||||
lng: -122.375,
|
||||
// 13 ft. Carried because it is a fact about the place; the kit grades the
|
||||
// field onto the terrain rather than lifting it to this, which on a board
|
||||
// exaggerating relief 3.6× would stand SFO fourteen metres above its own
|
||||
// shoreline. See `engine/airports.ts`.
|
||||
elevation: 4,
|
||||
|
||||
/**
|
||||
* The fill, traced to meet `PENINSULA`'s bay edge without crossing it.
|
||||
*
|
||||
* The eastern four lie a few tens of metres inside coastline vertices this
|
||||
* pack already had — the airport is on made ground and its eastern boundary
|
||||
* *is* the shore. The western edge runs a few hundred metres east of US-101,
|
||||
* which is where the fence actually is.
|
||||
*/
|
||||
field: [
|
||||
[37.6425, -122.3782],
|
||||
[37.6398, -122.3592],
|
||||
[37.6232, -122.3548],
|
||||
[37.6072, -122.3576],
|
||||
[37.6048, -122.381],
|
||||
[37.6105, -122.3935],
|
||||
[37.6262, -122.3968],
|
||||
[37.6355, -122.3905],
|
||||
],
|
||||
[
|
||||
[37.3685, -121.9405],
|
||||
[37.3535, -121.9215],
|
||||
|
||||
runways: [
|
||||
// 10L [37.62861, -122.39335] -> 28R [37.61305, -122.35733]
|
||||
{ id: "10L/28R", lat: 37.62083, lng: -122.37534, heading: 118.6, length: 3618, width: 61, designators: ["10L", "28R"] },
|
||||
// 10R [37.62616, -122.39311] -> 28L [37.61124, -122.35857]
|
||||
{ id: "10R/28L", lat: 37.6187, lng: -122.37584, heading: 118.6, length: 3469, width: 61, designators: ["10R", "28L"] },
|
||||
// 1L [37.60783, -122.38525] -> 19R [37.62657, -122.37345]
|
||||
{ id: "1L/19R", lat: 37.6172, lng: -122.37935, heading: 26.5, length: 2332, width: 61, designators: ["1L", "19R"] },
|
||||
// 1R [37.60697, -122.38309] -> 19L [37.62817, -122.36975]
|
||||
{ id: "1R/19L", lat: 37.61757, lng: -122.37642, heading: 26.5, length: 2637, width: 61, designators: ["1R", "19L"] },
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* The four outer parallels — A and B outside the 10s, F and Z outside the 01s.
|
||||
*
|
||||
* Typed as coordinates rather than computed here, because a city pack is data
|
||||
* and `airports.ts` imports three.js. `parallelTaxiway()` produced them and
|
||||
* `sfoAirport.test.ts` asserts they still match what it produces, so the
|
||||
* derivation is checked without the pack having to run it.
|
||||
*/
|
||||
taxiways: [
|
||||
{ id: "A", path: [[37.62939, -122.39126], [37.61487, -122.35763]] },
|
||||
{ id: "B", path: [[37.62434, -122.39281], [37.61046, -122.36066]] },
|
||||
{ id: "F", path: [[37.60907, -122.38586], [37.62621, -122.37507]] },
|
||||
{ id: "Z", path: [[37.60711, -122.38091], [37.6267, -122.36858]] },
|
||||
],
|
||||
|
||||
aprons: [
|
||||
// The terminal court and the stands around it, square to the 01s the way
|
||||
// the whole complex is.
|
||||
{
|
||||
id: "terminal",
|
||||
polygon: [
|
||||
[37.61834, -122.37961],
|
||||
[37.62211, -122.38915],
|
||||
[37.61407, -122.39421],
|
||||
[37.6103, -122.38467],
|
||||
],
|
||||
},
|
||||
// The north field: cargo and the maintenance base, and the reason there is
|
||||
// a kilometre and a half of airport north of the 19 thresholds.
|
||||
{
|
||||
id: "north-field",
|
||||
polygon: [
|
||||
[37.6314, -122.3738],
|
||||
[37.63381, -122.37989],
|
||||
[37.62706, -122.38414],
|
||||
[37.62465, -122.37805],
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
/**
|
||||
* The horseshoe, and where the aeroplanes go.
|
||||
*
|
||||
* Terminals 1 and 3 are the two arms and they run out to meet the
|
||||
* International Terminal at the closed end, so the complex reads as a U at
|
||||
* the scale it is seen from rather than as five separate slabs. `gates` puts
|
||||
* the stands on the **outside** of the U on all three, which is where SFO's
|
||||
* are: the court inside holds Terminal 2, the garages and the roadway, and
|
||||
* nothing that needs a wingspan.
|
||||
*/
|
||||
terminals: [
|
||||
// Heights are the real ones — a terminal is two or three storeys over a very
|
||||
// large footprint — and they are the numbers to keep even though the board
|
||||
// exaggerates its vertical 3.6× and makes a 26 m building stand ninety
|
||||
// metres tall. Trimming them to compensate would put SFO on a different
|
||||
// vertical scale from every house in San Bruno behind it, and the eye
|
||||
// notices that far sooner than it notices a tall terminal.
|
||||
{ id: "international", lat: 37.61749, lng: -122.39016, length: 600, width: 120, height: 28, heading: 26.5, gates: { count: 6, side: -1 } },
|
||||
{ id: "t3", lat: 37.6187, lng: -122.38559, length: 500, width: 100, height: 17, heading: 116.5, gates: { count: 6, side: -1 } },
|
||||
{ id: "t1", lat: 37.61387, lng: -122.38863, length: 500, width: 100, height: 17, heading: 116.5, gates: { count: 6, side: 1 } },
|
||||
{ id: "t2", lat: 37.61596, lng: -122.3863, length: 300, width: 80, height: 15, heading: 26.5 },
|
||||
{ id: "garages", lat: 37.61516, lng: -122.38427, length: 340, width: 90, height: 21, heading: 26.5 },
|
||||
// The north field, square to the 10s rather than to the terminals, which is
|
||||
// what stops the maintenance base reading as more of the same building. A
|
||||
// widebody hangar is genuinely as tall as a six-storey block.
|
||||
{ id: "maintenance", lat: 37.62806, lng: -122.38135, length: 260, width: 120, height: 25, heading: 118.6 },
|
||||
{ id: "cargo", lat: 37.63013, lng: -122.37715, length: 220, width: 100, height: 14, heading: 118.6, gates: { count: 3, side: 1 } },
|
||||
],
|
||||
|
||||
// No `tower`: this pack draws SFO's as a labelled `Landmark`, because that is
|
||||
// what the minimap reads. See `LANDMARKS` above.
|
||||
};
|
||||
|
||||
/**
|
||||
* Mineta San José, two parallels at the head of the valley.
|
||||
*
|
||||
* Here because it was already on this board as a pair of pale strips and the
|
||||
* kit is what those strips wanted to be — not because the South Bay needs an
|
||||
* airport modelled. Two 11,000 ft runways 700 ft apart on 131.5° true (which
|
||||
* is "12" once the same 13.4° of easterly declination comes off it), the
|
||||
* terminal frontage on the north-east side where Highway 87 runs, and nothing
|
||||
* else: from a camera that can see San Jose at all, SJC is its runways.
|
||||
*
|
||||
* The plate is kept east of −121.946 and between 37.348 and 37.377 on purpose.
|
||||
* That is the gap this pack's districts already leave — `santa-clara` stops at
|
||||
* the airport's west fence, `san-jose-north` above it and `san-jose-downtown`
|
||||
* below — and a field plate that crossed into one of them would have houses
|
||||
* scattered over it.
|
||||
*/
|
||||
export const SJC: Airport = {
|
||||
id: "KSJC",
|
||||
name: "Norman Y. Mineta San José International",
|
||||
lat: 37.3626,
|
||||
lng: -121.9291,
|
||||
elevation: 19,
|
||||
/**
|
||||
* The plate is **asymmetric about the runways** on purpose: it runs 430 m
|
||||
* south-west of the centreline and only 230 m north-east, because this pack's
|
||||
* `BAYSHORE_101` passes about 240 m north-east of runway 12L and a field that
|
||||
* reached past it would have a freeway drawn across the middle of the airport.
|
||||
*
|
||||
* It is also kept east of −121.946 and between 37.348 and 37.377, which is the
|
||||
* gap this pack's districts already leave — `santa-clara` stops at the west
|
||||
* fence, `san-jose-north` above and `san-jose-downtown` below — and a plate
|
||||
* that crossed into one would have houses scattered over it.
|
||||
*/
|
||||
field: [
|
||||
[37.35343, -121.91214],
|
||||
[37.34899, -121.91708],
|
||||
[37.37042, -121.94756],
|
||||
[37.37486, -121.94261],
|
||||
],
|
||||
runways: [
|
||||
// 12L [37.3733, -121.94249] -> 30R [37.35334, -121.91411]
|
||||
{ id: "12L/30R", lat: 37.36332, lng: -121.9283, heading: 131.5, length: 3353, width: 46, designators: ["12L", "30R"] },
|
||||
// 12R [37.37186, -121.94409] -> 30L [37.3519, -121.91571]
|
||||
{ id: "12R/30L", lat: 37.36188, lng: -121.9299, heading: 131.5, length: 3353, width: 46, designators: ["12R", "30L"] },
|
||||
],
|
||||
taxiways: [{ id: "A", path: [[37.37377, -121.94061], [37.35489, -121.91375]] }],
|
||||
aprons: [
|
||||
{
|
||||
id: "terminal",
|
||||
polygon: [
|
||||
[37.36036, -121.92315],
|
||||
[37.3615, -121.92187],
|
||||
[37.36817, -121.93136],
|
||||
[37.36702, -121.93263],
|
||||
],
|
||||
},
|
||||
],
|
||||
// Terminals A and B as one frontage on the north-east side, where Highway 87
|
||||
// and Airport Boulevard run, with the stands facing back at the runways.
|
||||
terminals: [
|
||||
{ id: "ab", lat: 37.3644, lng: -121.9271, length: 620, width: 90, height: 16, heading: 131.5, gates: { count: 7, side: 1 } },
|
||||
],
|
||||
};
|
||||
|
||||
/** Every airport on this board, in the order a pack would list them. */
|
||||
export const AIRPORTS: Airport[] = [SFO, SJC];
|
||||
|
||||
/**
|
||||
* ## Runways are no longer roads
|
||||
*
|
||||
* They were, until this pack got an airport: four hand-typed two-point paths on
|
||||
* *magnetic* headings — thirteen degrees out of true, with the 01/19 pair nearly
|
||||
* nine hundred metres too long — handed to `createRoads` as `kind: "street"`,
|
||||
* because a pale strip on flat ground was as close as the road builder could
|
||||
* get. The kit draws the same centrelines properly, with paint on them, the
|
||||
* fill under them and the terminals beside them, so those entries are gone from
|
||||
* `ROADS` above.
|
||||
*
|
||||
* **The two cannot both be present.** A road ribbon drapes 0.14 units — thirteen
|
||||
* metres at this board's scale — above the terrain and a runway quad sits flush
|
||||
* on it, so a board carrying both floats a dark forty-seven-metre stripe over
|
||||
* every runway on the Peninsula. It was photographed before it was deleted.
|
||||
*
|
||||
* `runwayCentreline()` in `engine/airports.ts` reproduces those paths from the
|
||||
* `SFO` and `SJC` declarations above, if anything ever wants a runway as a line
|
||||
* again.
|
||||
*/
|
||||
|
||||
export const ROADS: City["roads"] = [
|
||||
{ path: MARKET_STREET, width: 0.34, kind: "street" },
|
||||
@@ -1284,8 +1507,6 @@ export const ROADS: City["roads"] = [
|
||||
{ path: COAST_HIGHWAY, width: 0.2, kind: "street" },
|
||||
{ path: HIGHWAY_92, width: 0.2, kind: "street" },
|
||||
{ path: HIGHWAY_84, width: 0.2, kind: "street" },
|
||||
...SFO_RUNWAYS.map((path) => ({ path, width: 0.5, kind: "street" as const })),
|
||||
...SJC_RUNWAYS.map((path) => ({ path, width: 0.45, kind: "street" as const })),
|
||||
];
|
||||
|
||||
// ---- Bridges --------------------------------------------------------------
|
||||
@@ -1513,9 +1734,24 @@ export const LANDMARKS: Landmark[] = [
|
||||
// campus — a building named for a company would put a trademark on the map,
|
||||
// and ARCHITECTURE.md §3.1 is the reason there is not one in this repo.
|
||||
{
|
||||
/**
|
||||
* The airport's tower, and the one piece of SFO that is **not** in `SFO`
|
||||
* below.
|
||||
*
|
||||
* `Airport` has a `tower` field and the kit draws a much better one — a
|
||||
* tapered shaft with a cab on it, in the airport's own palette. It is
|
||||
* deliberately not used here, because this landmark was already on the board
|
||||
* and a landmark is more than a mesh: `label: true` is what puts SFO on the
|
||||
* **minimap**, and `minimap.ts` reads `city.landmarks`, not the airport. Two
|
||||
* towers four hundred metres apart is what you get if you forget that, and
|
||||
* it was photographed before it was noticed.
|
||||
*
|
||||
* Moved to sit in the terminal court with the rest of the complex, which is
|
||||
* where SFO's tower actually stands.
|
||||
*/
|
||||
name: "SFO Control Tower",
|
||||
lat: 37.618,
|
||||
lng: -122.3838,
|
||||
lat: 37.6174,
|
||||
lng: -122.3883,
|
||||
height: 67,
|
||||
footprint: 0.00014,
|
||||
shape: "tower",
|
||||
@@ -2203,10 +2439,15 @@ export const DISTRICTS: District[] = [
|
||||
{
|
||||
id: "santa-clara",
|
||||
name: "Santa Clara",
|
||||
// The east edge stops at Mineta's west fence rather than at the freeway.
|
||||
// Both eastern vertices were 0.004° further east and the corner reached over
|
||||
// the airport's graded plate, which put a wedge of scattered houses across
|
||||
// the north-west end of 12L/30R. Same argument, and same fix, as
|
||||
// `millbrae-burlingame` up at SFO.
|
||||
polygon: [
|
||||
[37.372, -122.0],
|
||||
[37.369, -121.942],
|
||||
[37.34, -121.95],
|
||||
[37.369, -121.946],
|
||||
[37.34, -121.954],
|
||||
[37.343, -122.008],
|
||||
],
|
||||
minHeight: 7,
|
||||
@@ -2693,6 +2934,15 @@ export const SAN_FRANCISCO_CITY: City = {
|
||||
bridges: BRIDGES,
|
||||
roads: ROADS,
|
||||
chapters: CHAPTERS,
|
||||
|
||||
/**
|
||||
* SFO and SJC, drawn by `engine/airports.ts` as graded plates with the real
|
||||
* runway headings on them. The four runways that used to be pale `Road`
|
||||
* strips are gone from `ROADS` above and must stay gone: a road ribbon drapes
|
||||
* thirteen metres over the terrain at this scale, so a board carrying both
|
||||
* would float a dark stripe across every runway the kit lays flush.
|
||||
*/
|
||||
airports: AIRPORTS,
|
||||
};
|
||||
|
||||
export default SAN_FRANCISCO_CITY;
|
||||
|
||||
Reference in New Issue
Block a user