@chanmeng666/archlang-3d 0.7.0 → 0.8.1
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 +91 -0
- package/README.md +4 -4
- package/dist/browser.d.ts +3 -5
- package/dist/browser.js +87 -472
- package/dist/{camera-CGIIudHj.d.ts → camera-BAsRq_eC.d.ts} +1 -1
- package/dist/{chunk-GXWLZ2KC.js → chunk-33J3YGNF.js} +392 -29
- package/dist/{chunk-QN4LQTVG.js → chunk-CYSES7C3.js} +128 -44
- package/dist/chunk-JQTG6BDR.js +1127 -0
- package/dist/{chunk-TI4RYEOL.js → chunk-LNIVDMPG.js} +75 -5
- package/dist/{chunk-FHBR2U5Z.js → chunk-VMVKI2WQ.js} +65 -3
- package/dist/{chunk-FVD3DZU2.js → chunk-WOEJKIXN.js} +15 -6
- package/dist/cli.js +12 -6
- package/dist/{facts-3wb9egIT.d.ts → facts-CsO0xtFw.d.ts} +1 -1
- package/dist/index.d.ts +104 -35
- package/dist/index.js +19 -5
- package/dist/node.d.ts +23 -7
- package/dist/node.js +4 -4
- package/dist/{strip-Sdsm54Qw.d.ts → payload-DwiB2P7x.d.ts} +232 -12
- package/dist/replay.d.ts +1 -115
- package/dist/scene3d.schema.json +12 -0
- package/dist/viewer.iife.js +180 -180
- package/package.json +3 -3
package/dist/node.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { World } from '@chanmeng666/archlang';
|
|
2
|
-
import { M as Mesh3D,
|
|
3
|
-
export {
|
|
4
|
-
|
|
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-3wb9egIT.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-3wb9egIT.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:
|
|
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-
|
|
23
|
+
} from "./chunk-WOEJKIXN.js";
|
|
24
24
|
import {
|
|
25
25
|
replayFacts
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-33J3YGNF.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-
|
|
34
|
+
} from "./chunk-VMVKI2WQ.js";
|
|
35
35
|
import {
|
|
36
36
|
stripAt
|
|
37
|
-
} from "./chunk-
|
|
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
|
|
@@ -103,11 +103,34 @@ declare const TRIM_MATERIAL: {
|
|
|
103
103
|
* viewer, not a material: the GLB has no cap.
|
|
104
104
|
*/
|
|
105
105
|
declare const WALL_CAP_SRGB = "#8f877d";
|
|
106
|
-
/**
|
|
107
|
-
|
|
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"];
|
|
108
113
|
type FloorFinish = (typeof FLOOR_FINISHES)[number];
|
|
109
|
-
/**
|
|
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
|
+
*/
|
|
110
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;
|
|
111
134
|
/**
|
|
112
135
|
* A room's floor finish from its declared `uses` (the core's use kinds, read off the plan by
|
|
113
136
|
* `adaptPlan`), first rule that names one of them: a wet room is tiled whatever else it is (`bath
|
|
@@ -137,20 +160,23 @@ declare const GROUND_TINT: Readonly<Record<ROutdoor["surface"], GroundTint>>;
|
|
|
137
160
|
*/
|
|
138
161
|
declare const GROUND_WASH = 6;
|
|
139
162
|
/**
|
|
140
|
-
* The site's own materials, which no fixture is made of: a light gravel
|
|
141
|
-
* from `PALETTE` on purpose: `PALETTE`'s keys are the material slots, which
|
|
142
|
-
* `FIXTURE_MATERIALS` (`test/material-vocabulary.test.ts`), and a ground is no
|
|
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.
|
|
143
167
|
*/
|
|
144
168
|
declare const SITE_PALETTE: {
|
|
145
169
|
readonly gravel: SlotMaterial;
|
|
146
170
|
readonly tarmac: SlotMaterial;
|
|
171
|
+
readonly sand: SlotMaterial;
|
|
147
172
|
};
|
|
148
173
|
/**
|
|
149
174
|
* The kinds the 3D preview tells apart where the drawing does it by hatch alone (one `paving` tint
|
|
150
|
-
* covers
|
|
151
|
-
* palette's foliage, a timber deck in its oak, gravel and a tarmac drive in their own greys
|
|
152
|
-
*
|
|
153
|
-
*
|
|
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`).
|
|
154
180
|
*/
|
|
155
181
|
declare const GROUND_SPLITS: Readonly<Partial<Record<ROutdoor["surface"], SlotMaterial>>>;
|
|
156
182
|
/** The GLB roughness of a ground surface in its theme colour, by tint (the viewer reads none). */
|
|
@@ -174,6 +200,56 @@ declare const GROUND_PLANE: {
|
|
|
174
200
|
readonly dark: "#16293d";
|
|
175
201
|
readonly marginMm: 6000;
|
|
176
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;
|
|
177
253
|
/**
|
|
178
254
|
* An `outdoor` or `fence` colour under a replay theme: its own on the light theme; on the dark one,
|
|
179
255
|
* 60% of the way to `toward` (the theme's floor colour), the arithmetic of `slotColour`.
|
|
@@ -251,6 +327,9 @@ interface Floor {
|
|
|
251
327
|
source: Source;
|
|
252
328
|
polygon: Polygon;
|
|
253
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;
|
|
254
333
|
/** How far (µm) the floor finish is lifted because it overlaps an earlier room's (V-GEO-05,
|
|
255
334
|
* `W3D_FLOOR_OVERLAP`): 0.5 mm per step, absent when it overlaps none. */
|
|
256
335
|
lift?: Um;
|
|
@@ -358,6 +437,14 @@ interface StairLanding {
|
|
|
358
437
|
w: Um;
|
|
359
438
|
h: Um;
|
|
360
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[][];
|
|
361
448
|
}
|
|
362
449
|
interface Stair {
|
|
363
450
|
id: string;
|
|
@@ -699,4 +786,137 @@ interface StripItem {
|
|
|
699
786
|
*/
|
|
700
787
|
declare function stripAt(facts: ReplayFacts, events: readonly ReplayEvent[], t: number): StripItem[];
|
|
701
788
|
|
|
702
|
-
|
|
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
|
-
|
|
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 };
|
package/dist/scene3d.schema.json
CHANGED
|
@@ -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
|
}
|