@johnmorrisdotca/kyogijo-stadiums 0.40.1 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -0
- package/NOTICE.md +17 -0
- package/README.md +1 -3
- package/dist/context.d.ts +141 -0
- package/dist/context.js +290 -0
- package/dist/crowd.d.ts +33 -1
- package/dist/crowd.draw.d.ts +1 -1
- package/dist/crowd.draw.js +16 -2
- package/dist/crowd.js +9 -1
- package/dist/district-entry.d.ts +14 -0
- package/dist/district-entry.js +9 -0
- package/dist/district.d.ts +54 -1
- package/dist/district.dom.d.ts +31 -0
- package/dist/district.dom.js +52 -0
- package/dist/district.js +71 -11
- package/dist/district.turn.js +30 -6
- package/dist/draw.js +37 -13
- package/dist/gates.d.ts +56 -0
- package/dist/gates.js +95 -0
- package/dist/halls.d.ts +2 -0
- package/dist/halls.js +1 -1
- package/dist/kodokan.d.ts +28 -0
- package/dist/kodokan.data.d.ts +18 -0
- package/dist/kodokan.data.js +18 -0
- package/dist/kodokan.js +34 -0
- package/dist/osm-entry.d.ts +2 -0
- package/dist/osm-entry.js +2 -0
- package/dist/osm.context.data.d.ts +10 -0
- package/dist/osm.context.data.js +1107 -0
- package/dist/outside.d.ts +43 -0
- package/dist/outside.dom.d.ts +44 -0
- package/dist/outside.dom.js +203 -0
- package/dist/outside.js +227 -0
- package/dist/outside.paint.d.ts +57 -0
- package/dist/outside.paint.js +88 -0
- package/dist/plateau-entry.d.ts +3 -0
- package/dist/plateau-entry.js +3 -0
- package/dist/plateau.credit.d.ts +5 -0
- package/dist/plateau.credit.js +7 -0
- package/dist/plateau.data.d.ts +7 -0
- package/dist/plateau.data.js +757 -0
- package/dist/stadiums.d.ts +15 -1
- package/dist/stadiums.data.js +2 -1
- package/dist/stadiums.js +48 -12
- package/dist/strings.d.ts +3 -1
- package/dist/strings.js +4 -4
- package/dist/surfaces/surface.d.ts +5 -0
- package/dist/turn.dom.d.ts +10 -0
- package/dist/turn.dom.js +21 -0
- package/dist/turn.kit.d.ts +10 -3
- package/dist/turn.kit.js +7 -0
- package/dist/turn.markup.js +7 -2
- package/dist/turn.model.d.ts +3 -0
- package/dist/turn.style.js +15 -3
- package/dist/uprights.js +9 -1
- package/dist/venue.js +9 -3
- package/dist/venue.real.d.ts +22 -1
- package/dist/venue.real.js +76 -7
- package/dist/venues.d.ts +9 -1
- package/dist/venues.data.js +2 -1
- package/dist/venues.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/walk.d.ts +56 -0
- package/dist/walk.data.d.ts +4 -0
- package/dist/walk.data.js +1295 -0
- package/dist/walk.js +120 -0
- package/package.json +17 -1
package/dist/venue.real.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Pt, type RealShell, type StandRing } from "./crowd.ts";
|
|
2
|
-
import { type Upright } from "./turn.kit.ts";
|
|
2
|
+
import { type Plane, type Upright } from "./turn.kit.ts";
|
|
3
3
|
/** How far a lid rises from its edge towards the middle, and how far a saddle's high ends stand over its low sides, in feet (ours: the sources give a roof's kind, not its height). */
|
|
4
4
|
export declare const LID_RISE = 22;
|
|
5
5
|
export declare const SADDLE_RISE = 30;
|
|
@@ -9,6 +9,22 @@ export declare function saddleAt(real: Pick<RealShell, "footprint">, [x, y]: Pt)
|
|
|
9
9
|
export declare const roofAt: (real: RealShell, p: Pt) => number;
|
|
10
10
|
/** The point where a ray from `from` first meets a polygon, or `undefined`. */
|
|
11
11
|
export declare function firstHit(poly: readonly Pt[], from: Pt, angle: number): Pt | undefined;
|
|
12
|
+
/** How tall the glazed concourse band over a podium is, in feet (ours). */
|
|
13
|
+
export declare const GLAZING = 14;
|
|
14
|
+
/** The point of the hall's rim at an angle from the middle: where a ray meets the hall's outline or the building's, whichever it meets first. */
|
|
15
|
+
export declare function rimPoint(real: Pick<RealShell, "hall" | "footprint">, c: Pt, angle: number): Pt;
|
|
16
|
+
/** How far a mast leans out from the vertical, in degrees (ours: the sources give the count and the height of BC Place's masts, and the photographs of the building show them leaning out from the rim). */
|
|
17
|
+
export declare const MAST_LEAN = 12;
|
|
18
|
+
/** How thick a mast is drawn, in feet (ours). */
|
|
19
|
+
export declare const MAST_WIDTH = 6;
|
|
20
|
+
/**
|
|
21
|
+
* The masts of a cable roof: `count` of them round the rim, each rising from the rim at the roof's edge, `height` feet, leaning out from the middle. A mast is two thin strips crossed, one in the plane of the slant and the
|
|
22
|
+
* radius and one in the plane of the slant and the tangent, so that it is seen from every side (as a post is). The count and the height are the sources'; the lean and the thickness are ours.
|
|
23
|
+
*/
|
|
24
|
+
export declare function mastPlanes(real: Pick<RealShell, "hall" | "footprint">, c: Pt, z: number, masts: {
|
|
25
|
+
count: number;
|
|
26
|
+
height: number;
|
|
27
|
+
}): Plane[];
|
|
12
28
|
/**
|
|
13
29
|
* The walls and the roof of a real venue (`parts` says which are made). The hall is the building's outline cut to the bowl's wall and a margin (`RealShell.hall`): its rim is where a ray from the middle meets the one or the other first, in `steps`
|
|
14
30
|
* rays. A wall stands on each stretch of the rim, up to the roof's height over it; the roof is a band from the rim in to the inner edge of the top tier (the middle stays open, as the 3D view's roofs are).
|
|
@@ -17,6 +33,11 @@ export declare function realBuilding(real: RealShell, top: StandRing | undefined
|
|
|
17
33
|
walls: boolean;
|
|
18
34
|
roof: boolean;
|
|
19
35
|
}): Items;
|
|
36
|
+
/** How far a skylight cap stands over the inner edge of the roof's band, and how wide the skylight bar is, in feet (ours: the sources do not say how high the roof closes or how wide the glass is). */
|
|
37
|
+
export declare const CAP_RISE = 7;
|
|
38
|
+
export declare const SKYLIGHT_WIDTH = 14;
|
|
39
|
+
/** The share of the opening's length the skylight bar runs over, from the middle each way. */
|
|
40
|
+
export declare const SKYLIGHT_SHARE = 0.78;
|
|
20
41
|
/** How far a canopy's low edge, the field's side of it, stands under its high edge: the OpenStreetMap roof's `roof:height` is the rise, and the canopy rises to the back of the stands (ours: the sources do not say which way it slopes). */
|
|
21
42
|
export declare const CANOPY_NOTE = "low over the field, high over the back of the stands";
|
|
22
43
|
/** How many rings of pieces an air-supported roof is drawn in, from the rim in to the crown (ours: the roof is smooth, the drawing is faceted). */
|
package/dist/venue.real.js
CHANGED
|
@@ -53,6 +53,46 @@ function slopeThrough(points) {
|
|
|
53
53
|
const [gx, gy] = Math.abs(det) < 1e-9 ? [0, 0] : [(sxz * syy - syz * sxy) / det, (syz * sxx - sxz * sxy) / det];
|
|
54
54
|
return { x0: mx, y0: my, z0: mz, gx, gy };
|
|
55
55
|
}
|
|
56
|
+
/** How tall the glazed concourse band over a podium is, in feet (ours). */
|
|
57
|
+
export const GLAZING = 14;
|
|
58
|
+
/** A wall's two bands: the podium at its foot (a shade darker), a ledge over it and a band of glazing over the ledge, on the wall's own plane (its y runs down from the top). */
|
|
59
|
+
function podiumBands(long, high, podium) {
|
|
60
|
+
const top = Math.min(podium, high * 0.6);
|
|
61
|
+
const glaze = Math.min(GLAZING, Math.max(0, high - top - 4));
|
|
62
|
+
return `<rect class="u-podium" y="${n(high - top)}" width="${n(long)}" height="${n(top)}"/><rect class="u-ledge" y="${n(high - top - 1.2)}" width="${n(long)}" height="1.2"/>${glaze > 2 ? `<rect class="u-glazing" y="${n(high - top - 1.2 - glaze)}" width="${n(long)}" height="${n(glaze)}"/>` : ""}`;
|
|
63
|
+
}
|
|
64
|
+
/** The point of the hall's rim at an angle from the middle: where a ray meets the hall's outline or the building's, whichever it meets first. */
|
|
65
|
+
export function rimPoint(real, c, angle) {
|
|
66
|
+
const cap = rayAt(real.hall, c[0], c[1], angle);
|
|
67
|
+
const out = firstHit(real.footprint, c, angle);
|
|
68
|
+
return out !== undefined && Math.hypot(out[0] - c[0], out[1] - c[1]) < Math.hypot(cap[0] - c[0], cap[1] - c[1]) ? out : cap;
|
|
69
|
+
}
|
|
70
|
+
/** How far a mast leans out from the vertical, in degrees (ours: the sources give the count and the height of BC Place's masts, and the photographs of the building show them leaning out from the rim). */
|
|
71
|
+
export const MAST_LEAN = 12;
|
|
72
|
+
/** How thick a mast is drawn, in feet (ours). */
|
|
73
|
+
export const MAST_WIDTH = 6;
|
|
74
|
+
/**
|
|
75
|
+
* The masts of a cable roof: `count` of them round the rim, each rising from the rim at the roof's edge, `height` feet, leaning out from the middle. A mast is two thin strips crossed, one in the plane of the slant and the
|
|
76
|
+
* radius and one in the plane of the slant and the tangent, so that it is seen from every side (as a post is). The count and the height are the sources'; the lean and the thickness are ours.
|
|
77
|
+
*/
|
|
78
|
+
export function mastPlanes(real, c, z, masts) {
|
|
79
|
+
const planes = [];
|
|
80
|
+
const lean = (MAST_LEAN * Math.PI) / 180;
|
|
81
|
+
for (let i = 0; i < masts.count; i += 1) {
|
|
82
|
+
const angle = (2 * Math.PI * (i + 0.5)) / masts.count;
|
|
83
|
+
const [bx, by] = rimPoint(real, c, angle);
|
|
84
|
+
const [rx, ry] = [Math.cos(angle), Math.sin(angle)];
|
|
85
|
+
const [tx, ty] = [-ry, rx];
|
|
86
|
+
const slant = [rx * masts.height * Math.sin(lean), ry * masts.height * Math.sin(lean), masts.height * Math.cos(lean)];
|
|
87
|
+
const long = Math.hypot(...slant);
|
|
88
|
+
const half = MAST_WIDTH / 2;
|
|
89
|
+
const svg = `<polygon class="u-mast" points="0 ${n(half)} ${n(long)} ${n(half * 0.45)} ${n(long)} ${n(half * 1.55)}"/>`;
|
|
90
|
+
// A strip along the slant, across the tangent; and one along the slant, across the radius.
|
|
91
|
+
planes.push({ id: `mast-${i}-a`, kind: "mast", o: [bx - tx * half, by - ty * half, z], u: slant, v: [tx * MAST_WIDTH, ty * MAST_WIDTH, 0], svg });
|
|
92
|
+
planes.push({ id: `mast-${i}-b`, kind: "mast", o: [bx - rx * half, by - ry * half, z], u: slant, v: [rx * MAST_WIDTH, ry * MAST_WIDTH, 0], svg });
|
|
93
|
+
}
|
|
94
|
+
return planes;
|
|
95
|
+
}
|
|
56
96
|
/**
|
|
57
97
|
* The walls and the roof of a real venue (`parts` says which are made). The hall is the building's outline cut to the bowl's wall and a margin (`RealShell.hall`): its rim is where a ray from the middle meets the one or the other first, in `steps`
|
|
58
98
|
* rays. A wall stands on each stretch of the rim, up to the roof's height over it; the roof is a band from the rim in to the inner edge of the top tier (the middle stays open, as the 3D view's roofs are).
|
|
@@ -60,12 +100,7 @@ function slopeThrough(points) {
|
|
|
60
100
|
export function realBuilding(real, top, centre, lift, steps, open = false, parts = { walls: true, roof: true }) {
|
|
61
101
|
const items = [];
|
|
62
102
|
const c = [centre[0], centre[1]];
|
|
63
|
-
const rim = Array.from({ length: steps }, (_, k) =>
|
|
64
|
-
const angle = (2 * Math.PI * k) / steps;
|
|
65
|
-
const cap = rayAt(real.hall, c[0], c[1], angle);
|
|
66
|
-
const out = firstHit(real.footprint, c, angle);
|
|
67
|
-
return out !== undefined && Math.hypot(out[0] - c[0], out[1] - c[1]) < Math.hypot(cap[0] - c[0], cap[1] - c[1]) ? out : cap;
|
|
68
|
-
});
|
|
103
|
+
const rim = Array.from({ length: steps }, (_, k) => rimPoint(real, c, (2 * Math.PI * k) / steps));
|
|
69
104
|
const planes = [];
|
|
70
105
|
rim.forEach((a, i) => {
|
|
71
106
|
const b = rim[(i + 1) % steps];
|
|
@@ -73,7 +108,7 @@ export function realBuilding(real, top, centre, lift, steps, open = false, parts
|
|
|
73
108
|
if (long < 1)
|
|
74
109
|
return;
|
|
75
110
|
const high = lift + (real.wall ?? roofAt(real, [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2]));
|
|
76
|
-
planes.push({ ...shy(wall(`shell-${i}`, "wall", a[0], a[1], b[0], b[1], 0, high, `<rect class="${real.ivy === true ? "u-shell u-ivy" : "u-shell"}" width="${n(long)}" height="${n(high)}"
|
|
111
|
+
planes.push({ ...shy(wall(`shell-${i}`, "wall", a[0], a[1], b[0], b[1], 0, high, `<rect class="${real.ivy === true ? "u-shell u-ivy" : "u-shell"}" width="${n(long)}" height="${n(high)}"/>${real.podium === undefined ? "" : podiumBands(long, high, real.podium)}`), centre), fadeTo: 0.02 });
|
|
77
112
|
});
|
|
78
113
|
if (parts.walls && planes.length > 0)
|
|
79
114
|
items.push({ id: "shell", kind: "walls", at: centre, height: Math.max(...planes.map((p) => p.o[2])), planes });
|
|
@@ -127,12 +162,46 @@ export function realBuilding(real, top, centre, lift, steps, open = false, parts
|
|
|
127
162
|
if (piece !== undefined)
|
|
128
163
|
roof.push({ ...piece, shy: [(mid[0] - c[0]) / away, (mid[1] - c[1]) / away] });
|
|
129
164
|
}
|
|
165
|
+
if (crown === undefined && real.skylight === true)
|
|
166
|
+
roof.push(...skylightCap(inner, c, lift + real.edge + rise));
|
|
130
167
|
if (crown !== undefined)
|
|
131
168
|
roof.push(...cablePod(lift + real.edge + crown.rise, inner, c, steps, open));
|
|
169
|
+
if (crown !== undefined && real.masts !== undefined)
|
|
170
|
+
roof.push(...mastPlanes(real, c, lift + real.edge, real.masts));
|
|
132
171
|
if (roof.length > 0)
|
|
133
172
|
items.push({ id: "roof", kind: "roof", at: centre, height: heightOf(roof), planes: roof });
|
|
134
173
|
return items;
|
|
135
174
|
}
|
|
175
|
+
/** How far a skylight cap stands over the inner edge of the roof's band, and how wide the skylight bar is, in feet (ours: the sources do not say how high the roof closes or how wide the glass is). */
|
|
176
|
+
export const CAP_RISE = 7;
|
|
177
|
+
export const SKYLIGHT_WIDTH = 14;
|
|
178
|
+
/** The share of the opening's length the skylight bar runs over, from the middle each way. */
|
|
179
|
+
export const SKYLIGHT_SHARE = 0.78;
|
|
180
|
+
/**
|
|
181
|
+
* Close the roof's middle: the opening the band leaves is covered at `z` by a flat cap raised `CAP_RISE` over the band's inner edge, with a short skirt joining the two, and over the middle of the cap along the long axis lies a long
|
|
182
|
+
* skylight bar of glass (the roof of Rogers Arena has one; the surface's long side lies along x in the drawing's frame, so the bar runs along x). The shape and the sizes are ours.
|
|
183
|
+
*/
|
|
184
|
+
function skylightCap(hole, c, z) {
|
|
185
|
+
const planes = [];
|
|
186
|
+
const top = z + CAP_RISE;
|
|
187
|
+
const cap = raked("cap", "roof", hole, { x0: c[0], y0: c[1], z0: top, gx: 0, gy: 0 }, [1, 0], (corners) => `<polygon class="u-roof" points="${pointList(corners)}"/>`);
|
|
188
|
+
if (cap !== undefined)
|
|
189
|
+
planes.push(cap);
|
|
190
|
+
hole.forEach((a, k) => {
|
|
191
|
+
const b = hole[(k + 1) % hole.length];
|
|
192
|
+
const long = Math.hypot(b[0] - a[0], b[1] - a[1]);
|
|
193
|
+
if (long < 0.5)
|
|
194
|
+
return;
|
|
195
|
+
planes.push({ ...shy(wall(`skirt-${k}`, "roof", a[0], a[1], b[0], b[1], z, top, `<rect class="u-roof" width="${n(long)}" height="${n(CAP_RISE)}"/>`), c), fadeTo: 0.3 });
|
|
196
|
+
});
|
|
197
|
+
const xs = hole.map((p) => p[0]);
|
|
198
|
+
const half = ((Math.max(...xs) - Math.min(...xs)) / 2) * SKYLIGHT_SHARE;
|
|
199
|
+
const bar = [[c[0] - half, c[1] - SKYLIGHT_WIDTH / 2], [c[0] + half, c[1] - SKYLIGHT_WIDTH / 2], [c[0] + half, c[1] + SKYLIGHT_WIDTH / 2], [c[0] - half, c[1] + SKYLIGHT_WIDTH / 2]];
|
|
200
|
+
const glass = raked("skylight", "roof", bar, { x0: c[0], y0: c[1], z0: top + 0.4, gx: 0, gy: 0 }, [1, 0], (corners) => `<polygon class="u-skylight" points="${pointList(corners)}"/>`);
|
|
201
|
+
if (glass !== undefined)
|
|
202
|
+
planes.push(glass);
|
|
203
|
+
return planes;
|
|
204
|
+
}
|
|
136
205
|
/** The top of a set of planes. */
|
|
137
206
|
const heightOf = (planes) => Math.max(...planes.flatMap((p) => [p.o[2], p.o[2] + p.u[2], p.o[2] + p.v[2], p.o[2] + p.u[2] + p.v[2]]));
|
|
138
207
|
/** The two points where a ray from `from` first enters a polygon and last leaves it (the polygon is a band round the middle, so a ray crosses it once), or `undefined` where it misses. */
|
package/dist/venues.d.ts
CHANGED
|
@@ -41,10 +41,18 @@ export interface RealVenueData {
|
|
|
41
41
|
lowerShare?: number;
|
|
42
42
|
read: string;
|
|
43
43
|
};
|
|
44
|
+
/** The building's lower band, a podium under the upper levels: its height in feet and how it is known (ours where the sources do not say). */
|
|
45
|
+
facade?: {
|
|
46
|
+
podium: number;
|
|
47
|
+
unit: "ft";
|
|
48
|
+
basis: VenueBasis;
|
|
49
|
+
read: string;
|
|
50
|
+
};
|
|
44
51
|
roof: {
|
|
45
52
|
kind: VenueRoof;
|
|
46
53
|
basis: VenueBasis;
|
|
47
|
-
read: string;
|
|
54
|
+
read: string; /** A long skylight over the middle of the roof, closed in round it: drawn where the venue says so (ours). */
|
|
55
|
+
skylight?: boolean;
|
|
48
56
|
};
|
|
49
57
|
}
|
|
50
58
|
/** What OpenStreetMap gave of a venue: ODbL 1.0 data, "(c) OpenStreetMap contributors". */
|
package/dist/venues.data.js
CHANGED
|
@@ -60,7 +60,8 @@ export const VENUE_DATA = [
|
|
|
60
60
|
"en": { "title": "Rogers Arena", "revision": 1379918849 },
|
|
61
61
|
"seats": { "hockey": 18871, "source": "wikipedia", "wikidata": 18422, "read": "the infobox's present figure for ice hockey (18,871, from 2018); Wikidata's 18,422 is the 1995 figure and the first the infobox lists" },
|
|
62
62
|
"tiers": { "count": 2, "basis": "plausible", "read": "no source says how many seating levels there are: two bowls are drawn; the article speaks of a lower bowl; OpenStreetMap maps four building levels, which are floors, not seating bowls" },
|
|
63
|
-
"roof": { "kind": "fixed", "basis": "plausible", "read": "an indoor arena: a fixed roof, as nothing says otherwise" },
|
|
63
|
+
"roof": { "kind": "fixed", "basis": "plausible", "read": "an indoor arena: a fixed roof, as nothing says otherwise; the long skylight over the middle of the roof, and the cap that closes the roof round it, are ours (the brief's)", "skylight": true },
|
|
64
|
+
"facade": { "podium": 38, "unit": "ft", "basis": "plausible", "read": "the brief: the stepped facade over the Pat Quinn Way front, a lower podium under the upper levels; its height is ours (the sources do not say)" },
|
|
64
65
|
},
|
|
65
66
|
{
|
|
66
67
|
"id": "t-mobile-arena",
|
package/dist/venues.js
CHANGED
|
@@ -209,7 +209,7 @@ function plan(venue, rink) {
|
|
|
209
209
|
rings,
|
|
210
210
|
off: { left: FIRST_ROW.end, right: FIRST_ROW.end, top: FIRST_ROW.side, bottom: FIRST_ROW.side + FIRST_ROW.bench },
|
|
211
211
|
reach: { left: Math.max(0, rink.x - fb.x0), right: Math.max(0, fb.x1 - rink.x - rink.w), top: Math.max(0, rink.y - fb.y0) + room, bottom: Math.max(0, fb.y1 - rink.y - rink.h) },
|
|
212
|
-
shell: { footprint, hall: { ...outer, x0: outer.x0 - HALL, y0: outer.y0 - HALL, x1: outer.x1 + HALL, y1: outer.y1 + HALL, r: outer.r + HALL }, ...(north === undefined ? {} : { north }), roof: venue.roof.kind, edge },
|
|
212
|
+
shell: { footprint, hall: { ...outer, x0: outer.x0 - HALL, y0: outer.y0 - HALL, x1: outer.x1 + HALL, y1: outer.y1 + HALL, r: outer.r + HALL }, ...(north === undefined ? {} : { north }), roof: venue.roof.kind, edge, ...(venue.facade === undefined ? {} : { podium: venue.facade.podium }), ...(venue.roof.skylight === true ? { skylight: true } : {}) },
|
|
213
213
|
};
|
|
214
214
|
return { venue, orientation, box: rink, footprint, bowl, seats: rings.map((ring) => ({ tier: ring.tier, seats: ring.seats })), total, seatArea, fit: tight ? "tight" : "fits" };
|
|
215
215
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The package's version: the same as package.json's, and a test holds them to each other. */
|
|
2
|
-
export declare const VERSION = "0.
|
|
2
|
+
export declare const VERSION = "0.43.0";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The package's version: the same as package.json's, and a test holds them to each other. */
|
|
2
|
-
export const VERSION = "0.
|
|
2
|
+
export const VERSION = "0.43.0";
|
package/dist/walk.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { LonLat } from "./venues.geo.ts";
|
|
2
|
+
import type { Pt } from "./crowd.ts";
|
|
3
|
+
/** What a district's mask is made from, as `walk.data.ts` holds it: lines (`[width in tenths of a metre, first point, steps...]`) and areas (rings, the first the outside, in whole quarter-metres). */
|
|
4
|
+
export interface WalkData {
|
|
5
|
+
/** The raw file the data was made from, and the day it was read and the time of OpenStreetMap's data. */
|
|
6
|
+
source: string;
|
|
7
|
+
read: string;
|
|
8
|
+
base: string;
|
|
9
|
+
licence: "ODbL-1.0";
|
|
10
|
+
attribution: string;
|
|
11
|
+
/** The venues the district was made for: the keys of `VENUES` and `STADIUMS` with the configuration, as a district names them. */
|
|
12
|
+
venues: readonly string[];
|
|
13
|
+
/** The `[longitude, latitude]` the metres are measured from. */
|
|
14
|
+
origin: LonLat;
|
|
15
|
+
/** The box the data covers, `[west, south, east, north]` in metres from the origin. */
|
|
16
|
+
box: readonly [number, number, number, number];
|
|
17
|
+
walkLines: readonly (readonly number[])[];
|
|
18
|
+
walkAreas: readonly (readonly (readonly number[])[])[];
|
|
19
|
+
blockLines: readonly (readonly number[])[];
|
|
20
|
+
blockAreas: readonly (readonly (readonly number[])[])[];
|
|
21
|
+
}
|
|
22
|
+
/** The side of a cell of the mask, in metres: half a metre, finer than the narrowest path and a person's width. */
|
|
23
|
+
export declare const WALK_CELL = 0.5;
|
|
24
|
+
/** The grid of a mask: `cells[row * width + column]` is 1 where a person may stand. Cell `(0, 0)` has its corner at `(x0, y0)` metres east and north of `origin`. */
|
|
25
|
+
export interface WalkMask {
|
|
26
|
+
id: string;
|
|
27
|
+
origin: LonLat;
|
|
28
|
+
cell: number;
|
|
29
|
+
x0: number;
|
|
30
|
+
y0: number;
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
cells: Uint8Array;
|
|
34
|
+
/** How many cells are walkable. */
|
|
35
|
+
walkable: number;
|
|
36
|
+
}
|
|
37
|
+
/** The districts there are masks for. */
|
|
38
|
+
export declare const WALK_IDS: readonly string[];
|
|
39
|
+
/** A path from its packed form: the first point, then the step to each next one, in metres. */
|
|
40
|
+
export declare function unpack(packed: readonly number[], from?: number): Pt[];
|
|
41
|
+
/** What a mask is given besides the data: rings in metres from the mask's origin that stop a crowd (the venues' own buildings), and rings whose surroundings are the venues' own ground. */
|
|
42
|
+
export interface WalkExtras {
|
|
43
|
+
/** The outline of each venue's building: stops a crowd, and a band `apron` metres wide round it is ground a crowd may stand on. */
|
|
44
|
+
buildings: readonly (readonly Pt[])[];
|
|
45
|
+
/** The width of the venue's own ground round its building, in metres. */
|
|
46
|
+
apron: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The mask of a district, rasterised from `WALK_DATA` (and kept for the next call): the walkable areas and the paths at their width, the apron round each venue, then the carriageways, cycle tracks, railways, water and buildings cut out
|
|
50
|
+
* of them, and the venues' own buildings last. A person stands in a cell with value 1, and nowhere else.
|
|
51
|
+
*/
|
|
52
|
+
export declare function walkMask(id: string, extras: WalkExtras): WalkMask;
|
|
53
|
+
/** Whether a point (metres east and north of the mask's origin) is in a walkable cell. */
|
|
54
|
+
export declare function walkable(mask: WalkMask, x: number, y: number): boolean;
|
|
55
|
+
/** The mask a set of venues stand on, if there is one: the first mask that names one of them (by id, whatever configuration). */
|
|
56
|
+
export declare const walkIdFor: (venueIds: readonly string[]) => string | undefined;
|