@chanmeng666/archlang-3d 0.5.0 → 0.6.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
@@ -1,15 +1,28 @@
1
1
  import {
2
+ CORE_POSTS_PER_RUN,
3
+ CORE_POST_PITCH_MM,
2
4
  DOOR_POSES,
5
+ FENCE_HEIGHT_MM,
6
+ FENCE_PROFILES,
3
7
  FURNITURE_HEIGHT_MM,
8
+ MAX_FENCE_REPEAT,
4
9
  MIN_CORE,
10
+ OUTDOOR_MM,
5
11
  adaptPlan,
6
12
  buildMesh,
13
+ corePostCount,
14
+ fenceColour,
15
+ fencePieces,
16
+ fencePosts,
17
+ fenceRuns,
18
+ groundColour,
7
19
  openLeaf,
20
+ outdoorColour,
8
21
  rectsOf,
9
22
  slabRegion,
10
23
  stairRisers,
11
24
  stairSolid
12
- } from "./chunk-L2CX7KWM.js";
25
+ } from "./chunk-VXGQYUMN.js";
13
26
  import {
14
27
  ARCHLANG_3D_VERSION,
15
28
  FLOOR_LIFT_UM,
@@ -44,23 +57,30 @@ import {
44
57
  umPoint,
45
58
  validateScene3D,
46
59
  wallOwnership
47
- } from "./chunk-WCWLYIVD.js";
60
+ } from "./chunk-6WCS4TAT.js";
48
61
  import {
49
62
  ELEVATION_AZIMUTH,
50
63
  ELEVATION_RANGE,
51
64
  END_AZIMUTH,
52
65
  END_FOV,
53
66
  EXPLODE_GAP_MM,
67
+ FENCE_PALETTE,
54
68
  FILL,
55
69
  FINISH_PALETTE,
56
70
  FIXTURE_FAMILIES,
57
71
  FLOOR_FINISHES,
58
72
  FLOOR_FINISH_RULES,
73
+ GROUND_PLANE,
74
+ GROUND_ROUGHNESS,
75
+ GROUND_SPLITS,
76
+ GROUND_TINT,
77
+ GROUND_WASH,
59
78
  KIND_PALETTE,
60
79
  MATERIAL_SLOTS,
61
80
  PALETTE,
62
81
  PHASE,
63
82
  PRESET_NAMES,
83
+ SITE_PALETTE,
64
84
  STAIR_MATERIAL,
65
85
  START_FOV,
66
86
  STOP_LEAD,
@@ -87,6 +107,7 @@ import {
87
107
  presetCamera,
88
108
  projectBox,
89
109
  settledLift,
110
+ siteColour,
90
111
  slotColour,
91
112
  slotGroups,
92
113
  stateAt,
@@ -98,15 +119,20 @@ import {
98
119
  timeline,
99
120
  viewLabel,
100
121
  viewMesh
101
- } from "./chunk-EQBMPXB5.js";
122
+ } from "./chunk-TNNJ7CAO.js";
102
123
  export {
103
124
  ARCHLANG_3D_VERSION,
125
+ CORE_POSTS_PER_RUN,
126
+ CORE_POST_PITCH_MM,
104
127
  DOOR_POSES,
105
128
  ELEVATION_AZIMUTH,
106
129
  ELEVATION_RANGE,
107
130
  END_AZIMUTH,
108
131
  END_FOV,
109
132
  EXPLODE_GAP_MM,
133
+ FENCE_HEIGHT_MM,
134
+ FENCE_PALETTE,
135
+ FENCE_PROFILES,
110
136
  FILL,
111
137
  FINISH_PALETTE,
112
138
  FIXTURE_FAMILIES,
@@ -115,12 +141,20 @@ export {
115
141
  FLOOR_LIFT_UM,
116
142
  FLOOR_OVERLAP_MIN_UM2,
117
143
  FURNITURE_HEIGHT_MM,
144
+ GROUND_PLANE,
145
+ GROUND_ROUGHNESS,
146
+ GROUND_SPLITS,
147
+ GROUND_TINT,
148
+ GROUND_WASH,
118
149
  KIND_PALETTE,
119
150
  MATERIAL_SLOTS,
151
+ MAX_FENCE_REPEAT,
120
152
  MIN_CORE,
153
+ OUTDOOR_MM,
121
154
  PALETTE,
122
155
  PHASE,
123
156
  PRESET_NAMES,
157
+ SITE_PALETTE,
124
158
  STAIR_MATERIAL,
125
159
  START_FOV,
126
160
  STOP_LEAD,
@@ -141,6 +175,7 @@ export {
141
175
  cameraAtStop,
142
176
  cameraStops,
143
177
  clipToConvex,
178
+ corePostCount,
144
179
  corners,
145
180
  coverage,
146
181
  cutSector,
@@ -149,18 +184,24 @@ export {
149
184
  ease,
150
185
  endElevation,
151
186
  explodeLifts,
187
+ fenceColour,
188
+ fencePieces,
189
+ fencePosts,
190
+ fenceRuns,
152
191
  finishColour,
153
192
  fitEndCamera,
154
193
  floorFinish,
155
194
  floorLifts,
156
195
  floorOverlaps,
157
196
  frameCamera,
197
+ groundColour,
158
198
  handedAt,
159
199
  insideCut,
160
200
  keyFrames,
161
201
  linearRgb,
162
202
  mixedHeightJoints,
163
203
  openLeaf,
204
+ outdoorColour,
164
205
  overlapArea,
165
206
  partShell,
166
207
  piecesOf,
@@ -174,6 +215,7 @@ export {
174
215
  sectionRing,
175
216
  sectorBand,
176
217
  settledLift,
218
+ siteColour,
177
219
  slab2d,
178
220
  slabRegion,
179
221
  slotColour,
package/dist/node.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { World } from '@chanmeng666/archlang';
2
- import { M as Mesh3D, y as ReplayEvent, q as MeshNode, a as Scene3D, c as Shell } from './strip-Nt7eJ-4E.js';
3
- export { R as ReplayFacts, S as StripItem, s as stripAt } from './strip-Nt7eJ-4E.js';
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
4
  import { ReplayOptions } from './replay.js';
5
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-BRIFxHL_.js';
6
+ export { F as FactsOptions, r as replayFacts } from './facts-Dje5wcHh.js';
7
7
 
8
8
  /**
9
9
  * A World that reads an `import`ed module relative to `baseDir` (the plan's own directory). It is
@@ -61,6 +61,8 @@ interface VideoOptions {
61
61
  ffmpeg?: string;
62
62
  /** libx264's constant rate factor for the MP4 (default 18; 0 is lossless: a master to re-encode). */
63
63
  crf?: number;
64
+ /** {@link withSupersample}: 1 (off) unless given; the key-frame baseline is taken without it. */
65
+ supersample?: number;
64
66
  }
65
67
  /** Render key frames (and, given `mp4`, every frame) of a replay HTML in headless Chromium. */
66
68
  declare function renderReplay(o: VideoOptions): Promise<VideoReport>;
package/dist/node.js CHANGED
@@ -20,10 +20,10 @@ import {
20
20
  signedVolume,
21
21
  viewerScript,
22
22
  writeGlb
23
- } from "./chunk-OWZWBKMI.js";
23
+ } from "./chunk-LMFD5NP4.js";
24
24
  import {
25
25
  replayFacts
26
- } from "./chunk-WCWLYIVD.js";
26
+ } from "./chunk-6WCS4TAT.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-4SQ5YKKX.js";
34
+ } from "./chunk-CX6IVI7I.js";
35
35
  import {
36
36
  stripAt
37
- } from "./chunk-EQBMPXB5.js";
37
+ } from "./chunk-TNNJ7CAO.js";
38
38
  export {
39
39
  GLB_GENERATOR,
40
40
  PREVIEW_ABOUT_URL,
package/dist/replay.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { g as MaterialSlot, n as FloorFinish, R as ReplayFacts, y as ReplayEvent, M as Mesh3D } from './strip-Nt7eJ-4E.js';
1
+ import { g as MaterialSlot, o as FloorFinish, R as ReplayFacts, J as ReplayEvent, M as Mesh3D } from './strip-CA-IAT0N.js';
2
+ import '@chanmeng666/archlang';
2
3
 
3
4
  /**
4
5
  * The replay's data (card A3), browser-safe: `replayPayload(mesh, opts)` is what a replay carries
@@ -29,6 +30,11 @@ interface ReplayNode {
29
30
  }>;
30
31
  /** A floor's finish (visual-assets V9, `extras.finish`), drawn in its colour; absent on every other node. */
31
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;
32
38
  }
33
39
  interface ReplayPayload {
34
40
  title: string;
@@ -45,6 +51,20 @@ interface ReplayPayload {
45
51
  facts?: ReplayFacts;
46
52
  nodes: ReplayNode[];
47
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;
48
68
  }
49
69
  /**
50
70
  * The line every surface that shows the preview carries (public-surfaces PS-D12, owner ruling
@@ -65,7 +85,7 @@ declare const PREVIEW_LABEL = "Same source, plan and 3D preview. The 3D preview
65
85
  * The limits line, always near a 3D view (PS-D12). It states what the package builds today
66
86
  * (`3d.md` §3): change it when the package changes.
67
87
  */
68
- declare const PREVIEW_LIMITS = "3D preview: walls, openings, floors, stairs and furniture in flat colours; no pitched roofs yet, and no sections, elevations or BIM.";
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.";
69
89
  /** The page that says what the 3D preview shows and does not (the docs site's `/3d`). */
70
90
  declare const PREVIEW_ABOUT_URL = "https://archlang.uk/3d";
71
91
  interface ReplayOptions {
@@ -1,3 +1,5 @@
1
+ import { RFence, ROutdoor } from '@chanmeng666/archlang';
2
+
1
3
  /**
2
4
  * Material slots (visual-assets card V1): the ONE palette both the GLB writer (`glb/write.ts`) and
3
5
  * the replay viewer (`replay/mount.ts`) read, so a piece's oak or ceramic is the same colour in
@@ -73,6 +75,66 @@ declare const FINISH_PALETTE: Readonly<Record<FloorFinish, SlotMaterial>>;
73
75
  declare const FLOOR_FINISH_RULES: ReadonlyArray<readonly [FloorFinish, readonly string[]]>;
74
76
  /** The finish {@link FLOOR_FINISH_RULES} gives a room with these `uses`. */
75
77
  declare function floorFinish(uses: readonly string[] | undefined): FloorFinish;
78
+ /**
79
+ * The core's ground tints (`Theme.lawn`, `Theme.paving`, `Theme.water`), one of which each `outdoor`
80
+ * kind is filled with in the drawing: the `tint` column of the core's `GROUND` table
81
+ * (`src/elements/outdoor.ts`), which the core does not export. Keyed by the core's own kind type, so
82
+ * a kind the core adds fails the typecheck here; `test/outdoor.test.ts` holds every row to the fill
83
+ * the core really draws (product-roadmap card RM8.3).
84
+ */
85
+ type GroundTint = "lawn" | "paving" | "water";
86
+ declare const GROUND_TINT: Readonly<Record<ROutdoor["surface"], GroundTint>>;
87
+ /**
88
+ * A drawing tint is a pale wash laid under a hatch; a 3D surface has no hatch, so it carries its
89
+ * colour alone. Its 3D colour is the wash laid on this many times over the theme's paper (`bg`):
90
+ * each channel `bg − k·(bg − tint)`, clamped to 0…255 (`groundColour`, `mesh/outdoor.ts`). With the
91
+ * default theme: lawn #99b76f, paving #ab9f87, water #699fc3. A drafting default, ledgered per kind
92
+ * (`outdoor-colour-theme`).
93
+ */
94
+ declare const GROUND_WASH = 6;
95
+ /**
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.
99
+ */
100
+ declare const SITE_PALETTE: {
101
+ readonly gravel: SlotMaterial;
102
+ readonly tarmac: SlotMaterial;
103
+ };
104
+ /**
105
+ * 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`).
110
+ */
111
+ declare const GROUND_SPLITS: Readonly<Partial<Record<ROutdoor["surface"], SlotMaterial>>>;
112
+ /** The GLB roughness of a ground surface in its theme colour, by tint (the viewer reads none). */
113
+ declare const GROUND_ROUGHNESS: Readonly<Record<GroundTint, number>>;
114
+ /**
115
+ * A fence's colour by style (the core draws a fence in line ink only): white-painted pickets, a
116
+ * timber panel in the palette's oak, posts and rail in its walnut. Ledgered per style
117
+ * (`fence-colour-default`).
118
+ */
119
+ declare const FENCE_PALETTE: Readonly<Record<RFence["style"], SlotMaterial>>;
120
+ /**
121
+ * The ground plane the replay draws round the building (card RM8.3): in the viewer only, never in
122
+ * the Mesh3D or the GLB, which hold only what the plan's elements build. Its top is the lowest
123
+ * storey's floor level (its slab's top), so a garden's surfaces lie flush in it; it reaches
124
+ * `marginMm` past everything drawn on every side. `light` and `dark` are its colours under the two
125
+ * replay themes. Ledgered in every Mesh3D (`ground-plane-viewer-only`) so a reader of the file
126
+ * knows the preview shows a ground the file does not contain.
127
+ */
128
+ declare const GROUND_PLANE: {
129
+ readonly light: "#e2ddd3";
130
+ readonly dark: "#16293d";
131
+ readonly marginMm: 6000;
132
+ };
133
+ /**
134
+ * An `outdoor` or `fence` colour under a replay theme: its own on the light theme; on the dark one,
135
+ * 60% of the way to `toward` (the theme's floor colour), the arithmetic of `slotColour`.
136
+ */
137
+ declare function siteColour(own: string, theme: "light" | "dark", toward: string): string;
76
138
  /** sRGB `#rrggbb` → linear RGB, each channel rounded to 4 decimals (glTF base colours are linear). */
77
139
  declare function linearRgb(hex: string): [number, number, number];
78
140
  /**
@@ -344,7 +406,7 @@ interface Shell {
344
406
  /** A T0 part's material slot (`materials.ts`); absent = `body`, the node kind's own colour. */
345
407
  slot?: Exclude<MaterialSlot, "body">;
346
408
  }
347
- type NodeKind = "slab" | "floor" | "column" | "wall" | "door" | "window" | "opening" | "furniture" | "roof" | "stair";
409
+ type NodeKind = "slab" | "floor" | "column" | "wall" | "door" | "window" | "opening" | "furniture" | "roof" | "stair" | "outdoor" | "fence";
348
410
  interface MeshNode {
349
411
  /** `L<level>/<kind>:<id>[:<part>]`, unique in the mesh (plan §3.6). */
350
412
  key: string;
@@ -376,8 +438,9 @@ interface Mesh3D {
376
438
  * draws itself in its authoring order, then rises:
377
439
  *
378
440
  * 0.00–0.40 top-down: each node's footprint appears, flat, in stage order
379
- * brief (slab) → rooms (floors) → walls (columns, exterior walls, the rest) →
380
- * openings (doors, windows) → fixtures (catalogued fixtures, then loose furniture);
441
+ * brief (slab, then the site's surfaces) → rooms (floors) → walls (columns,
442
+ * exterior walls, the rest, stairs, fences) → openings (doors, windows) → fixtures
443
+ * (catalogued fixtures, then loose furniture);
381
444
  * source order inside a group;
382
445
  * 0.40–0.55 the core's own drawing (its SVG) fades in over the footprints and holds;
383
446
  * 0.55–1.00 the drawing fades out as the camera tilts to a 45° elevation with a narrow-lens
@@ -530,6 +593,13 @@ interface ReplayState {
530
593
  settle: number;
531
594
  /** Opacity of the core's drawing over the scene. */
532
595
  svg: number;
596
+ /**
597
+ * The viewer's ground plane's opacity, 0…1 (card RM8.3, `GROUND_PLANE`): 0 until the core's drawing
598
+ * starts to fade (`PHASE.rise`), then it fades in as the drawing fades out (`1 − svg`), opaque from
599
+ * `PHASE.svgOut`. So the top-down phase draws the plan on the page as before, and no frame shows
600
+ * the ground appear at once where the drawing does not cover it (the letterbox bars; review R1, S1).
601
+ */
602
+ ground: number;
533
603
  nodes: Map<string, NodeState>;
534
604
  }
535
605
  /** The whole state of the replay at `t` (0…1): a pure function of `t` and the event table. */
@@ -585,4 +655,4 @@ interface StripItem {
585
655
  */
586
656
  declare function stripAt(facts: ReplayFacts, events: readonly ReplayEvent[], t: number): StripItem[];
587
657
 
588
- export { finishColour as $, type Assumption as A, type ReplayView as B, type Roof as C, type DoorKind as D, EXPLODE_GAP_MM as E, type Floor as F, STAIR_MATERIAL as G, STOP_LEAD as H, type Side as I, type SlotMaterial 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 Source as Q, type ReplayFacts as R, type StripItem as S, type Stage as T, type StairLanding as U, type Um as V, WALL_CAP_SRGB as W, type Wall as X, authoringOrder as Y, ease as Z, explodeLifts as _, type Scene3D as a, floorFinish as a0, keyFrames as a1, linearRgb as a2, slotColour as a3, slotGroups as a4, stateAt as a5, storeysOf as a6, timeline as a7, viewLabel as a8, viewMesh as a9, 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, 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 ReplayEvent as y, type ReplayState as z };
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 };