@chanmeng666/archlang-3d 0.6.0 → 0.8.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/dist/node.d.ts CHANGED
@@ -1,9 +1,7 @@
1
1
  import { World } from '@chanmeng666/archlang';
2
- import { M as Mesh3D, J as ReplayEvent, x as MeshNode, a as Scene3D, c as Shell } from './strip-CA-IAT0N.js';
3
- export { R as ReplayFacts, S as StripItem, s as stripAt } from './strip-CA-IAT0N.js';
4
- import { ReplayOptions } from './replay.js';
5
- export { PREVIEW_ABOUT_URL, PREVIEW_LABEL, PREVIEW_LEAD, PREVIEW_LIMITS, replayPayload, viewBoxOf } from './replay.js';
6
- export { F as FactsOptions, r as replayFacts } from './facts-Dje5wcHh.js';
2
+ import { f as ReplayOptions, M as Mesh3D, a3 as ReplayEvent, X as MeshNode, g as Scene3D, j as Shell } from './payload-DwiB2P7x.js';
3
+ export { P as PREVIEW_ABOUT_URL, a as PREVIEW_LABEL, b as PREVIEW_LEAD, c as PREVIEW_LIMITS, d as ReplayFacts, S as StripItem, r as replayPayload, s as stripAt, v as viewBoxOf } from './payload-DwiB2P7x.js';
4
+ export { F as FactsOptions, r as replayFacts } from './facts-CsO0xtFw.js';
7
5
 
8
6
  /**
9
7
  * A World that reads an `import`ed module relative to `baseDir` (the plan's own directory). It is
@@ -16,10 +14,28 @@ export { F as FactsOptions, r as replayFacts } from './facts-Dje5wcHh.js';
16
14
  */
17
15
  declare function makeNodeWorld(baseDir: string, root?: string): World;
18
16
 
17
+ /**
18
+ * One of the package's own warnings (`adaptPlan(...).warnings`) as the page shows it: the code and
19
+ * the warning's own `message`, verbatim (card RM8.10; never a second copy of the words).
20
+ */
21
+ interface ReplayNotice {
22
+ code: string;
23
+ message: string;
24
+ /** The warning's storey, set in the combined view of a plan of several storeys: written as `L2 ·` first. */
25
+ level?: number;
26
+ }
27
+ interface ReplayHtmlOptions extends ReplayOptions {
28
+ /**
29
+ * Warnings of the shown view, written under the replay as plain text (visible without the
30
+ * script). Not part of the payload: the frames, the event table and the key frames are the same
31
+ * with or without them. Absent or empty: nothing is written and the file is byte-identical.
32
+ */
33
+ notices?: readonly ReplayNotice[];
34
+ }
19
35
  /** The viewer and the parts of three.js it uses, as one minified browser script (read once). */
20
36
  declare function viewerScript(): Promise<string>;
21
37
  /** A replay of `mesh` as one self-contained HTML document. */
22
- declare function replayHtml(mesh: Mesh3D, opts: ReplayOptions): Promise<string>;
38
+ declare function replayHtml(mesh: Mesh3D, opts: ReplayHtmlOptions): Promise<string>;
23
39
 
24
40
  /** The flags that make Chromium render WebGL in software, the same on every machine (plan §6.5). */
25
41
  declare const SWIFTSHADER_ARGS: string[];
@@ -145,4 +161,4 @@ declare function checkValidator(glb: Uint8Array): Promise<CheckResult>;
145
161
  /** Every check a GLB alone allows (`archlang3d check model.glb`); given its Mesh3D, the node sets are compared. */
146
162
  declare function checkGlb(glb: Uint8Array, mesh?: Mesh3D): Promise<CheckResult[]>;
147
163
 
