@chanmeng666/archlang-3d 0.0.0-stage → 0.1.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 +36 -0
- package/LICENSE +22 -0
- package/README.md +83 -2
- package/THIRD_PARTY_NOTICES +975 -0
- package/dist/browser.d.ts +29 -0
- package/dist/browser.js +249 -0
- package/dist/chunk-2WKSS3IA.js +495 -0
- package/dist/chunk-54YVSAVZ.js +54 -0
- package/dist/chunk-CTFMM64C.js +435 -0
- package/dist/chunk-IQJQDQSC.js +950 -0
- package/dist/chunk-NADV4D3M.js +857 -0
- package/dist/cli.js +686 -0
- package/dist/facts-DMBpeo-q.d.ts +29 -0
- package/dist/index.d.ts +475 -0
- package/dist/index.js +130 -0
- package/dist/node.d.ts +130 -0
- package/dist/node.js +60 -0
- package/dist/replay.d.ts +62 -0
- package/dist/scene3d.schema.json +578 -0
- package/dist/strip-BMxWrvYD.d.ts +433 -0
- package/dist/viewer.iife.js +4220 -0
- package/package.json +82 -4
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scene3D v0: a renderer-independent, plan-aligned 2.5D scene read off a resolved plan
|
|
3
|
+
* (archlang-3d plan §3.5, appendix A). Plan axes: x right, y DOWN; z up. Every length is an
|
|
4
|
+
* integer number of micrometres ({@link Um}); handedness is resolved only by exporters.
|
|
5
|
+
*
|
|
6
|
+
* Mirrored by `scene3d.schema.json` and checked by `validateScene3D`; a test holds the three
|
|
7
|
+
* together on the whole corpus.
|
|
8
|
+
*/
|
|
9
|
+
/** Integer micrometres (mm × 1000). */
|
|
10
|
+
type Um = number;
|
|
11
|
+
/** `[x, y]` in micrometres, plan axes. */
|
|
12
|
+
type Pt = [Um, Um];
|
|
13
|
+
/** A closed ring, no repeated last vertex. */
|
|
14
|
+
type Ring3 = Pt[];
|
|
15
|
+
interface Polygon {
|
|
16
|
+
outer: Ring3;
|
|
17
|
+
holes?: Ring3[];
|
|
18
|
+
}
|
|
19
|
+
type Provenance = "authored" | "derived" | "default" | "user-param";
|
|
20
|
+
/** The plan element a Scene3D item was read from. `span` is its byte span in the source. */
|
|
21
|
+
interface Source {
|
|
22
|
+
kind: string;
|
|
23
|
+
id: string;
|
|
24
|
+
span?: [number, number];
|
|
25
|
+
}
|
|
26
|
+
/** One entry of the assumption ledger: every value the plan did not state (ADR 0005). */
|
|
27
|
+
interface Assumption {
|
|
28
|
+
kind: string;
|
|
29
|
+
id?: string;
|
|
30
|
+
field: string;
|
|
31
|
+
value: unknown;
|
|
32
|
+
provenance: Provenance;
|
|
33
|
+
rule: string;
|
|
34
|
+
}
|
|
35
|
+
interface Meta {
|
|
36
|
+
name: string;
|
|
37
|
+
units: "mm";
|
|
38
|
+
tool: {
|
|
39
|
+
archlang3d: string;
|
|
40
|
+
archlang: string;
|
|
41
|
+
};
|
|
42
|
+
north?: "up" | "down" | "left" | "right" | number;
|
|
43
|
+
siteBoundary?: Ring3;
|
|
44
|
+
params?: Record<string, unknown>;
|
|
45
|
+
assumptions: Assumption[];
|
|
46
|
+
}
|
|
47
|
+
interface Floor {
|
|
48
|
+
id: string;
|
|
49
|
+
source: Source;
|
|
50
|
+
polygon: Polygon;
|
|
51
|
+
uses?: string[];
|
|
52
|
+
/** How far (µm) the floor finish is lifted because it overlaps an earlier room's (V-GEO-05,
|
|
53
|
+
* `W3D_FLOOR_OVERLAP`): 0.5 mm per step, absent when it overlaps none. */
|
|
54
|
+
lift?: Um;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A wall's OWNED region after the core's joinery (H1), one polygon per connected piece, with the
|
|
58
|
+
* openings NOT removed: each opening lists its cut, and the geometry stage removes it from every
|
|
59
|
+
* piece it covers, keeping the sill and lintel.
|
|
60
|
+
*/
|
|
61
|
+
interface Wall {
|
|
62
|
+
id: string;
|
|
63
|
+
source: Source;
|
|
64
|
+
category?: string;
|
|
65
|
+
material?: string;
|
|
66
|
+
footprint: Polygon[];
|
|
67
|
+
/** The same pieces with every opening's cut removed: the wall between each opening's sill and head. */
|
|
68
|
+
body: Polygon[];
|
|
69
|
+
height: Um;
|
|
70
|
+
thickness: Um;
|
|
71
|
+
/** Ids of the openings whose cut is hosted by this wall. */
|
|
72
|
+
cuts: string[];
|
|
73
|
+
}
|
|
74
|
+
type DoorKind = "hinged" | "sliding" | "barn" | "bifold" | "pocket" | "garage" | "double";
|
|
75
|
+
interface Opening {
|
|
76
|
+
id: string;
|
|
77
|
+
source: Source;
|
|
78
|
+
kind: "door" | "window" | "opening";
|
|
79
|
+
doorKind?: DoorKind;
|
|
80
|
+
/** The host wall's id. */
|
|
81
|
+
host: string;
|
|
82
|
+
/** The plan footprint the opening removes, from the core's `openingCut`. */
|
|
83
|
+
cut: Ring3;
|
|
84
|
+
centre: Pt;
|
|
85
|
+
/** The two jambs on the host's centreline (the opening's chord along the wall, its tangent on a curve). */
|
|
86
|
+
jambs: [Pt, Pt];
|
|
87
|
+
/** A door's swinging leaves, each `[hinge, far jamb, open tip]` from the core's `doorLeaves` (two
|
|
88
|
+
* for a `double` door): closed, the leaf runs hinge → far jamb; swung as the plan draws it (`--doors
|
|
89
|
+
* plan`), hinge → open tip, 90° on. Absent for a kind that sweeps no leaf (sliding, barn, bifold,
|
|
90
|
+
* pocket, garage). The writer always gives the tip; a pre-A7 Scene3D's 2-point leaf (no tip) still
|
|
91
|
+
* validates, and its door stays closed under `--doors plan`. */
|
|
92
|
+
leaves?: Array<[Pt, Pt] | [Pt, Pt, Pt]>;
|
|
93
|
+
width: Um;
|
|
94
|
+
sill: Um;
|
|
95
|
+
head: Um;
|
|
96
|
+
hinge?: "left" | "right";
|
|
97
|
+
swing?: "in" | "out";
|
|
98
|
+
slide?: "left" | "right";
|
|
99
|
+
}
|
|
100
|
+
interface Furniture {
|
|
101
|
+
id: string;
|
|
102
|
+
source: Source;
|
|
103
|
+
category: string;
|
|
104
|
+
room?: string;
|
|
105
|
+
centre: Pt;
|
|
106
|
+
/**
|
|
107
|
+
* The footprint ON THE PLAN, already turned: `w` along plan x, `d` along plan y, whatever the
|
|
108
|
+
* quarter-turn. An exporter places the box as is; `yawDeg` orients the asset INSIDE it (an
|
|
109
|
+
* asset's own width runs along plan y at ±90°). Never apply `yawDeg` to this box a second time.
|
|
110
|
+
*/
|
|
111
|
+
size: {
|
|
112
|
+
w: Um;
|
|
113
|
+
d: Um;
|
|
114
|
+
};
|
|
115
|
+
/** Rotation about the vertical axis in the exporters' convention: minus the plan's `rotate`. */
|
|
116
|
+
yawDeg: number;
|
|
117
|
+
/** What the mesh builds it with: `t0:<family>` (a parametric generator) or `greybox`. */
|
|
118
|
+
asset: string;
|
|
119
|
+
}
|
|
120
|
+
interface Box {
|
|
121
|
+
id: string;
|
|
122
|
+
source: Source;
|
|
123
|
+
at: Pt;
|
|
124
|
+
size: {
|
|
125
|
+
w: Um;
|
|
126
|
+
h: Um;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
interface Stair {
|
|
130
|
+
id: string;
|
|
131
|
+
source: Source;
|
|
132
|
+
box: Box;
|
|
133
|
+
dir: "up" | "down";
|
|
134
|
+
width: Um;
|
|
135
|
+
}
|
|
136
|
+
interface Outdoor {
|
|
137
|
+
id: string;
|
|
138
|
+
source: Source;
|
|
139
|
+
surface: string;
|
|
140
|
+
polygon: Polygon;
|
|
141
|
+
rail?: string[];
|
|
142
|
+
}
|
|
143
|
+
interface Fence {
|
|
144
|
+
id: string;
|
|
145
|
+
source: Source;
|
|
146
|
+
style: string;
|
|
147
|
+
points: Pt[];
|
|
148
|
+
closed: boolean;
|
|
149
|
+
}
|
|
150
|
+
interface Roof {
|
|
151
|
+
id: string;
|
|
152
|
+
source: Source;
|
|
153
|
+
form: "flat";
|
|
154
|
+
ring: Ring3;
|
|
155
|
+
provenance: Provenance;
|
|
156
|
+
}
|
|
157
|
+
interface Level {
|
|
158
|
+
level: number;
|
|
159
|
+
name?: string;
|
|
160
|
+
/** Top of this storey's floor above the lowest storey's floor. */
|
|
161
|
+
elevation: Um;
|
|
162
|
+
storeyHeight: Um;
|
|
163
|
+
/** The outer rings of the storey's joined wall solid: the building's wall footprint. */
|
|
164
|
+
footprint: Ring3[];
|
|
165
|
+
floors: Floor[];
|
|
166
|
+
walls: Wall[];
|
|
167
|
+
/**
|
|
168
|
+
* The storey's `status demolish` walls (B3a), read from the plan AS DRAWN (`ir.drawn`): joined
|
|
169
|
+
* among themselves only, never with the standing walls (whose ownership, H1, is the plan after
|
|
170
|
+
* the demolition), and hosting nothing (`cuts` empty). Drawn as a ghost, never as structure.
|
|
171
|
+
* Absent when the storey demolishes nothing.
|
|
172
|
+
*/
|
|
173
|
+
demolished?: Wall[];
|
|
174
|
+
openings: Opening[];
|
|
175
|
+
furniture: Furniture[];
|
|
176
|
+
stairs: Stair[];
|
|
177
|
+
voids: Box[];
|
|
178
|
+
columns: Box[];
|
|
179
|
+
outdoor: Outdoor[];
|
|
180
|
+
fences: Fence[];
|
|
181
|
+
roofs: Roof[];
|
|
182
|
+
}
|
|
183
|
+
interface Scene3D {
|
|
184
|
+
version: 0;
|
|
185
|
+
kind: "scene3d";
|
|
186
|
+
meta: Meta;
|
|
187
|
+
levels: Level[];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Mesh3D v0: the ONE triangulation the viewer and the GLB both read (archlang-3d amendment v0.7;
|
|
192
|
+
* principle 1 of the preview-and-remodel programme). Built from a Scene3D alone, deterministically:
|
|
193
|
+
* same Scene3D, same bytes.
|
|
194
|
+
*
|
|
195
|
+
* Axes are the exporters' (glTF): X = plan x, Y = up, Z = plan y, so a plan with y down becomes a
|
|
196
|
+
* right-handed, Y-up scene; the mapping is fixed here once (plan §3.4). Every coordinate is an
|
|
197
|
+
* integer number of micrometres. Triangles wind counter-clockwise seen from outside (outward
|
|
198
|
+
* normals), and every shell is closed.
|
|
199
|
+
*/
|
|
200
|
+
|
|
201
|
+
/** The authoring stage a node belongs to (the replay's order, decision D3). */
|
|
202
|
+
type Stage = "brief" | "rooms" | "walls" | "openings" | "fixtures" | "drafting";
|
|
203
|
+
/** One closed triangle shell: `positions` is flat `[x, y, z, …]` (µm), `indices` are triangles. */
|
|
204
|
+
interface Shell {
|
|
205
|
+
positions: number[];
|
|
206
|
+
indices: number[];
|
|
207
|
+
}
|
|
208
|
+
type NodeKind = "slab" | "floor" | "column" | "wall" | "door" | "window" | "opening" | "furniture" | "roof";
|
|
209
|
+
interface MeshNode {
|
|
210
|
+
/** `L<level>/<kind>:<id>[:<part>]`, unique in the mesh (plan §3.6). */
|
|
211
|
+
key: string;
|
|
212
|
+
level: number;
|
|
213
|
+
kind: NodeKind;
|
|
214
|
+
id: string;
|
|
215
|
+
part?: string;
|
|
216
|
+
stage: Stage;
|
|
217
|
+
/** Order inside its stage group when the replay raises it: source order. */
|
|
218
|
+
order: number;
|
|
219
|
+
/** Hidden by default in the viewer (the roof, decision D3). */
|
|
220
|
+
hidden?: boolean;
|
|
221
|
+
/** Facts carried for a consumer (category, host, door kind, provenance …). */
|
|
222
|
+
extras: Record<string, string | number | boolean>;
|
|
223
|
+
shells: Shell[];
|
|
224
|
+
}
|
|
225
|
+
interface Mesh3D {
|
|
226
|
+
version: 0;
|
|
227
|
+
kind: "mesh3d";
|
|
228
|
+
name: string;
|
|
229
|
+
/** The Scene3D ledger plus every default the mesh stage added. */
|
|
230
|
+
assumptions: Assumption[];
|
|
231
|
+
/** In canonical order: level, then kind, then id, then part. */
|
|
232
|
+
nodes: MeshNode[];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The replay as a pure function of time (card A3; archlang-3d plan §6.5; decision D3). The plan
|
|
237
|
+
* draws itself in its authoring order, then rises:
|
|
238
|
+
*
|
|
239
|
+
* 0.00–0.40 top-down: each node's footprint appears, flat, in stage order
|
|
240
|
+
* brief (slab) → rooms (floors) → walls (columns, exterior walls, the rest) →
|
|
241
|
+
* openings (doors, windows) → fixtures (catalogued fixtures, then loose furniture);
|
|
242
|
+
* source order inside a group;
|
|
243
|
+
* 0.40–0.55 the core's own drawing (its SVG) fades in over the footprints and holds;
|
|
244
|
+
* 0.55–1.00 the drawing fades out as the camera tilts to a 45° elevation with a narrow-lens
|
|
245
|
+
* dolly; walls rise in the same order, each opening with its host wall; fixtures and
|
|
246
|
+
* furniture rise after the walls; the roof stays hidden. The end frame is fitted to
|
|
247
|
+
* the building (`camera.ts`), so it fills the canvas.
|
|
248
|
+
*
|
|
249
|
+
* Views (owner's look notes round 1, D14). A plan of several storeys replays each storey on its
|
|
250
|
+
* own (`viewMesh(mesh, n)`: its nodes only, over its own page of the core's drawing) and the storeys
|
|
251
|
+
* combined (`"all"`, the default). In the combined view phase 1 draws the lowest storey under page
|
|
252
|
+
* 1, and the rise is cut into one slot per storey, lowest first: a storey's slab appears only when
|
|
253
|
+
* the storey below is fully up, furniture included.
|
|
254
|
+
*
|
|
255
|
+
* The combined view keeps the lower floors readable with EXPLODED STOREYS plus CAMERA STOPS, chosen
|
|
256
|
+
* by looking at rendered frames of two-storey and townhouse:
|
|
257
|
+
* - each storey is lifted `EXPLODE_GAP_MM` (3 m, about one storey) above the one below, and the
|
|
258
|
+
* end camera looks down at 45° (since card A9, so does a one-storey view), so the floor below
|
|
259
|
+
* shows through the gap;
|
|
260
|
+
* - the camera frames the storeys built so far: when storey k is fully up it fills the frame with
|
|
261
|
+
* storeys 1…k; the next storey's slot opens with a lead-in (`STOP_LEAD`) in which the camera
|
|
262
|
+
* pulls back and nothing new shows. So the ground floor fills the frame, furniture and all, and
|
|
263
|
+
* is seen whole from the wider framing before the storey above appears over it.
|
|
264
|
+
* Rendered and rejected: exploded storeys alone (no stops), which left the ground floor small and
|
|
265
|
+
* half covered at its only full view, the end frame; a 2.4 m gap at 42°, which hid more of it; and
|
|
266
|
+
* stops without a lead-in, where the upper slab appeared at once over the close-framed floor and
|
|
267
|
+
* filled the frame before the camera could pull back.
|
|
268
|
+
* Considered, not built: upper storeys fading (translucent walls over a furnished floor; neither
|
|
269
|
+
* storey reads cleanly) and a cutaway (it removes the storey the viewer just watched rise).
|
|
270
|
+
*
|
|
271
|
+
* A demolished wall's ghost (B3a; `part` "demolish") is NOT construction (decision, red-team round 1
|
|
272
|
+
* of card A2b): it takes no place in the build order. Its footprint appears in phase 1 with its
|
|
273
|
+
* storey's walls (at the time of the standing node drawn just before it) without taking a step of
|
|
274
|
+
* its own, and it rises, translucent, across its storey's whole wall slot [a, w] in one interval,
|
|
275
|
+
* never staggered among the walls. So every standing node's event (appear, rise, rank) is the one it
|
|
276
|
+
* has in the same plan with the `status demolish` lines deleted; ghosts rank after every standing
|
|
277
|
+
* node (the table stays in authoring order). The end camera frames the standing building only (`camera.ts`, `boxOfNodes`).
|
|
278
|
+
*
|
|
279
|
+
* Nothing here reads a clock or a random source: `stateAt(events, t)` is the whole state, so a
|
|
280
|
+
* frame at `t` is the same frame however it was reached (`__seek`, plan §6.5).
|
|
281
|
+
*/
|
|
282
|
+
|
|
283
|
+
declare const PHASE: {
|
|
284
|
+
/** Footprints have all appeared. */
|
|
285
|
+
readonly drawn: 0.4;
|
|
286
|
+
/** The core's drawing is fully over the footprints. */
|
|
287
|
+
readonly svgIn: 0.5;
|
|
288
|
+
/** The drawing starts to fade and the camera to tilt. */
|
|
289
|
+
readonly rise: 0.55;
|
|
290
|
+
/** The drawing is gone. */
|
|
291
|
+
readonly svgOut: 0.62;
|
|
292
|
+
/** The camera has finished tilting (the dolly continues). */
|
|
293
|
+
readonly tilted: 0.78;
|
|
294
|
+
/** Every wall has risen; fixtures rise from here. */
|
|
295
|
+
readonly wallsUp: 0.84;
|
|
296
|
+
/** Everything has risen. */
|
|
297
|
+
readonly done: 0.96;
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Catalogued wet-room and kitchen fixtures: they rise before loose furniture (D3). A replay
|
|
301
|
+
* grouping only; the core's catalogue is the authority for what a family is.
|
|
302
|
+
*/
|
|
303
|
+
declare const FIXTURE_FAMILIES: ReadonlySet<string>;
|
|
304
|
+
/** One node's place in the replay. Times are fractions of the replay, 0…1. */
|
|
305
|
+
interface ReplayEvent {
|
|
306
|
+
key: string;
|
|
307
|
+
stage: Stage;
|
|
308
|
+
/** Position in the authoring order (0-based), the order footprints appear in. */
|
|
309
|
+
rank: number;
|
|
310
|
+
/** When its footprint appears (phase 1). */
|
|
311
|
+
appear: number;
|
|
312
|
+
/** When it starts and finishes rising; equal for a node that is flat from the start. */
|
|
313
|
+
riseFrom: number;
|
|
314
|
+
riseTo: number;
|
|
315
|
+
hidden: boolean;
|
|
316
|
+
/**
|
|
317
|
+
* The node's storey, 0-based from the lowest; present only when the replay has more than one
|
|
318
|
+
* storey (the combined view), where it sets the camera's stops (`stateAt`).
|
|
319
|
+
*/
|
|
320
|
+
storey?: number;
|
|
321
|
+
}
|
|
322
|
+
/** The authoring order of the mesh's nodes: stage, sub-group, storey, source order, key. */
|
|
323
|
+
declare function authoringOrder(mesh: Mesh3D): MeshNode[];
|
|
324
|
+
/** The storeys the replay can show on their own: the visible nodes' levels, ascending. */
|
|
325
|
+
declare function storeysOf(mesh: Mesh3D): number[];
|
|
326
|
+
/** Which replay: the storeys combined (`"all"`), or storey `n` on its own (1-based, ascending). */
|
|
327
|
+
type ReplayView = "all" | number;
|
|
328
|
+
/** The label a view carries in reports: `all` or `storey:<n>`. */
|
|
329
|
+
declare const viewLabel: (v: ReplayView) => string;
|
|
330
|
+
/**
|
|
331
|
+
* The mesh a view replays. The combined view is the whole mesh; storey `n` is that storey's nodes
|
|
332
|
+
* alone (every other storey is absent, not hidden). A one-storey plan's two views are the same mesh,
|
|
333
|
+
* so they replay byte for byte the same.
|
|
334
|
+
*/
|
|
335
|
+
declare function viewMesh(mesh: Mesh3D, view: ReplayView): Mesh3D;
|
|
336
|
+
/**
|
|
337
|
+
* The combined view's exploded storeys: how far (mm) each storey is lifted above where it stands, so
|
|
338
|
+
* a gap opens between it and the storey below (see the header). Storey `i` (0-based) is lifted
|
|
339
|
+
* `i × EXPLODE_GAP_MM`; a one-storey mesh lifts nothing.
|
|
340
|
+
*/
|
|
341
|
+
declare const EXPLODE_GAP_MM = 3000;
|
|
342
|
+
declare function explodeLifts(mesh: Mesh3D): Map<number, number>;
|
|
343
|
+
/**
|
|
344
|
+
* The combined view: the share of an upper storey's slot spent on its lead-in, in which the camera
|
|
345
|
+
* pulls back from the finished storey below before anything of the new storey shows.
|
|
346
|
+
*/
|
|
347
|
+
declare const STOP_LEAD = 0.35;
|
|
348
|
+
/**
|
|
349
|
+
* The replay's event table: every node, when it appears and when it rises.
|
|
350
|
+
*
|
|
351
|
+
* Phase 1 draws the LOWEST storey only: it is the storey the drawing that fades in shows (page 1 of
|
|
352
|
+
* the core's drawing, or the storey's own page in a storey view), so the footprints and the drawing
|
|
353
|
+
* are the same plan. The rise is then cut into one slot per storey, lowest first: a storey's slab
|
|
354
|
+
* and floors appear as its slot opens, its walls rise (each opening with its host wall), then its
|
|
355
|
+
* fixtures and furniture, and the slot closes when the last of them is up. A storey above therefore
|
|
356
|
+
* starts only once the storey below is fully up. A one-storey mesh has one slot: the whole rise.
|
|
357
|
+
*/
|
|
358
|
+
declare function timeline(mesh: Mesh3D): ReplayEvent[];
|
|
359
|
+
/** Smoothstep easing, written out (no animation library). */
|
|
360
|
+
declare const ease: (x: number) => number;
|
|
361
|
+
interface NodeState {
|
|
362
|
+
visible: boolean;
|
|
363
|
+
/** Vertical scale, 0…1 (a footprint is drawn at a hair above 0). */
|
|
364
|
+
rise: number;
|
|
365
|
+
}
|
|
366
|
+
interface ReplayState {
|
|
367
|
+
/** 0 = straight down, 1 = the final perspective (`endElevation`). */
|
|
368
|
+
tilt: number;
|
|
369
|
+
/** 0…1 along the dolly (to the first camera stop). */
|
|
370
|
+
dolly: number;
|
|
371
|
+
/**
|
|
372
|
+
* The combined view's camera stop, 0…storeys − 1: at k the camera frames storeys 0…k; between
|
|
373
|
+
* stops it moves from one framing to the next. Always 0 for one storey.
|
|
374
|
+
*/
|
|
375
|
+
stop: number;
|
|
376
|
+
/** Opacity of the core's drawing over the scene. */
|
|
377
|
+
svg: number;
|
|
378
|
+
nodes: Map<string, NodeState>;
|
|
379
|
+
}
|
|
380
|
+
/** The whole state of the replay at `t` (0…1): a pure function of `t` and the event table. */
|
|
381
|
+
declare function stateAt(events: readonly ReplayEvent[], t: number): ReplayState;
|
|
382
|
+
/**
|
|
383
|
+
* The key frames: when each stage first shows, the drawing, the tilt, then (combined view only)
|
|
384
|
+
* each upper storey's first footprint (`storey:<n>`) and each camera stop (`stop:<n>`, storey n
|
|
385
|
+
* fully up; n is 1-based), and the end.
|
|
386
|
+
*/
|
|
387
|
+
declare function keyFrames(events: readonly ReplayEvent[]): Array<{
|
|
388
|
+
label: string;
|
|
389
|
+
t: number;
|
|
390
|
+
}>;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* The replay's metrics strip (card G4): a line of plain facts under the picture, each shown when
|
|
394
|
+
* the replay reaches the stage that draws it. Browser-safe and free of the core: the facts come in
|
|
395
|
+
* as numbers (`facts.ts` reads them from the core's `describe()` and `lint()` for the same
|
|
396
|
+
* source) and the strip is a pure function of `t` (`stripAt`), like every frame.
|
|
397
|
+
*
|
|
398
|
+
* The strip is a DOM layer over the canvas, never part of it: the canvas's pixels (and so the
|
|
399
|
+
* key-frame hashes, `__frameHash`) are the same with and without it. Text depends on installed
|
|
400
|
+
* fonts, which is why the hashed frames have none (`e2e/fixtures/README.md`).
|
|
401
|
+
*
|
|
402
|
+
* Wording is plain counts and areas, each area saying which convention it uses. It claims nothing
|
|
403
|
+
* about the plan being good, compliant or checked: a warnings count is a count of what `lint()`
|
|
404
|
+
* reported, nothing more.
|
|
405
|
+
*/
|
|
406
|
+
|
|
407
|
+
/** What the strip says. Areas are m²; `areaNet` is absent where the core cannot give it. */
|
|
408
|
+
interface ReplayFacts {
|
|
409
|
+
/** The storeys the combined view shows; absent in a single-storey view (nothing to count). */
|
|
410
|
+
storeys?: number;
|
|
411
|
+
rooms: number;
|
|
412
|
+
doors: number;
|
|
413
|
+
windows: number;
|
|
414
|
+
/** Floor area measured to the wall centre lines (the core's `floor_area_m2`). */
|
|
415
|
+
areaCentre: number;
|
|
416
|
+
/** Floor area net of the wall solids (the core's `net_floor_area_m2`). */
|
|
417
|
+
areaNet?: number;
|
|
418
|
+
/** The number of warnings `lint()` reports for the plan. */
|
|
419
|
+
warnings: number;
|
|
420
|
+
}
|
|
421
|
+
interface StripItem {
|
|
422
|
+
id: "storeys" | "rooms" | "area-net" | "area-centre" | "doors" | "windows" | "warnings";
|
|
423
|
+
text: string;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* The items showing at replay time `t`, in a fixed order: storeys (from the start), rooms and
|
|
427
|
+
* areas (when the first floor appears), doors and windows (when the first opening appears),
|
|
428
|
+
* warnings (when the core's drawing is fully over the plan). A pure function of `facts`, the event
|
|
429
|
+
* table and `t`.
|
|
430
|
+
*/
|
|
431
|
+
declare function stripAt(facts: ReplayFacts, events: readonly ReplayEvent[], t: number): StripItem[];
|
|
432
|
+
|
|
433
|
+
export { type Assumption as A, stateAt as B, storeysOf as C, type DoorKind as D, EXPLODE_GAP_MM as E, type Floor as F, timeline as G, viewLabel as H, viewMesh as I, type Level as L, type Mesh3D as M, type NodeKind as N, type Opening as O, type Polygon as P, type ReplayFacts as R, type StripItem as S, type Um as U, type Wall as W, type Scene3D as a, type Pt as b, type Shell as c, type Ring3 as d, type Furniture as e, type ReplayEvent as f, type ReplayState as g, FIXTURE_FAMILIES as h, type Fence as i, type MeshNode as j, type Meta as k, type NodeState as l, type Outdoor as m, PHASE as n, type Provenance as o, type ReplayView as p, type Roof as q, STOP_LEAD as r, stripAt as s, type Source as t, type Stage as u, type Stair as v, authoringOrder as w, ease as x, explodeLifts as y, keyFrames as z };
|