@chanmeng666/archlang-3d 0.2.0 → 0.3.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/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  openLeaf,
8
8
  rectsOf,
9
9
  slabRegion
10
- } from "./chunk-4AF5Q7M3.js";
10
+ } from "./chunk-QUSG4UCO.js";
11
11
  import {
12
12
  ARCHLANG_3D_VERSION,
13
13
  FLOOR_LIFT_UM,
@@ -42,8 +42,10 @@ import {
42
42
  umPoint,
43
43
  validateScene3D,
44
44
  wallOwnership
45
- } from "./chunk-VUSBWX7N.js";
45
+ } from "./chunk-PRZXP6FP.js";
46
46
  import {
47
+ ELEVATION_AZIMUTH,
48
+ ELEVATION_RANGE,
47
49
  END_AZIMUTH,
48
50
  END_FOV,
49
51
  EXPLODE_GAP_MM,
@@ -56,15 +58,18 @@ import {
56
58
  MATERIAL_SLOTS,
57
59
  PALETTE,
58
60
  PHASE,
61
+ PRESET_NAMES,
59
62
  START_FOV,
60
63
  STOP_LEAD,
61
64
  WALL_CAP_SRGB,
65
+ ZOOM,
62
66
  authoringOrder,
63
67
  boxOfNodes,
64
68
  cameraAtStop,
65
69
  cameraStops,
66
70
  corners,
67
71
  coverage,
72
+ distanceLimits,
68
73
  drawingFrame,
69
74
  ease,
70
75
  endElevation,
@@ -75,19 +80,25 @@ import {
75
80
  frameCamera,
76
81
  keyFrames,
77
82
  linearRgb,
83
+ pivotAbove,
84
+ presetCamera,
78
85
  projectBox,
79
86
  slotColour,
80
87
  slotGroups,
81
88
  stateAt,
82
89
  storeysOf,
83
90
  stripAt,
91
+ takenLens,
92
+ targetBounds,
84
93
  timeline,
85
94
  viewLabel,
86
95
  viewMesh
87
- } from "./chunk-EYEEIS4R.js";
96
+ } from "./chunk-VPYTRKMK.js";
88
97
  export {
89
98
  ARCHLANG_3D_VERSION,
90
99
  DOOR_POSES,
100
+ ELEVATION_AZIMUTH,
101
+ ELEVATION_RANGE,
91
102
  END_AZIMUTH,
92
103
  END_FOV,
93
104
  EXPLODE_GAP_MM,
@@ -104,6 +115,7 @@ export {
104
115
  MIN_CORE,
105
116
  PALETTE,
106
117
  PHASE,
118
+ PRESET_NAMES,
107
119
  START_FOV,
108
120
  STOP_LEAD,
109
121
  T0_FAMILIES,
@@ -113,6 +125,7 @@ export {
113
125
  T0_MATERIALS,
114
126
  T0_MOUNT_MM,
115
127
  WALL_CAP_SRGB,
128
+ ZOOM,
116
129
  adaptPlan,
117
130
  assetFor,
118
131
  authoringOrder,
@@ -125,6 +138,7 @@ export {
125
138
  corners,
126
139
  coverage,
127
140
  cutSector,
141
+ distanceLimits,
128
142
  drawingFrame,
129
143
  ease,
130
144
  endElevation,
@@ -145,6 +159,8 @@ export {
145
159
  partShell,
146
160
  piecesOf,
147
161
  piecesTouch,
162
+ pivotAbove,
163
+ presetCamera,
148
164
  prism,
149
165
  projectBox,
150
166
  rectsOf,
@@ -160,6 +176,8 @@ export {
160
176
  stripAt,
161
177
  t0LocalParts,
162
178
  t0Shells,
179
+ takenLens,
180
+ targetBounds,
163
181
  timeline,
164
182
  um,
165
183
  umPoint,
package/dist/node.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { World } from '@chanmeng666/archlang';
2
- import { M as Mesh3D, g as ReplayEvent, q as MeshNode, a as Scene3D, c as Shell } from './strip-CdTeMoHA.js';
3
- export { R as ReplayFacts, S as StripItem, s as stripAt } from './strip-CdTeMoHA.js';
2
+ import { M as Mesh3D, w as ReplayEvent, o as MeshNode, a as Scene3D, c as Shell } from './strip-CN_dTKqy.js';
3
+ export { R as ReplayFacts, S as StripItem, s as stripAt } from './strip-CN_dTKqy.js';
4
4
  import { ReplayOptions } from './replay.js';
5
5
  export { PREVIEW_LABEL, replayPayload, viewBoxOf } from './replay.js';
6
- export { F as FactsOptions, r as replayFacts } from './facts-DHuCDilh.js';
6
+ export { F as FactsOptions, r as replayFacts } from './facts-B47HOKOh.js';
7
7
 
8
8
  /** The viewer and the parts of three.js it uses, as one minified browser script (read once). */
9
9
  declare function viewerScript(): Promise<string>;
package/dist/node.js CHANGED
@@ -20,18 +20,18 @@ import {
20
20
  signedVolume,
21
21
  viewerScript,
22
22
  writeGlb
23
- } from "./chunk-KUK6ARJC.js";
23
+ } from "./chunk-ZE4PL6KP.js";
24
24
  import {
25
25
  replayFacts
26
- } from "./chunk-VUSBWX7N.js";
26
+ } from "./chunk-PRZXP6FP.js";
27
27
  import {
28
28
  PREVIEW_LABEL,
29
29
  replayPayload,
30
30
  viewBoxOf
31
- } from "./chunk-2ZINQMUB.js";
31
+ } from "./chunk-WBA4LABI.js";
32
32
  import {
33
33
  stripAt
34
- } from "./chunk-EYEEIS4R.js";
34
+ } from "./chunk-VPYTRKMK.js";
35
35
  export {
36
36
  GLB_GENERATOR,
37
37
  PREVIEW_LABEL,
package/dist/replay.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { e as MaterialSlot, n as FloorFinish, R as ReplayFacts, g as ReplayEvent, M as Mesh3D } from './strip-CdTeMoHA.js';
1
+ import { e as MaterialSlot, l as FloorFinish, R as ReplayFacts, w as ReplayEvent, M as Mesh3D } from './strip-CN_dTKqy.js';
2
2
 
3
3
  /**
4
4
  * The replay's data (card A3), browser-safe: `replayPayload(mesh, opts)` is what a replay carries
@@ -1,3 +1,95 @@
1
+ /**
2
+ * Material slots (visual-assets card V1): the ONE palette both the GLB writer (`glb/write.ts`) and
3
+ * the replay viewer (`replay/mount.ts`) read, so a piece's oak or ceramic is the same colour in
4
+ * both. A T0 part names its slot (`Part.mat`, `mesh/t0.ts`); its shell carries it (`Shell.slot`);
5
+ * a node with slotted shells is still ONE node under its key (`furniture:<id>`), drawn as one
6
+ * primitive (GLB, material `fixture:<slot>`) or one mesh (viewer) per slot.
7
+ *
8
+ * `body` is the untagged part: it carries no slot and keeps its kind's own colour, so a piece that
9
+ * names no slot is drawn exactly as before. Browser-safe and pure: no clock, no random source.
10
+ */
11
+
12
+ /** The closed set of slots, in the order a node's primitives (GLB) and meshes (viewer) are written. */
13
+ declare const MATERIAL_SLOTS: readonly ["body", "wood", "wood_dark", "fabric", "cushion", "linen", "wool", "ceramic", "stone", "metal", "glass", "appliance", "screen", "paint", "rubber", "foliage", "bark", "soil", "water"];
14
+ type MaterialSlot = (typeof MATERIAL_SLOTS)[number];
15
+ interface SlotMaterial {
16
+ /** Base colour, sRGB `#rrggbb`: the viewer's colour, and the GLB's after `linearRgb`. */
17
+ srgb: string;
18
+ /** 1 = opaque; below 1 the GLB writes `alphaMode: BLEND` and the viewer draws it translucent. */
19
+ alpha: number;
20
+ /** glTF metallic-roughness factors (the viewer's Lambert shading reads neither). */
21
+ metallic: number;
22
+ roughness: number;
23
+ }
24
+ /**
25
+ * The palette: warm and quiet, a furnished Scandinavian interior rather than a massing model —
26
+ * light oak and walnut, warm grey upholstery, off-white linen and ceramics, a pale stone worktop,
27
+ * brushed steel, a sage-grey kitchen and muted greens outdoors.
28
+ */
29
+ declare const PALETTE: Readonly<Record<Exclude<MaterialSlot, "body">, SlotMaterial>>;
30
+ /**
31
+ * The building's own materials (visual-assets V9), by Mesh3D kind, and `<kind>:<part>` where a
32
+ * part differs (a window's frame and glass, a demolished wall's ghost): the light replay's colours
33
+ * and, through `linearRgb`, the GLB's. Soft daylight on a refined model: warm-white walls on a
34
+ * warm-grey concrete slab, oak doors, slim dark-bronze window frames, pale glass. A floor takes its
35
+ * finish's colour (`FINISH_PALETTE`), never a kind colour.
36
+ */
37
+ declare const KIND_PALETTE: {
38
+ readonly slab: SlotMaterial;
39
+ readonly column: SlotMaterial;
40
+ readonly wall: SlotMaterial;
41
+ readonly door: SlotMaterial;
42
+ readonly "window:frame": SlotMaterial;
43
+ readonly "window:glass": SlotMaterial;
44
+ readonly opening: SlotMaterial;
45
+ readonly furniture: SlotMaterial;
46
+ readonly roof: SlotMaterial;
47
+ readonly "wall:demolish": SlotMaterial;
48
+ };
49
+ type KindMaterial = keyof typeof KIND_PALETTE;
50
+ /**
51
+ * The replay's colour for a wall's cut top (its cap, the faces at its full height): the poché of a
52
+ * plan, read as the section through a model whose roof is lifted off. A display convention of the
53
+ * viewer, not a material: the GLB has no cap.
54
+ */
55
+ declare const WALL_CAP_SRGB = "#8f877d";
56
+ /** The floor finishes a room's floor is laid in (visual-assets V9): colour only, no texture. */
57
+ declare const FLOOR_FINISHES: readonly ["timber", "tile", "neutral"];
58
+ type FloorFinish = (typeof FLOOR_FINISHES)[number];
59
+ /** Light oak boards, pale stone tile, and the neutral finish a room whose use is unknown keeps. */
60
+ declare const FINISH_PALETTE: Readonly<Record<FloorFinish, SlotMaterial>>;
61
+ /**
62
+ * A room's floor finish from its declared `uses` (the core's use kinds, read off the plan by
63
+ * `adaptPlan`), first rule that names one of them: a wet room is tiled whatever else it is (`bath
64
+ * wc`, `utility wc`); a room lived in, slept or worked in, or walked through is timber (an open
65
+ * `living kitchen` keeps its boards); a kitchen or an entry on its own is tiled; anything else (a
66
+ * garage, a store, a room without `uses`) keeps the neutral finish. A drafting default, ledgered per
67
+ * floor as `floor-finish-default` (ADR 0030 decision 5); never read from a label.
68
+ */
69
+ declare const FLOOR_FINISH_RULES: ReadonlyArray<readonly [FloorFinish, readonly string[]]>;
70
+ /** The finish {@link FLOOR_FINISH_RULES} gives a room with these `uses`. */
71
+ declare function floorFinish(uses: readonly string[] | undefined): FloorFinish;
72
+ /** sRGB `#rrggbb` → linear RGB, each channel rounded to 4 decimals (glTF base colours are linear). */
73
+ declare function linearRgb(hex: string): [number, number, number];
74
+ /**
75
+ * A slot's viewer colour under a replay theme: the palette itself on the light theme; on the dark
76
+ * (blueprint) theme, 60% of the way from the palette to the theme's furniture colour, so materials
77
+ * stay told apart without leaving the theme. Each channel is one float multiply-add of 0–255
78
+ * integers, rounded to a whole channel value: basic IEEE-754 operations, correctly rounded in
79
+ * every engine, so every engine agrees.
80
+ */
81
+ declare function slotColour(slot: Exclude<MaterialSlot, "body">, theme: "light" | "dark", furniture: string): string;
82
+ /**
83
+ * A floor finish's viewer colour under a replay theme: the finish itself on the light theme; on the
84
+ * dark one, 60% of the way to the theme's floor colour (the same arithmetic as `slotColour`).
85
+ */
86
+ declare function finishColour(finish: FloorFinish, theme: "light" | "dark", floor: string): string;
87
+ /** A node's shells grouped by slot, in `MATERIAL_SLOTS` order (untagged `body` first). */
88
+ declare function slotGroups(shells: readonly Shell[]): Array<{
89
+ slot: MaterialSlot;
90
+ shells: Shell[];
91
+ }>;
92
+
1
93
  /**
2
94
  * Scene3D v0: a renderer-independent, plan-aligned 2.5D scene read off a resolved plan
3
95
  * (archlang-3d plan §3.5, appendix A). Plan axes: x right, y DOWN; z up. Every length is an
@@ -241,98 +333,6 @@ interface Mesh3D {
241
333
  nodes: MeshNode[];
242
334
  }
243
335
 
244
- /**
245
- * Material slots (visual-assets card V1): the ONE palette both the GLB writer (`glb/write.ts`) and
246
- * the replay viewer (`replay/mount.ts`) read, so a piece's oak or ceramic is the same colour in
247
- * both. A T0 part names its slot (`Part.mat`, `mesh/t0.ts`); its shell carries it (`Shell.slot`);
248
- * a node with slotted shells is still ONE node under its key (`furniture:<id>`), drawn as one
249
- * primitive (GLB, material `fixture:<slot>`) or one mesh (viewer) per slot.
250
- *
251
- * `body` is the untagged part: it carries no slot and keeps its kind's own colour, so a piece that
252
- * names no slot is drawn exactly as before. Browser-safe and pure: no clock, no random source.
253
- */
254
-
255
- /** The closed set of slots, in the order a node's primitives (GLB) and meshes (viewer) are written. */
256
- declare const MATERIAL_SLOTS: readonly ["body", "wood", "wood_dark", "fabric", "cushion", "linen", "wool", "ceramic", "stone", "metal", "glass", "appliance", "screen", "paint", "rubber", "foliage", "bark", "soil", "water"];
257
- type MaterialSlot = (typeof MATERIAL_SLOTS)[number];
258
- interface SlotMaterial {
259
- /** Base colour, sRGB `#rrggbb`: the viewer's colour, and the GLB's after `linearRgb`. */
260
- srgb: string;
261
- /** 1 = opaque; below 1 the GLB writes `alphaMode: BLEND` and the viewer draws it translucent. */
262
- alpha: number;
263
- /** glTF metallic-roughness factors (the viewer's Lambert shading reads neither). */
264
- metallic: number;
265
- roughness: number;
266
- }
267
- /**
268
- * The palette: warm and quiet, a furnished Scandinavian interior rather than a massing model —
269
- * light oak and walnut, warm grey upholstery, off-white linen and ceramics, a pale stone worktop,
270
- * brushed steel, a sage-grey kitchen and muted greens outdoors.
271
- */
272
- declare const PALETTE: Readonly<Record<Exclude<MaterialSlot, "body">, SlotMaterial>>;
273
- /**
274
- * The building's own materials (visual-assets V9), by Mesh3D kind, and `<kind>:<part>` where a
275
- * part differs (a window's frame and glass, a demolished wall's ghost): the light replay's colours
276
- * and, through `linearRgb`, the GLB's. Soft daylight on a refined model: warm-white walls on a
277
- * warm-grey concrete slab, oak doors, slim dark-bronze window frames, pale glass. A floor takes its
278
- * finish's colour (`FINISH_PALETTE`), never a kind colour.
279
- */
280
- declare const KIND_PALETTE: {
281
- readonly slab: SlotMaterial;
282
- readonly column: SlotMaterial;
283
- readonly wall: SlotMaterial;
284
- readonly door: SlotMaterial;
285
- readonly "window:frame": SlotMaterial;
286
- readonly "window:glass": SlotMaterial;
287
- readonly opening: SlotMaterial;
288
- readonly furniture: SlotMaterial;
289
- readonly roof: SlotMaterial;
290
- readonly "wall:demolish": SlotMaterial;
291
- };
292
- type KindMaterial = keyof typeof KIND_PALETTE;
293
- /**
294
- * The replay's colour for a wall's cut top (its cap, the faces at its full height): the poché of a
295
- * plan, read as the section through a model whose roof is lifted off. A display convention of the
296
- * viewer, not a material: the GLB has no cap.
297
- */
298
- declare const WALL_CAP_SRGB = "#8f877d";
299
- /** The floor finishes a room's floor is laid in (visual-assets V9): colour only, no texture. */
300
- declare const FLOOR_FINISHES: readonly ["timber", "tile", "neutral"];
301
- type FloorFinish = (typeof FLOOR_FINISHES)[number];
302
- /** Light oak boards, pale stone tile, and the neutral finish a room whose use is unknown keeps. */
303
- declare const FINISH_PALETTE: Readonly<Record<FloorFinish, SlotMaterial>>;
304
- /**
305
- * A room's floor finish from its declared `uses` (the core's use kinds, read off the plan by
306
- * `adaptPlan`), first rule that names one of them: a wet room is tiled whatever else it is (`bath
307
- * wc`, `utility wc`); a room lived in, slept or worked in, or walked through is timber (an open
308
- * `living kitchen` keeps its boards); a kitchen or an entry on its own is tiled; anything else (a
309
- * garage, a store, a room without `uses`) keeps the neutral finish. A drafting default, ledgered per
310
- * floor as `floor-finish-default` (ADR 0030 decision 5); never read from a label.
311
- */
312
- declare const FLOOR_FINISH_RULES: ReadonlyArray<readonly [FloorFinish, readonly string[]]>;
313
- /** The finish {@link FLOOR_FINISH_RULES} gives a room with these `uses`. */
314
- declare function floorFinish(uses: readonly string[] | undefined): FloorFinish;
315
- /** sRGB `#rrggbb` → linear RGB, each channel rounded to 4 decimals (glTF base colours are linear). */
316
- declare function linearRgb(hex: string): [number, number, number];
317
- /**
318
- * A slot's viewer colour under a replay theme: the palette itself on the light theme; on the dark
319
- * (blueprint) theme, 60% of the way from the palette to the theme's furniture colour, so materials
320
- * stay told apart without leaving the theme. Each channel is one float multiply-add of 0–255
321
- * integers, rounded to a whole channel value: basic IEEE-754 operations, correctly rounded in
322
- * every engine, so every engine agrees.
323
- */
324
- declare function slotColour(slot: Exclude<MaterialSlot, "body">, theme: "light" | "dark", furniture: string): string;
325
- /**
326
- * A floor finish's viewer colour under a replay theme: the finish itself on the light theme; on the
327
- * dark one, 60% of the way to the theme's floor colour (the same arithmetic as `slotColour`).
328
- */
329
- declare function finishColour(finish: FloorFinish, theme: "light" | "dark", floor: string): string;
330
- /** A node's shells grouped by slot, in `MATERIAL_SLOTS` order (untagged `body` first). */
331
- declare function slotGroups(shells: readonly Shell[]): Array<{
332
- slot: MaterialSlot;
333
- shells: Shell[];
334
- }>;
335
-
336
336
  /**
337
337
  * The replay as a pure function of time (card A3; archlang-3d plan §6.5; decision D3). The plan
338
338
  * draws itself in its authoring order, then rises:
@@ -531,4 +531,4 @@ interface StripItem {
531
531
  */
532
532
  declare function stripAt(facts: ReplayFacts, events: readonly ReplayEvent[], t: number): StripItem[];
533
533
 
534
- export { slotColour as $, type Assumption as A, STOP_LEAD as B, type SlotMaterial as C, type DoorKind as D, EXPLODE_GAP_MM as E, type Floor as F, type Source as G, type Stage as H, type Stair as I, type Wall 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, authoringOrder as Q, type ReplayFacts as R, type StripItem as S, ease as T, type Um as U, explodeLifts as V, WALL_CAP_SRGB as W, finishColour as X, floorFinish as Y, keyFrames as Z, linearRgb as _, type Scene3D as a, slotGroups as a0, stateAt as a1, storeysOf as a2, timeline as a3, viewLabel as a4, viewMesh as a5, type Pt as b, type Shell as c, type Ring3 as d, type MaterialSlot as e, type Furniture as f, type ReplayEvent as g, type ReplayState as h, FINISH_PALETTE as i, FIXTURE_FAMILIES as j, FLOOR_FINISHES as k, FLOOR_FINISH_RULES as l, type Fence as m, type FloorFinish as n, type KindMaterial as o, MATERIAL_SLOTS as p, type MeshNode as q, type Meta as r, stripAt as s, type NodeState as t, type Outdoor as u, PALETTE as v, PHASE as w, type Provenance as x, type ReplayView as y, type Roof as z };
534
+ export { slotColour as $, type Assumption as A, STOP_LEAD as B, type SlotMaterial as C, type DoorKind as D, EXPLODE_GAP_MM as E, type Floor as F, type Source as G, type Stage as H, type Stair as I, type Wall 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, authoringOrder as Q, type ReplayFacts as R, type StripItem as S, ease as T, type Um as U, explodeLifts as V, WALL_CAP_SRGB as W, finishColour as X, floorFinish as Y, keyFrames as Z, linearRgb as _, type Scene3D as a, slotGroups as a0, stateAt as a1, storeysOf as a2, timeline as a3, viewLabel as a4, viewMesh as a5, type Pt as b, type Shell as c, type Ring3 as d, type MaterialSlot as e, type Furniture as f, FINISH_PALETTE as g, FIXTURE_FAMILIES as h, FLOOR_FINISHES as i, FLOOR_FINISH_RULES as j, type Fence as k, type FloorFinish as l, type KindMaterial as m, MATERIAL_SLOTS as n, type MeshNode as o, type Meta as p, type NodeState as q, type Outdoor as r, stripAt as s, PALETTE as t, PHASE as u, type Provenance as v, type ReplayEvent as w, type ReplayState as x, type ReplayView as y, type Roof as z };