148
- export { type CheckId, type CheckResult, GLB_GENERATOR, type GlbNode, type KeyFrame, ReplayOptions, SWIFTSHADER_ARGS, type VideoOptions, type VideoReport, bodyMaterialName, checkGlb, checkNaming, checkScene, checkShells, checkValidator, glbJson, glbLeaks, glbNodeName, levelNodeName, makeNodeWorld, nodeExtras, openEdges, readGlbNodes, renderReplay, replayHtml, signedVolume, viewerScript, writeGlb };
164
+ export { type CheckId, type CheckResult, GLB_GENERATOR, type GlbNode, type KeyFrame, type ReplayHtmlOptions, type ReplayNotice, ReplayOptions, SWIFTSHADER_ARGS, type VideoOptions, type VideoReport, bodyMaterialName, checkGlb, checkNaming, checkScene, checkShells, checkValidator, glbJson, glbLeaks, glbNodeName, levelNodeName, makeNodeWorld, nodeExtras, openEdges, readGlbNodes, renderReplay, replayHtml, signedVolume, viewerScript, writeGlb };
package/dist/node.js CHANGED
@@ -20,10 +20,10 @@ import {
20
20
  signedVolume,
21
21
  viewerScript,
22
22
  writeGlb
23
- } from "./chunk-LMFD5NP4.js";
23
+ } from "./chunk-MCASL4MM.js";
24
24
  import {
25
25
  replayFacts
26
- } from "./chunk-6WCS4TAT.js";
26
+ } from "./chunk-B4PZWWSP.js";
27
27
  import {
28
28
  PREVIEW_ABOUT_URL,
29
29
  PREVIEW_LABEL,
@@ -31,10 +31,10 @@ import {
31
31
  PREVIEW_LIMITS,
32
32
  replayPayload,
33
33
  viewBoxOf
34
- } from "./chunk-CX6IVI7I.js";
34
+ } from "./chunk-VMVKI2WQ.js";
35
35
  import {
36
36
  stripAt
37
- } from "./chunk-TNNJ7CAO.js";
37
+ } from "./chunk-LNIVDMPG.js";
38
38
  export {
39
39
  GLB_GENERATOR,
40
40
  PREVIEW_ABOUT_URL,
@@ -1,4 +1,4 @@
1
- import { RFence, ROutdoor } from '@chanmeng666/archlang';
1
+ import { RFence, RRoom, ROutdoor } from '@chanmeng666/archlang';
2
2
 
3
3
  /**
4
4
  * Material slots (visual-assets card V1): the ONE palette both the GLB writer (`glb/write.ts`) and
@@ -32,6 +32,9 @@ declare const PALETTE: Readonly<Record<Exclude<MaterialSlot, "body">, SlotMateri
32
32
  /** The slot a stair is built in (card X3): oak treads. The core gives a stair no material, so
33
33
  * this is a drafting default, ledgered (`stair-material-default`). */
34
34
  declare const STAIR_MATERIAL = "wood";
35
+ /** The slot a stair's handrails, balusters and newels are built in (card RM8.6): walnut, so the
36
+ * balustrade reads against the oak treads. A drafting default, ledgered (`stair-rail-material-default`). */
37
+ declare const STAIR_RAIL_MATERIAL = "wood_dark";
35
38
  /**
36
39
  * The building's own materials (visual-assets V9), by Mesh3D kind, and `<kind>:<part>` where a
37
40
  * part differs (a window's frame and glass, a demolished wall's ghost): the light replay's colours
@@ -46,24 +49,88 @@ declare const KIND_PALETTE: {
46
49
  readonly door: SlotMaterial;
47
50
  readonly "window:frame": SlotMaterial;
48
51
  readonly "window:glass": SlotMaterial;
52
+ readonly "window:reveal": SlotMaterial;
53
+ readonly "window:sill": SlotMaterial;
54
+ readonly "window:board": SlotMaterial;
55
+ readonly "opening:lining": SlotMaterial;
56
+ readonly "opening:casing": SlotMaterial;
49
57
  readonly opening: SlotMaterial;
50
58
  readonly furniture: SlotMaterial;
51
59
  readonly roof: SlotMaterial;
52
60
  readonly "wall:demolish": SlotMaterial;
53
61
  readonly stair: SlotMaterial;
62
+ readonly "stair:rail": SlotMaterial;
54
63
  };
55
64
  type KindMaterial = keyof typeof KIND_PALETTE;
65
+ /**
66
+ * What each trim part (card RM8.6) is built in, as the ledger records it (`trim-material-default`,
67
+ * review m1 on PR #729): the material its node is written in (`KIND_PALETTE` entry) and that
68
+ * entry's colour. A door's lining and casing are its leaf's oak.
69
+ */
70
+ declare const TRIM_MATERIAL: {
71
+ readonly "door:lining": {
72
+ readonly material: "door";
73
+ readonly srgb: string;
74
+ };
75
+ readonly "door:casing": {
76
+ readonly material: "door";
77
+ readonly srgb: string;
78
+ };
79
+ readonly "opening:lining": {
80
+ readonly material: "opening:lining";
81
+ readonly srgb: string;
82
+ };
83
+ readonly "opening:casing": {
84
+ readonly material: "opening:casing";
85
+ readonly srgb: string;
86
+ };
87
+ readonly "window:reveal": {
88
+ readonly material: "window:reveal";
89
+ readonly srgb: string;
90
+ };
91
+ readonly "window:sill": {
92
+ readonly material: "window:sill";
93
+ readonly srgb: string;
94
+ };
95
+ readonly "window:board": {
96
+ readonly material: "window:board";
97
+ readonly srgb: string;
98
+ };
99
+ };
56
100
  /**
57
101
  * The replay's colour for a wall's cut top (its cap, the faces at its full height): the poché of a
58
102
  * plan, read as the section through a model whose roof is lifted off. A display convention of the
59
103
  * viewer, not a material: the GLB has no cap.
60
104
  */
61
105
  declare const WALL_CAP_SRGB = "#8f877d";
62
- /** The floor finishes a room's floor is laid in (visual-assets V9): colour only, no texture. */
63
- declare const FLOOR_FINISHES: readonly ["timber", "tile", "neutral"];
106
+ /**
107
+ * The floor finishes a room's floor is laid in (visual-assets V9): colour only, no texture. The first
108
+ * three are the ones {@link FLOOR_FINISH_RULES} chooses from; the rest are laid only where the plan's
109
+ * author wrote the word (`room … floor <word>`, card RM8.7, {@link FLOOR_WORD_FINISH}). Appended, so a
110
+ * GLB's `floor:<finish>` materials keep their names and order.
111
+ */
112
+ declare const FLOOR_FINISHES: readonly ["timber", "tile", "neutral", "carpeting", "stone", "deck", "paving", "concrete"];
64
113
  type FloorFinish = (typeof FLOOR_FINISHES)[number];
65
- /** Light oak boards, pale stone tile, and the neutral finish a room whose use is unknown keeps. */
114
+ /**
115
+ * Light oak boards, pale stone tile, and the neutral finish a room whose use is unknown keeps; then
116
+ * the authored words (card RM8.7, design `docs/plans/product-roadmap/design/visual-language.md` §3.4):
117
+ * fitted carpet in the palette's wool and a stone floor in its stone (the materials the `rendered`
118
+ * drawing washes those floors in, V-D2), a timber deck in its oak (as an `outdoor deck`'s), paving in
119
+ * the colour an `outdoor paving` is built in (the default theme's `paving` tint laid on
120
+ * `GROUND_WASH` times; written out here so this module, which the viewer bundles, keeps reading no
121
+ * core value, and `test/finish.test.ts` holds it to `groundColour("paving")`), and a polished
122
+ * concrete grey of its own.
123
+ */
66
124
  declare const FINISH_PALETTE: Readonly<Record<FloorFinish, SlotMaterial>>;
125
+ /**
126
+ * The finish an authored `floor` word lays (card RM8.7): the plan says what the floor is, so the
127
+ * default by `uses` ({@link floorFinish}) is not consulted and nothing is ledgered for it. Keyed by
128
+ * the core's own `RRoom["floor"]`, so a word the core adds fails the typecheck here. The words are
129
+ * read off the public `RRoom` (ADR 0031's seam, `scene3d/build.ts`), never from a label.
130
+ */
131
+ declare const FLOOR_WORD_FINISH: Readonly<Record<NonNullable<RRoom["floor"]>, FloorFinish>>;
132
+ /** The finish an authored `floor` word lays, or `undefined` for a word this package does not know. */
133
+ declare function wordFinish(word: string | undefined): FloorFinish | undefined;
67
134
  /**
68
135
  * A room's floor finish from its declared `uses` (the core's use kinds, read off the plan by
69
136
  * `adaptPlan`), first rule that names one of them: a wet room is tiled whatever else it is (`bath
@@ -93,20 +160,23 @@ declare const GROUND_TINT: Readonly<Record<ROutdoor["surface"], GroundTint>>;
93
160
  */
94
161
  declare const GROUND_WASH = 6;
95
162
  /**
96
- * The site's own materials, which no fixture is made of: a light gravel and a tarmac drive. Apart
97
- * from `PALETTE` on purpose: `PALETTE`'s keys are the material slots, which equal the core's
98
- * `FIXTURE_MATERIALS` (`test/material-vocabulary.test.ts`), and a ground is no fixture's material.
163
+ * The site's own materials, which no fixture is made of: a light gravel, a tarmac drive and a pale
164
+ * sand (card RM8.7). Apart from `PALETTE` on purpose: `PALETTE`'s keys are the material slots, which
165
+ * equal the core's `FIXTURE_MATERIALS` (`test/material-vocabulary.test.ts`), and a ground is no
166
+ * fixture's material.
99
167
  */
100
168
  declare const SITE_PALETTE: {
101
169
  readonly gravel: SlotMaterial;
102
170
  readonly tarmac: SlotMaterial;
171
+ readonly sand: SlotMaterial;
103
172
  };
104
173
  /**
105
174
  * The kinds the 3D preview tells apart where the drawing does it by hatch alone (one `paving` tint
106
- * covers six kinds, one `lawn` tint two; with no hatch they would be one colour): a planted bed in the
107
- * palette's foliage, a timber deck in its oak, gravel and a tarmac drive in their own greys. Every
108
- * other kind keeps its theme colour; a patio is paving in the core's own words and a balcony a plain
109
- * slab. Ledgered per kind (`outdoor-colour-3d`).
175
+ * covers eight kinds, one `lawn` tint two; with no hatch they would be one colour): a planted bed in
176
+ * the palette's foliage, a timber deck in its oak, gravel and a tarmac drive in their own greys, sand
177
+ * in its own pale buff and bare soil in the palette's soil (the earth of a sandpit or a planter, card
178
+ * RM8.7). Every other kind keeps its theme colour; a patio is paving in the core's own words and a
179
+ * balcony a plain slab. Ledgered per kind (`outdoor-colour-3d`).
110
180
  */
111
181
  declare const GROUND_SPLITS: Readonly<Partial<Record<ROutdoor["surface"], SlotMaterial>>>;
112
182
  /** The GLB roughness of a ground surface in its theme colour, by tint (the viewer reads none). */
@@ -130,6 +200,56 @@ declare const GROUND_PLANE: {
130
200
  readonly dark: "#16293d";
131
201
  readonly marginMm: 6000;
132
202
  };
203
+ /**
204
+ * The soft contact shadows the replay draws (product-roadmap card RM8.8, design
205
+ * `docs/plans/product-roadmap/design/visual-language.md` §1): flat translucent black bands, baked
206
+ * once from the geometry (`replay/shadows.ts`), never a shadow map. In the viewer only, never in
207
+ * the Mesh3D's nodes or the GLB (a file's reader lights it their own way); ledgered in every Mesh3D
208
+ * (`contact-shadows-viewer-only`) as the ground plane is.
209
+ *
210
+ * Band widths, mm, each `clamp(round(of × size), min, max)`: along the foot of the walls and columns
211
+ * (`size` the wall's thickness; a column's smaller side), the same width up each inside corner,
212
+ * round each standing piece of furniture (`size` the smaller side of its footprint), along each
213
+ * fence run (`size` its style's post) and round each stair's stringers (`stairThicknessMm` taken as
214
+ * the thickness). `alpha` is each band's opacity at its inner edge (0 at its outer edge) under the
215
+ * light theme, `alphaDark` under the dark one (half as much again: the same black reads fainter on a
216
+ * dark ground). Bands lie `liftMm` above the surface they fall on.
217
+ */
218
+ declare const CONTACT_SHADOW: {
219
+ readonly wall: {
220
+ readonly of: 0.75;
221
+ readonly minMm: 80;
222
+ readonly maxMm: 200;
223
+ };
224
+ readonly furniture: {
225
+ readonly of: 0.12;
226
+ readonly minMm: 30;
227
+ readonly maxMm: 120;
228
+ };
229
+ readonly fence: {
230
+ readonly of: 1.5;
231
+ readonly minMm: 40;
232
+ readonly maxMm: 120;
233
+ };
234
+ readonly stairThicknessMm: 100;
235
+ readonly alpha: {
236
+ readonly floor: 0.2;
237
+ readonly corner: 0.12;
238
+ readonly furniture: 0.18;
239
+ };
240
+ readonly alphaDark: {
241
+ readonly floor: 0.3;
242
+ readonly corner: 0.18;
243
+ readonly furniture: 0.27;
244
+ };
245
+ readonly liftMm: 1;
246
+ };
247
+ /** A contact band's width (mm) for a caster of `size` mm: `CONTACT_SHADOW`'s rule for its class. */
248
+ declare function contactBandMm(rule: {
249
+ of: number;
250
+ minMm: number;
251
+ maxMm: number;
252
+ }, size: number): number;
133
253
  /**
134
254
  * An `outdoor` or `fence` colour under a replay theme: its own on the light theme; on the dark one,
135
255
  * 60% of the way to `toward` (the theme's floor colour), the arithmetic of `slotColour`.
@@ -207,6 +327,9 @@ interface Floor {
207
327
  source: Source;
208
328
  polygon: Polygon;
209
329
  uses?: string[];
330
+ /** The room's authored `room … floor <word>` (the core's `RRoom.floor`, card RM8.7), absent when
331
+ * the plan wrote none: the finish the floor is laid in, before any default by `uses`. */
332
+ pattern?: string;
210
333
  /** How far (µm) the floor finish is lifted because it overlaps an earlier room's (V-GEO-05,
211
334
  * `W3D_FLOOR_OVERLAP`): 0.5 mm per step, absent when it overlaps none. */
212
335
  lift?: Um;
@@ -314,6 +437,14 @@ interface StairLanding {
314
437
  w: Um;
315
438
  h: Um;
316
439
  };
440
+ /**
441
+ * A `winders <n>` landing (core 1.58.0, card RM1.2g): its `n` tapered treads in climbing order,
442
+ * each its plan ring, cut out of the landing by the `n - 1` lines the core's own drawing draws
443
+ * across it (`winderTreads`), never re-derived. Each is one riser above the last, so the stair climbs
444
+ * `n - 1` more risers than on a level landing, as the plan's `W_STAIR_RISER_TOO_HIGH` counts them.
445
+ * Absent on a level landing.
446
+ */
447
+ winders?: Pt[][];
317
448
  }
318
449
  interface Stair {
319
450
  id: string;
@@ -655,4 +786,137 @@ interface StripItem {
655
786
  */
656
787
  declare function stripAt(facts: ReplayFacts, events: readonly ReplayEvent[], t: number): StripItem[];
657
788
 
658
- export { type Stage as $, type Assumption as A, type Outdoor as B, PALETTE as C, type DoorKind as D, EXPLODE_GAP_MM as E, type Floor as F, type GroundTint as G, PHASE as H, type Provenance as I, type ReplayEvent as J, KIND_PALETTE as K, type Level as L, type Mesh3D as M, type NodeKind as N, type Opening as O, type Polygon as P, type ReplayState as Q, type ReplayFacts as R, type StripItem as S, type ReplayView as T, type Roof as U, SITE_PALETTE as V, STAIR_MATERIAL as W, STOP_LEAD as X, type Side as Y, type SlotMaterial as Z, type Source as _, type Scene3D as a, type StairLanding as a0, type Um as a1, WALL_CAP_SRGB as a2, type Wall as a3, authoringOrder as a4, ease as a5, explodeLifts as a6, finishColour as a7, floorFinish as a8, keyFrames as a9, linearRgb as aa, siteColour as ab, slotColour as ac, slotGroups as ad, stateAt as ae, storeysOf as af, timeline as ag, viewLabel as ah, viewMesh as ai, type Pt as b, type Shell as c, type Ring3 as d, type StairFlight as e, type Stair as f, type MaterialSlot as g, type Furniture as h, type Fence as i, FENCE_PALETTE as j, FINISH_PALETTE as k, FIXTURE_FAMILIES as l, FLOOR_FINISHES as m, FLOOR_FINISH_RULES as n, type FloorFinish as o, GROUND_PLANE as p, GROUND_ROUGHNESS as q, GROUND_SPLITS as r, stripAt as s, GROUND_TINT as t, GROUND_WASH as u, type KindMaterial as v, MATERIAL_SLOTS as w, type MeshNode as x, type Meta as y, type NodeState as z };
789
+ /**
790
+ * The replay's data (card A3), browser-safe: `replayPayload(mesh, opts)` is what a replay carries
791
+ * for `mesh`, whether the single-file HTML inlines it (`html.ts`, Node) or the playground's 3D
792
+ * preview tab builds it in the browser (card A5) and mounts it with `mountReplay`.
793
+ */
794
+
795
+ interface ReplayNode {
796
+ key: string;
797
+ kind: string;
798
+ part?: string;
799
+ /**
800
+ * The combined view's exploded storeys: how far (mm) the node is lifted while the storeys rise;
801
+ * absent = 0. It settles to 0 by the end (`settledLift`).
802
+ */
803
+ lift?: number;
804
+ /** Flat `[x, y, z, …]` in micrometres, exporters' axes (X plan x, Y up, Z plan y). */
805
+ positions: number[];
806
+ indices: number[];
807
+ /**
808
+ * A T0 piece's material slots (visual-assets V1): consecutive runs of `indices`, in order, each
809
+ * drawn in its slot's colour (`materials.ts`; `body` is the kind's own). Absent on every node
810
+ * without a slotted shell, which is then drawn exactly as before.
811
+ */
812
+ groups?: Array<{
813
+ slot: MaterialSlot;
814
+ count: number;
815
+ }>;
816
+ /** A floor's finish (visual-assets V9, `extras.finish`), drawn in its colour; absent on every other node. */
817
+ finish?: FloorFinish;
818
+ /**
819
+ * An outdoor surface's or a fence's colour (card RM8.3, `extras.colour`, sRGB `#rrggbb`), the one
820
+ * the GLB writes too; absent on every other node.
821
+ */
822
+ colour?: string;
823
+ /**
824
+ * The width (mm) of the contact shadow the node casts (card RM8.8, `CONTACT_SHADOW`,
825
+ * `shadows.ts`): on a standing wall and a column, a standing piece of furniture, a fence and a
826
+ * stair's stringers. Absent on every node that casts none (a hung piece, a flat one, a door …).
827
+ */
828
+ band?: number;
829
+ /**
830
+ * A standing piece of furniture lower than its band would be (a rug): it casts no contact shadow
831
+ * and its top receives the others' (card RM8.8). Absent on every other node.
832
+ */
833
+ flat?: true;
834
+ }
835
+ interface ReplayPayload {
836
+ title: string;
837
+ theme: "light" | "dark";
838
+ width: number;
839
+ height: number;
840
+ seconds: number;
841
+ /** The core's own drawing of the plan (light theme) and its viewBox in plan millimetres. */
842
+ svg: string;
843
+ viewBox: [number, number, number, number];
844
+ /** The end camera's elevation in degrees (`endElevation`). */
845
+ elevation: number;
846
+ /** The metrics strip's numbers (card G4); with none, no strip is painted. */
847
+ facts?: ReplayFacts;
848
+ nodes: ReplayNode[];
849
+ events: ReplayEvent[];
850
+ /**
851
+ * The ground plane's height (card RM8.3, `GROUND_PLANE`): the top of the lowest storey's slab, its
852
+ * floor level, in micrometres. Absent when that storey has no slab: then no ground is drawn.
853
+ */
854
+ ground?: {
855
+ y: number;
856
+ };
857
+ /**
858
+ * For offline generation only (`renderReplay`'s `supersample`, product-roadmap card RM8.2): each
859
+ * frame is the mean of k × k renders, a whole number from 1 to 4. Absent (1) everywhere else:
860
+ * `replayPayload` never sets it, and a live 3D preview takes one sample a frame. A host that sets
861
+ * it in a live page draws every frame k × k times, outside the viewer's frame-time budget.
862
+ */
863
+ supersample?: number;
864
+ /**
865
+ * `false` draws no contact shadows (card RM8.8): only the frame-time measurement sets it
866
+ * (`e2e/frame-budget.e2e.ts`), to time frames with and without them. Absent: drawn.
867
+ */
868
+ shadows?: false;
869
+ }
870
+ /**
871
+ * The line every surface that shows the preview carries (public-surfaces PS-D12, owner ruling
872
+ * PS-D11, `docs/plans/public-surfaces/3d.md` §2; it replaced decision D5's label). `PREVIEW_LEAD`
873
+ * is its first sentence, which a host may set in bold. The plan's full line adds "You can also
874
+ * download it as a validated GLB." where a surface offers the download.
875
+ *
876
+ * What "checked against the plan" means, as the line says it: every 3D element comes from the
877
+ * plan's elements (each Scene3D record carries the `source` naming its plan element, required by
878
+ * the schema, V-SCH-01 in `check/verify.ts`; the slab and a default roof come from the storey's
879
+ * rooms and walls; V-GLTF-02 holds the GLB's nodes to the Mesh3D's, each named `<kind>:<id>`), and
880
+ * every solid is closed (V-GEO-02, `openEdges` in `check/verify.ts`: every shell closed,
881
+ * consistently wound, of positive volume). `build` writes nothing when a check fails.
882
+ */
883
+ declare const PREVIEW_LEAD = "Same source, plan and 3D preview.";
884
+ declare const PREVIEW_LABEL = "Same source, plan and 3D preview. The 3D preview is extruded from the same .arch file by the separate archlang-3d package, and checked against the plan: every 3D element comes from the plan's elements, and every solid is closed.";
885
+ /**
886
+ * The limits line, always near a 3D view (PS-D12). It states what the package builds today
887
+ * (`3d.md` §3): change it when the package changes.
888
+ */
889
+ declare const PREVIEW_LIMITS = "3D preview: walls, openings, floors, stairs, furniture, outdoor surfaces and fences in plain colours; the ground and the soft contact shadows are the viewer's, not part of the building and not in the file; no pitched roofs or balcony railings yet, and no sections, elevations or BIM.";
890
+ /** The page that says what the 3D preview shows and does not (the docs site's `/3d`). */
891
+ declare const PREVIEW_ABOUT_URL = "https://archlang.uk/3d";
892
+ /**
893
+ * The words that tell which storey a notice is about in the combined view (card RM8.10): `L2 ·`.
894
+ * One function for the replay HTML and the playground, from the warning's own `level`.
895
+ */
896
+ declare function noticeLevelLabel(level: number): string;
897
+ interface ReplayOptions {
898
+ title: string;
899
+ /**
900
+ * The core's drawing of the storey phase 1 draws, light theme: `compile(source).svg` (page 1) for
901
+ * the combined view, the storey's own `compile(source).pages[i].svg` for a storey view.
902
+ */
903
+ svg: string;
904
+ width?: number;
905
+ height?: number;
906
+ seconds?: number;
907
+ /** Exports only: the sites stay light (D11, ADR 0014). */
908
+ theme?: "light" | "dark";
909
+ /** The metrics strip's numbers (`replayFacts`); omit for a replay without the strip (card G4). */
910
+ facts?: ReplayFacts;
911
+ }
912
+ /** The `viewBox` of an SVG document, in its user units (plan millimetres for the core's drawing). */
913
+ declare function viewBoxOf(svg: string): [number, number, number, number];
914
+ /**
915
+ * The data a replay HTML carries for `mesh`: pass `viewMesh(mesh, view)` for one view. A mesh of
916
+ * more than one storey is the combined view: its storeys are exploded (`explodeLifts`) while they
917
+ * rise and come down to their real heights by the end (`stateAt`'s `settle`), and the end camera
918
+ * looks down at 45° (`endElevation`).
919
+ */
920
+ declare function replayPayload(mesh: Mesh3D, opts: ReplayOptions): ReplayPayload;
921
+
922
+ export { type Outdoor as $, type Assumption as A, FLOOR_FINISH_RULES as B, CONTACT_SHADOW as C, type DoorKind as D, EXPLODE_GAP_MM as E, type Floor as F, type GroundTint as G, FLOOR_WORD_FINISH as H, type FloorFinish as I, GROUND_PLANE as J, GROUND_ROUGHNESS as K, type Level as L, type Mesh3D as M, GROUND_SPLITS as N, type Opening as O, PREVIEW_ABOUT_URL as P, GROUND_TINT as Q, type ReplayPayload as R, type StripItem as S, GROUND_WASH as T, KIND_PALETTE as U, type KindMaterial as V, MATERIAL_SLOTS as W, type MeshNode as X, type Meta as Y, type NodeKind as Z, type NodeState as _, PREVIEW_LABEL as a, PALETTE as a0, PHASE as a1, type Provenance as a2, type ReplayEvent as a3, type ReplayState as a4, type ReplayView as a5, type Roof as a6, SITE_PALETTE as a7, STAIR_MATERIAL as a8, STAIR_RAIL_MATERIAL as a9, STOP_LEAD as aa, type SlotMaterial as ab, type Source as ac, type Stage as ad, TRIM_MATERIAL as ae, type Um as af, WALL_CAP_SRGB as ag, type Wall as ah, authoringOrder as ai, contactBandMm as aj, ease as ak, explodeLifts as al, finishColour as am, floorFinish as an, keyFrames as ao, linearRgb as ap, siteColour as aq, slotColour as ar, slotGroups as as, stateAt as at, storeysOf as au, timeline as av, viewLabel as aw, viewMesh as ax, wordFinish as ay, PREVIEW_LEAD as b, PREVIEW_LIMITS as c, type ReplayFacts as d, type ReplayNode as e, type ReplayOptions as f, type Scene3D as g, type Polygon as h, type Pt as i, type Shell as j, type Ring3 as k, type Side as l, type Stair as m, noticeLevelLabel as n, type StairFlight as o, type StairLanding as p, type MaterialSlot as q, replayPayload as r, stripAt as s, type Furniture as t, type Fence as u, viewBoxOf as v, FENCE_PALETTE as w, FINISH_PALETTE as x, FIXTURE_FAMILIES as y, FLOOR_FINISHES as z };
package/dist/replay.d.ts CHANGED
@@ -1,116 +1,2 @@
1
- import { g as MaterialSlot, o as FloorFinish, R as ReplayFacts, J as ReplayEvent, M as Mesh3D } from './strip-CA-IAT0N.js';
1
+ export { P as PREVIEW_ABOUT_URL, a as PREVIEW_LABEL, b as PREVIEW_LEAD, c as PREVIEW_LIMITS, e as ReplayNode, f as ReplayOptions, R as ReplayPayload, n as noticeLevelLabel, r as replayPayload, v as viewBoxOf } from './payload-DwiB2P7x.js';
2
2
  import '@chanmeng666/archlang';
3
-
4
- /**
5
- * The replay's data (card A3), browser-safe: `replayPayload(mesh, opts)` is what a replay carries
6
- * for `mesh`, whether the single-file HTML inlines it (`html.ts`, Node) or the playground's 3D
7
- * preview tab builds it in the browser (card A5) and mounts it with `mountReplay`.
8
- */
9
-
10
- interface ReplayNode {
11
- key: string;
12
- kind: string;
13
- part?: string;
14
- /**
15
- * The combined view's exploded storeys: how far (mm) the node is lifted while the storeys rise;
16
- * absent = 0. It settles to 0 by the end (`settledLift`).
17
- */
18
- lift?: number;
19
- /** Flat `[x, y, z, …]` in micrometres, exporters' axes (X plan x, Y up, Z plan y). */
20
- positions: number[];
21
- indices: number[];
22
- /**
23
- * A T0 piece's material slots (visual-assets V1): consecutive runs of `indices`, in order, each
24
- * drawn in its slot's colour (`materials.ts`; `body` is the kind's own). Absent on every node
25
- * without a slotted shell, which is then drawn exactly as before.
26
- */
27
- groups?: Array<{
28
- slot: MaterialSlot;
29
- count: number;
30
- }>;
31
- /** A floor's finish (visual-assets V9, `extras.finish`), drawn in its colour; absent on every other node. */
32
- finish?: FloorFinish;
33
- /**
34
- * An outdoor surface's or a fence's colour (card RM8.3, `extras.colour`, sRGB `#rrggbb`), the one
35
- * the GLB writes too; absent on every other node.
36
- */
37
- colour?: string;
38
- }
39
- interface ReplayPayload {
40
- title: string;
41
- theme: "light" | "dark";
42
- width: number;
43
- height: number;
44
- seconds: number;
45
- /** The core's own drawing of the plan (light theme) and its viewBox in plan millimetres. */
46
- svg: string;
47
- viewBox: [number, number, number, number];
48
- /** The end camera's elevation in degrees (`endElevation`). */
49
- elevation: number;
50
- /** The metrics strip's numbers (card G4); with none, no strip is painted. */
51
- facts?: ReplayFacts;
52
- nodes: ReplayNode[];
53
- events: ReplayEvent[];
54
- /**
55
- * The ground plane's height (card RM8.3, `GROUND_PLANE`): the top of the lowest storey's slab, its
56
- * floor level, in micrometres. Absent when that storey has no slab: then no ground is drawn.
57
- */
58
- ground?: {
59
- y: number;
60
- };
61
- /**
62
- * For offline generation only (`renderReplay`'s `supersample`, product-roadmap card RM8.2): each
63
- * frame is the mean of k × k renders, a whole number from 1 to 4. Absent (1) everywhere else:
64
- * `replayPayload` never sets it, and a live 3D preview takes one sample a frame. A host that sets
65
- * it in a live page draws every frame k × k times, outside the viewer's frame-time budget.
66
- */
67
- supersample?: number;
68
- }
69
- /**
70
- * The line every surface that shows the preview carries (public-surfaces PS-D12, owner ruling
71
- * PS-D11, `docs/plans/public-surfaces/3d.md` §2; it replaced decision D5's label). `PREVIEW_LEAD`
72
- * is its first sentence, which a host may set in bold. The plan's full line adds "You can also
73
- * download it as a validated GLB." where a surface offers the download.
74
- *
75
- * What "checked against the plan" means, as the line says it: every 3D element comes from the
76
- * plan's elements (each Scene3D record carries the `source` naming its plan element, required by
77
- * the schema, V-SCH-01 in `check/verify.ts`; the slab and a default roof come from the storey's
78
- * rooms and walls; V-GLTF-02 holds the GLB's nodes to the Mesh3D's, each named `<kind>:<id>`), and
79
- * every solid is closed (V-GEO-02, `openEdges` in `check/verify.ts`: every shell closed,
80
- * consistently wound, of positive volume). `build` writes nothing when a check fails.
81
- */
82
- declare const PREVIEW_LEAD = "Same source, plan and 3D preview.";
83
- declare const PREVIEW_LABEL = "Same source, plan and 3D preview. The 3D preview is extruded from the same .arch file by the separate archlang-3d package, and checked against the plan: every 3D element comes from the plan's elements, and every solid is closed.";
84
- /**
85
- * The limits line, always near a 3D view (PS-D12). It states what the package builds today
86
- * (`3d.md` §3): change it when the package changes.
87
- */
88
- declare const PREVIEW_LIMITS = "3D preview: walls, openings, floors, stairs, furniture, outdoor surfaces and fences in flat colours; the ground is a backdrop the viewer draws, not part of the building and not in the file; no pitched roofs or balcony railings yet, and no sections, elevations or BIM.";
89
- /** The page that says what the 3D preview shows and does not (the docs site's `/3d`). */
90
- declare const PREVIEW_ABOUT_URL = "https://archlang.uk/3d";
91
- interface ReplayOptions {
92
- title: string;
93
- /**
94
- * The core's drawing of the storey phase 1 draws, light theme: `compile(source).svg` (page 1) for
95
- * the combined view, the storey's own `compile(source).pages[i].svg` for a storey view.
96
- */
97
- svg: string;
98
- width?: number;
99
- height?: number;
100
- seconds?: number;
101
- /** Exports only: the sites stay light (D11, ADR 0014). */
102
- theme?: "light" | "dark";
103
- /** The metrics strip's numbers (`replayFacts`); omit for a replay without the strip (card G4). */
104
- facts?: ReplayFacts;
105
- }
106
- /** The `viewBox` of an SVG document, in its user units (plan millimetres for the core's drawing). */
107
- declare function viewBoxOf(svg: string): [number, number, number, number];
108
- /**
109
- * The data a replay HTML carries for `mesh`: pass `viewMesh(mesh, view)` for one view. A mesh of
110
- * more than one storey is the combined view: its storeys are exploded (`explodeLifts`) while they
111
- * rise and come down to their real heights by the end (`stateAt`'s `settle`), and the end camera
112
- * looks down at 45° (`endElevation`).
113
- */
114
- declare function replayPayload(mesh: Mesh3D, opts: ReplayOptions): ReplayPayload;
115
-
116
- export { PREVIEW_ABOUT_URL, PREVIEW_LABEL, PREVIEW_LEAD, PREVIEW_LIMITS, type ReplayNode, type ReplayOptions, type ReplayPayload, replayPayload, viewBoxOf };
@@ -291,6 +291,10 @@
291
291
  "type": "string"
292
292
  }
293
293
  },
294
+ "pattern": {
295
+ "type": "string",
296
+ "description": "The room's authored floor word (room ... floor <word>); absent when the plan wrote none."
297
+ },
294
298
  "lift": {
295
299
  "$ref": "#/$defs/um",
296
300
  "description": "Lift of the floor finish over an earlier overlapping room's (V-GEO-05): 500 um per step; absent when none."
@@ -562,6 +566,14 @@
562
566
  "$ref": "#/$defs/um"
563
567
  }
564
568
  }
569
+ },
570
+ "winders": {
571
+ "type": "array",
572
+ "minItems": 2,
573
+ "description": "A winders landing's tapered treads in climbing order, each its plan ring, cut by the lines the core's drawing draws across it; absent on a level landing.",
574
+ "items": {
575
+ "$ref": "#/$defs/ring"
576
+ }
565
577
  }
566
578
  }
567
579
  }