@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/cli.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  DOOR_POSES,
4
4
  adaptPlan,
5
5
  buildMesh
6
- } from "./chunk-VXGQYUMN.js";
6
+ } from "./chunk-WARUDAOQ.js";
7
7
  import {
8
8
  SWIFTSHADER_ARGS,
9
9
  checkGlb,
@@ -13,18 +13,18 @@ import {
13
13
  renderReplay,
14
14
  replayHtml,
15
15
  writeGlb
16
- } from "./chunk-LMFD5NP4.js";
16
+ } from "./chunk-MCASL4MM.js";
17
17
  import {
18
18
  ARCHLANG_3D_VERSION,
19
19
  replayFacts
20
- } from "./chunk-6WCS4TAT.js";
21
- import "./chunk-CX6IVI7I.js";
20
+ } from "./chunk-B4PZWWSP.js";
21
+ import "./chunk-VMVKI2WQ.js";
22
22
  import {
23
23
  storeysOf,
24
24
  timeline,
25
25
  viewLabel,
26
26
  viewMesh
27
- } from "./chunk-TNNJ7CAO.js";
27
+ } from "./chunk-LNIVDMPG.js";
28
28
 
29
29
  // src/cli/run.ts
30
30
  import { readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
@@ -599,6 +599,11 @@ ${VIEW_USAGE}
599
599
  const f = replayFacts(source, { world, storeys, view: view2 });
600
600
  return f ? { facts: f } : {};
601
601
  };
602
+ const noticesOf = (view2) => r.warnings.filter((w) => view2 === "all" || w.level === storeys[view2 - 1]).map((w) => ({
603
+ code: w.code,
604
+ message: w.message,
605
+ ...view2 === "all" && storeys.length > 1 ? { level: w.level } : {}
606
+ }));
602
607
  const htmlOf = (view2) => replayHtml(viewMesh(mesh, view2), {
603
608
  title: r.scene.meta.name,
604
609
  svg: svgOf(view2),
@@ -606,7 +611,8 @@ ${VIEW_USAGE}
606
611
  height: args.height,
607
612
  seconds: args.seconds,
608
613
  theme: args.theme,
609
- ...facts(view2)
614
+ ...facts(view2),
615
+ notices: noticesOf(view2)
610
616
  });
611
617
  const html = await htmlOf(args.storey);
612
618
  try {
@@ -1,5 +1,5 @@
1
1
  import { World } from '@chanmeng666/archlang';
2
- import { T as ReplayView, R as ReplayFacts } from './strip-CA-IAT0N.js';
2
+ import { a5 as ReplayView, d as ReplayFacts } from './payload-DwiB2P7x.js';
3
3
 
4
4
  /**
5
5
  * The metrics strip's numbers (card G4), read from the core's public `describe()` and `lint()` for
package/dist/index.d.ts CHANGED
@@ -1,33 +1,10 @@
1
1
  import * as _chanmeng666_archlang from '@chanmeng666/archlang';
2
- import { ResolvedPlan, RWall, Point, JoinedCut, loopsToPolygons, World, Diagnostic } from '@chanmeng666/archlang';
2
+ import { RWall, Point, JoinedCut, loopsToPolygons, ResolvedPlan, World, Diagnostic } from '@chanmeng666/archlang';
3
3
  export { Point } from '@chanmeng666/archlang';
4
- import { a as Scene3D, F as Floor, P as Polygon, M as Mesh3D, b as Pt, c as Shell, d as Ring3, A as Assumption, e as StairFlight, f as Stair, g as MaterialSlot, h as Furniture, i as Fence, G as GroundTint } from './strip-CA-IAT0N.js';
5
- export { D as DoorKind, E as EXPLODE_GAP_MM, j as FENCE_PALETTE, k as FINISH_PALETTE, l as FIXTURE_FAMILIES, m as FLOOR_FINISHES, n as FLOOR_FINISH_RULES, o as FloorFinish, p as GROUND_PLANE, q as GROUND_ROUGHNESS, r as GROUND_SPLITS, t as GROUND_TINT, u as GROUND_WASH, K as KIND_PALETTE, v as KindMaterial, L as Level, w as MATERIAL_SLOTS, x as MeshNode, y as Meta, N as NodeKind, z as NodeState, O as Opening, B as Outdoor, C as PALETTE, H as PHASE, I as Provenance, J as ReplayEvent, R as ReplayFacts, Q as ReplayState, T as ReplayView, U as Roof, V as SITE_PALETTE, W as STAIR_MATERIAL, X as STOP_LEAD, Y as Side, Z as SlotMaterial, _ as Source, $ as Stage, a0 as StairLanding, S as StripItem, a1 as Um, a2 as WALL_CAP_SRGB, a3 as Wall, a4 as authoringOrder, a5 as ease, a6 as explodeLifts, a7 as finishColour, a8 as floorFinish, a9 as keyFrames, aa as linearRgb, ab as siteColour, ac as slotColour, ad as slotGroups, ae as stateAt, af as storeysOf, s as stripAt, ag as timeline, ah as viewLabel, ai as viewMesh } from './strip-CA-IAT0N.js';
6
- export { F as FactsOptions, r as replayFacts } from './facts-Dje5wcHh.js';
7
- export { B as Box, E as ELEVATION_AZIMUTH, a as ELEVATION_RANGE, b as END_AZIMUTH, c as END_FOV, d as EndCamera, F as FILL, e as FrameCamera, O as Orbit, f as PRESET_NAMES, P as PresetName, S as START_FOV, V as Vec3, g as ViewScene, Z as ZOOM, h as boxOfNodes, i as cameraAtStop, j as cameraStops, k as corners, l as coverage, m as distanceLimits, n as drawingFrame, o as endElevation, p as fitEndCamera, q as frameCamera, r as pivotAbove, s as presetCamera, t as projectBox, u as settledLift, v as stopCount, w as takenLens, x as targetBounds } from './camera-DcyxtBjK.js';
8
-
9
- /** The package's own version, stamped into `meta.tool`. */
10
- declare const ARCHLANG_3D_VERSION: string;
11
- /** A resolved storey: its number, name and IR. */
12
- interface Storey {
13
- level: number;
14
- name?: string;
15
- ir: ResolvedPlan;
16
- }
17
- interface BuildOptions {
18
- /** The core version the plan was resolved with, stamped into `meta.tool.archlang`. */
19
- coreVersion: string;
20
- /** Largest sagitta (mm) of an arc's chords; default {@link DEFAULT_CURVE_TOL_MM}. */
21
- curveTolMm?: number;
22
- /**
23
- * Per storey (in `storeys` order), the ids of the furniture the plan reflects, or `null` where
24
- * that is unknown; read only for a handed asset (`T0_HANDED`). Omitted: unknown everywhere, so a
25
- * handed piece stands as a grey box. `adaptPlan` fills it from the core's Plan JSON.
26
- */
27
- mirrored?: ReadonlyArray<ReadonlySet<string> | null>;
28
- }
29
- /** Resolved storeys (lowest first) → a Scene3D v0. */
30
- declare function buildScene3D(storeys: readonly Storey[], opts: BuildOptions): Scene3D;
4
+ import { g as Scene3D, F as Floor, h as Polygon, M as Mesh3D, i as Pt, j as Shell, k as Ring3, A as Assumption, O as Opening, L as Level, l as Side, m as Stair, o as StairFlight, p as StairLanding, q as MaterialSlot, t as Furniture, u as Fence, G as GroundTint, e as ReplayNode } from './payload-DwiB2P7x.js';
5
+ export { C as CONTACT_SHADOW, D as DoorKind, E as EXPLODE_GAP_MM, w as FENCE_PALETTE, x as FINISH_PALETTE, y as FIXTURE_FAMILIES, z as FLOOR_FINISHES, B as FLOOR_FINISH_RULES, H as FLOOR_WORD_FINISH, I as FloorFinish, J as GROUND_PLANE, K as GROUND_ROUGHNESS, N as GROUND_SPLITS, Q as GROUND_TINT, T as GROUND_WASH, U as KIND_PALETTE, V as KindMaterial, W as MATERIAL_SLOTS, X as MeshNode, Y as Meta, Z as NodeKind, _ as NodeState, $ as Outdoor, a0 as PALETTE, a1 as PHASE, a2 as Provenance, a3 as ReplayEvent, d as ReplayFacts, a4 as ReplayState, a5 as ReplayView, a6 as Roof, a7 as SITE_PALETTE, a8 as STAIR_MATERIAL, a9 as STAIR_RAIL_MATERIAL, aa as STOP_LEAD, ab as SlotMaterial, ac as Source, ad as Stage, S as StripItem, ae as TRIM_MATERIAL, af as Um, ag as WALL_CAP_SRGB, ah as Wall, ai as authoringOrder, aj as contactBandMm, ak as ease, al as explodeLifts, am as finishColour, an as floorFinish, ao as keyFrames, ap as linearRgb, aq as siteColour, ar as slotColour, as as slotGroups, at as stateAt, au as storeysOf, s as stripAt, av as timeline, aw as viewLabel, ax as viewMesh, ay as wordFinish } from './payload-DwiB2P7x.js';
6
+ export { F as FactsOptions, r as replayFacts } from './facts-CsO0xtFw.js';
7
+ export { B as Box, E as ELEVATION_AZIMUTH, a as ELEVATION_RANGE, b as END_AZIMUTH, c as END_FOV, d as EndCamera, F as FILL, e as FrameCamera, O as Orbit, f as PRESET_NAMES, P as PresetName, S as START_FOV, V as Vec3, g as ViewScene, Z as ZOOM, h as boxOfNodes, i as cameraAtStop, j as cameraStops, k as corners, l as coverage, m as distanceLimits, n as drawingFrame, o as endElevation, p as fitEndCamera, q as frameCamera, r as pivotAbove, s as presetCamera, t as projectBox, u as settledLift, v as stopCount, w as takenLens, x as targetBounds } from './camera-BAsRq_eC.js';
31
8
 
32
9
  /** A ring of plan points (mm), as `loopsToPolygons` returns it: closed, no repeated vertex. */
33
10
  type Ring = Point[];
@@ -95,6 +72,29 @@ interface MixedHeightJoint {
95
72
  */
96
73
  declare function mixedHeightJoints(own: Ownership): MixedHeightJoint[];
97
74
 
75
+ /** The package's own version, stamped into `meta.tool`. */
76
+ declare const ARCHLANG_3D_VERSION: string;
77
+ /** A resolved storey: its number, name and IR. */
78
+ interface Storey {
79
+ level: number;
80
+ name?: string;
81
+ ir: ResolvedPlan;
82
+ }
83
+ interface BuildOptions {
84
+ /** The core version the plan was resolved with, stamped into `meta.tool.archlang`. */
85
+ coreVersion: string;
86
+ /** Largest sagitta (mm) of an arc's chords; default {@link DEFAULT_CURVE_TOL_MM}. */
87
+ curveTolMm?: number;
88
+ /**
89
+ * Per storey (in `storeys` order), the ids of the furniture the plan reflects, or `null` where
90
+ * that is unknown; read only for a handed asset (`T0_HANDED`). Omitted: unknown everywhere, so a
91
+ * handed piece stands as a grey box. `adaptPlan` fills it from the core's Plan JSON.
92
+ */
93
+ mirrored?: ReadonlyArray<ReadonlySet<string> | null>;
94
+ }
95
+ /** Resolved storeys (lowest first) → a Scene3D v0. */
96
+ declare function buildScene3D(storeys: readonly Storey[], opts: BuildOptions): Scene3D;
97
+
98
98
  /** More than this much overlap (µm², i.e. 1 cm²) is reported and lifted (plan §4.2). */
99
99
  declare const FLOOR_OVERLAP_MIN_UM2 = 100000000;
100
100
  /** The lift per step (µm): 0.5 mm. */
@@ -148,12 +148,13 @@ interface AdaptOptions {
148
148
  /**
149
149
  * The first core release that carries every export this package reads: the seam (`resolvePlan`,
150
150
  * ADR 0031) arrived in 1.44.0, `hatchKey`/`hatchOf` (card A0b) in 1.45.0, `treadCount` (the
151
- * stairs, amendment 2026-11-06 to ADR 0031) in 1.57.0. An older core still builds everything but
152
- * the stairs (`stair-no-flights`); only a core without `resolvePlan` or `hatchKey` is refused,
153
- * `E3D_CORE_TOO_OLD`. Kept equal to the
151
+ * stairs, amendment 2026-11-06 to ADR 0031) in 1.57.0, `winderTreads` (a `winders` landing's
152
+ * treads, amendment 2026-11-14) in 1.61.0. An older core still builds everything but the stairs
153
+ * (`stair-no-flights`) and a `winders` landing's treads (`stair-winders-not-read`); only a core
154
+ * without `resolvePlan` or `hatchKey` is refused, `E3D_CORE_TOO_OLD`. Kept equal to the
154
155
  * `peerDependencies` floor (`test/package-meta.test.ts`).
155
156
  */
156
- declare const MIN_CORE = "1.57.0";
157
+ declare const MIN_CORE = "1.61.0";
157
158
  declare function adaptPlan(source: string, opts?: AdaptOptions): AdaptResult;
158
159
 
159
160
  /**
@@ -293,8 +294,131 @@ declare function rectsOf(r: readonly Pt[]): Rect[];
293
294
  declare function slabRegion(footprint: readonly Ring3[], floors: readonly Floor[], ledger: Assumption[]): Polygon[];
294
295
 
295
296
  /**
296
- * A stair as stepped solids (card X3), from the Scene3D's flights and landings, which are the
297
- * core's own (`scene3d/build.ts`): nothing here re-derives a stair from its bounding box.
297
+ * The trim of a doorway and a window (product-roadmap card RM8.6; design
298
+ * `docs/plans/product-roadmap/design/visual-language.md` §2.1, §2.2), as parts of the opening's
299
+ * node, every size a clamped share of the host wall's thickness `t`, rounded to a whole millimetre:
300
+ *
301
+ * - a door (every kind) and a cased `opening`: a lining on the two jamb faces and the head, `l` =
302
+ * 0.1 t in [12, 25] thick along the wall; a door's in two halves across the wall, a 40 mm slot
303
+ * between them for the leaf (which keeps its length and place, so it stays the core's `doorLeaves`
304
+ * leaf); and a casing (architrave) on each wall face, `c` = 0.35 t in [50, 90] wide and `p` =
305
+ * 0.1 t in [10, 20] proud, its legs from the floor to the head, its head piece over the full width,
306
+ * cut at the wall's top (none when the head is at the top). A barn door has no casing on the face
307
+ * its panel hangs on (the core's `swing`), a garage door none at all, a door on a curved host no
308
+ * trim (its closed leaf is the chord between its jambs; a cased opening there keeps its lining,
309
+ * along the arc), and a leg that would stand in a wall or a column (a doorway at a corner), in
310
+ * standing furniture (not a rug: `FLAT_MM`), in another doorway or in another doorway's casing
311
+ * (two doorways side by side: both legs) is left out, never shortened, its head piece then
312
+ * stopping at that jamb;
313
+ * - a window: on the interior half of the cut, a reveal lining 0.075 t in [10, 20] on the jambs and
314
+ * the head, in the frame's colour; on its sill, an exterior sill 0.15 t in [20, 40] thick, proud
315
+ * of the outside face by 0.2 t and past each jamb by 0.2 t (the core's `SILL_PROJECTION` and
316
+ * `SILL_HORN`, of the host's own `t`), and an interior board 0.1 t in [18, 30] thick, past the
317
+ * inside face and each jamb by 0.1 t in [15, 30]. Which face is outside is the core's own rule
318
+ * (`exteriorNormal`, `src/elements/window.ts`): one wall thickness off each face, the side with no
319
+ * room or void of the storey there. Inside on both sides (an interior window): a reveal on both
320
+ * halves, no sill; on neither (a free-standing wall): nothing. A window with no sill (`sill 0`)
321
+ * has neither sill nor board. At a mitred end (a window run to a corner) a sill or a board stops
322
+ * on the mitre, past no jamb, and an end that would stand in a neighbour's doorway, casing, sill
323
+ * or board stops at its jamb (`window-sill-horn-omitted`); on a curved host the reveals follow the
324
+ * arc and the sill and the board stay inside the cut.
325
+ *
326
+ * A storey's trim is decided all at once (`storeyTrim`), never in the order the plan writes its
327
+ * openings: every casing before any sill or board (a casing beats a horn), and two casing legs, or
328
+ * two windows' horns or spans, that meet are both left out or cut back, so a plan's trim is the same whatever order
329
+ * its openings are written in, and a mirror-symmetric plan gets mirror-symmetric trim (RM8.6b).
330
+ *
331
+ * Every part is square to its wall, built in its jamb frame and rounded to whole micrometres; every
332
+ * shell closed (`prism`). Each default is ledgered per opening (ADR 0030 decision 5).
333
+ */
334
+
335
+ /** The trim's sizes (mm) for a host `t` mm thick (design §2.1, §2.2). */
336
+ declare const OPENING_DETAIL: {
337
+ /** The slot a door's lining leaves for its leaf: the leaf's own thickness (`LEAF_MM`). */
338
+ readonly slot: 40;
339
+ readonly lining: (t: number) => number;
340
+ readonly casingWidth: (t: number) => number;
341
+ readonly casingProud: (t: number) => number;
342
+ readonly sillThickness: (t: number) => number;
343
+ /** The core's `SILL_PROJECTION` and `SILL_HORN` (both 0.2 of the host's thickness). */
344
+ readonly sillProjection: (t: number) => number;
345
+ readonly sillHorn: (t: number) => number;
346
+ readonly boardThickness: (t: number) => number;
347
+ readonly boardOverhang: (t: number) => number;
348
+ readonly reveal: (t: number) => number;
349
+ /** The window frame's half depth (`FRAME_DEPTH_MM` / 2): where the reveal and the sills start. */
350
+ readonly frameHalfDepth: 30;
351
+ };
352
+ /** One part of an opening's node: its name and its shells (a `null` one was degenerate). */
353
+ interface TrimPart {
354
+ part: "lining" | "casing" | "sill" | "board" | "reveal";
355
+ shells: Array<Shell | null>;
356
+ }
357
+ /**
358
+ * The side of the frame (`+1`: `+v`, `−1`: `−v`) a room or void lies on, one wall thickness off each
359
+ * face at the opening's centre (the core's `exteriorNormal`, through `wallFaceProbes`): `"both"` for
360
+ * an interior window, `null` for one on a free-standing wall.
361
+ */
362
+ declare function insideOf(o: Opening, t: number, level: Level): 1 | -1 | "both" | null;
363
+ /**
364
+ * What a trim piece can stand in: one class per kind of obstacle a piece is tested against. A
365
+ * neighbour's doorway (its cut and a casing's depth off each face) is three of them:
366
+ * - `opening`: between its sill and its head, what a casing is tested against (above a door's head
367
+ * is its lintel, which a neighbour's casing may well pass in front of);
368
+ * - `doorway`: at every height, what a sill's or a board's span is tested against;
369
+ * - `jamb`: at every height and a millimetre wider each way along its wall, what a sill's or a
370
+ * board's horn is tested against. Its pier's jamb face runs from the floor to the wall's top
371
+ * whatever the doorway's own height, so a horn ending flush with it (a horn exactly as long as the
372
+ * pier is wide) would share that face at any height (RM8.6b n2; the coplanar check found it).
373
+ */
374
+ type ObstacleClass = "wall" | "column" | "furniture" | "opening" | "doorway" | "jamb" | "trim";
375
+ /** Furniture lower than this (mm) lies flat on the floor (a rug, a mat): trim passes through it. */
376
+ declare const FLAT_MM = 50;
377
+ /** The extruder `build.ts` counts degenerate holes with. */
378
+ type Prism = (poly: Polygon, z0: number, z1: number) => Shell | null;
379
+ /** One opening the storey's trim is built for. */
380
+ interface TrimInput {
381
+ o: Opening;
382
+ /** The host's thickness (µm). */
383
+ t: number;
384
+ /** The head as built (µm over `e`; the opening's head capped at the host's built top). */
385
+ head: number;
386
+ /** The host's built top (µm over `e`). */
387
+ top: number;
388
+ }
389
+ /** An opening's trim: its parts (each a part of its node) and the ledger rows that say what was assumed. */
390
+ interface TrimResult {
391
+ parts: TrimPart[];
392
+ ledger: Assumption[];
393
+ }
394
+ /**
395
+ * The trim of every opening of a storey (product-roadmap RM8.6, RM8.6b), decided all at once so it
396
+ * never depends on the order the plan writes its openings in (review of PR #729, S1):
397
+ *
398
+ * 1. Each doorway's casing legs are tested against the storey's fixed obstacles (`fixedObstacles`)
399
+ * and every OTHER doorway's casing legs as planned. A leg that meets one is left out, never
400
+ * shortened; two legs that meet each other are both left out (two doorways closer than two
401
+ * casings), so neither doorway wins by coming first and a symmetric plan stays symmetric.
402
+ * 2. Each head piece's two ends past the jambs, one at a time (S3): an end is cut back to its jamb
403
+ * when its leg was left out, or when it meets a fixed obstacle (a neighbour's doorway above this
404
+ * one's head, a wall, a column, tall furniture); its span between the jambs is left out when it
405
+ * meets a fixed obstacle. Another doorway's casing cannot reach either: an end stands over its own
406
+ * leg, which met that casing first, and the span over its own doorway, which that casing's leg met
407
+ * first.
408
+ * 3. Only then each window's sill and board, a casing beating a horn: each horn past a jamb is cut
409
+ * back when it meets a neighbour's jamb (`jamb`), any built casing, or another window's sill or
410
+ * board as planned (both cut); a sill or board whose span meets a neighbour's doorway
411
+ * (`doorway`), a built casing or another window's span is left out. The reveal stands on the
412
+ * board, or on the sill block when the board is left out.
413
+ *
414
+ * Every omission is ledgered with what it met, end by end.
415
+ */
416
+ declare function storeyTrim(level: Level, inputs: readonly TrimInput[], e: number, prism: Prism, furnitureZ: (f: Level["furniture"][number]) => [number, number]): Map<string, TrimResult>;
417
+
418
+ /**
419
+ * A stair as stepped solids (card X3, `stairSolid`) and in its parts (card RM8.6, `stairDetail`:
420
+ * what the mesh builds), from the Scene3D's flights and landings, which are the core's own
421
+ * (`scene3d/build.ts`): nothing here re-derives a stair from its bounding box. The solid:
298
422
  *
299
423
  * - Risers: one per tread the plan draws on a flight, plus one more at its head, because a flight's
300
424
  * last riser lands on the landing or the floor above. So a stair of flights with `n₁ … n_F` treads
@@ -304,12 +428,20 @@ declare function slabRegion(footprint: readonly Ring3[], floors: readonly Floor[
304
428
  * (the stair's `width`, centred across the flight, as the drawing centres it), each tread
305
429
  * `run / treads` deep, on the drawing's tread lines. It is solid down to the stair's floor `z0`.
306
430
  * - A landing: a closed box over its rectangle, from `z0` up to the riser its flight ends on.
431
+ * - A `winders <n>` landing (card RM1.2g): its `n` tapered treads (`StairLanding.winders`, cut by
432
+ * the lines the core draws across it), each a closed prism from `z0`, the first at the riser its
433
+ * flight ends on and each next one riser higher. So it climbs `n - 1` risers more than a level
434
+ * landing, one per line the plan draws across it, the risers `W_STAIR_RISER_TOO_HIGH` counts.
307
435
  *
308
436
  * Every shell is closed and wound outward (`prism`), in integer micrometres and glTF axes.
309
437
  */
310
438
 
311
- /** How many risers a stair of these flights climbs: each flight's treads plus its head riser. */
312
- declare function stairRisers(flights: readonly Pick<StairFlight, "treads">[]): number;
439
+ /**
440
+ * How many risers a stair of these flights climbs: each flight's treads plus its head riser, and
441
+ * on each `winders <n>` landing between two of them (card RM1.2g) `n - 1` more, one per line the
442
+ * plan draws across it.
443
+ */
444
+ declare function stairRisers(flights: readonly Pick<StairFlight, "treads">[], landings?: readonly Pick<StairLanding, "winders">[]): number;
313
445
  /** A stair's solids, how many risers it climbs, and the height each landing stands at. */
314
446
  interface StairSolid {
315
447
  shells: Shell[];
@@ -327,6 +459,101 @@ interface StairSolid {
327
459
  declare function stairSolid(stair: Stair, z0: number, rise: number): (StairSolid & {
328
460
  dropped: number;
329
461
  }) | null;
462
+ /**
463
+ * The drafting defaults a stair's parts are built to (mm), each a clamped share of its own geometry
464
+ * (design `docs/plans/product-roadmap/design/visual-language.md` §2.3): `r` the riser (`rise / R`),
465
+ * `g` a flight's going (`run / treads`), `W` the flight band's width. They are drawing defaults,
466
+ * never a check against any regulation.
467
+ */
468
+ declare const STAIR_DETAIL: {
469
+ /** A tread board, 0.25 r in [30, 50] thick (never more than half a riser). */
470
+ readonly tread: (r: number) => number;
471
+ /** Its nosing past the front edge (not on a flight's first tread), 0.1 g in [15, 30]. */
472
+ readonly nosing: (g: number) => number;
473
+ /** A stringer, 0.05 W in [40, 60] wide (at most a quarter of the band). */
474
+ readonly stringer: (W: number) => number;
475
+ /** The stringer's band: 0.3 r in [40, 60] over the nosing line, 1.2 r in [150, 250] under it. */
476
+ readonly above: (r: number) => number;
477
+ readonly below: (r: number) => number;
478
+ /** The handrail's top over the nosing line (measured upright), and its 50 × 50 section. */
479
+ readonly railHeight: 900;
480
+ readonly rail: 50;
481
+ /** A baluster a tread, 0.03 W in [20, 30] square. */
482
+ readonly baluster: (W: number) => number;
483
+ /** A newel at each end of a flight, 0.06 W in [60, 90] square, this far over the handrail. */
484
+ readonly newel: (W: number) => number;
485
+ readonly newelAbove: 100;
486
+ /** A landing's open edge: its handrail's top over the landing; balusters a going apart. */
487
+ readonly landingRailHeight: 1000;
488
+ /** How far past an edge the wall probe looks. */
489
+ readonly probe: 100;
490
+ };
491
+ /** What a flight's long edge, or a landing's edge, has past it (the probe's answer). */
492
+ interface StairSide {
493
+ /** `flight <k>` or `landing <k>`, 1-based in climbing order. */
494
+ of: string;
495
+ side: Side;
496
+ /**
497
+ * `flight` / `landing`: the stair's other flights (and landings) lie past the whole edge; `newel`: a
498
+ * landing edge open past it, but wholly held by the flights' newels standing on it.
499
+ */
500
+ against: "wall" | "open" | "flight" | "landing" | "newel";
501
+ }
502
+ /** A stair built in its parts (RM8.6): treads and landings, stringers, the balustrade. */
503
+ interface StairDetail {
504
+ /** The treads (the risers open) and the solid landings: the stair node's own shells. */
505
+ treads: Shell[];
506
+ stringers: Shell[];
507
+ /** Handrails, balusters and newels. */
508
+ rails: Shell[];
509
+ risers: number;
510
+ /** Shells left out as degenerate. */
511
+ dropped: number;
512
+ /** Every edge the probe looked past, in climbing order. */
513
+ sides: StairSide[];
514
+ /** The sizes used (mm). */
515
+ dims: {
516
+ tread: number;
517
+ nosing: number[];
518
+ stringer: {
519
+ width: number;
520
+ above: number;
521
+ below: number;
522
+ };
523
+ balustrade: {
524
+ height: number;
525
+ rail: [number, number];
526
+ baluster: number;
527
+ newel: number;
528
+ newel_above: number;
529
+ landing_height: number;
530
+ };
531
+ };
532
+ }
533
+ /**
534
+ * `stair` climbing `rise` µm from `z0`, in its parts (product-roadmap RM8.6; design
535
+ * `visual-language.md` §2.3), or `null` where `stairSolid` refuses one. Every tread top is
536
+ * `stairSolid`'s riser top (`z0 + round(rise·k/R)`), so the climb is the same; the stair is built:
537
+ *
538
+ * - each tread a board `STAIR_DETAIL.tread` thick under its riser top, from its tread line (less
539
+ * the nosing, but on a flight's first tread) to the next, between the two stringers (so no face
540
+ * of a tread lies in a stringer's); the risers are open;
541
+ * - two stringers on the flight band's long edges, their side section the band from `below` under
542
+ * to `above` over the nosing line (through the tread tops' front edges), clipped to the run and
543
+ * to `[z0, the flight's head]`;
544
+ * - each landing a solid box, as before;
545
+ * - a balustrade on each long edge the probe finds open (`solidAt` false 100 mm past it at mid-run;
546
+ * the caller answers from the storey's wall bodies and columns): a sloping handrail centred on the
547
+ * stringer, a baluster under the middle of each tread from inside the stringer to inside the rail,
548
+ * a newel centred on each end of the flight; on a landing's open edge (no flight and no wall past
549
+ * it) a level handrail inside the edge with balusters a going apart, stopping where a newel or an
550
+ * earlier rail already stands.
551
+ *
552
+ * Square to the plan, integer micrometres, every shell closed and wound outward (`prism`,
553
+ * `sideways`). Read from the shape alone: a mirrored plan probes the mirrored edges and builds the
554
+ * mirrored stair, so nothing gains a hand.
555
+ */
556
+ declare function stairDetail(stair: Stair, z0: number, rise: number, solidAt: (p: Pt) => boolean): StairDetail | null;
330
557
 
331
558
  /**
332
559
  * The T0 kit (visual-assets V2, V5, V6): the part type every generator returns and the few helpers
@@ -371,7 +598,24 @@ interface Part extends SectionShape {
371
598
  z0: number;
372
599
  z1: number;
373
600
  }>;
601
+ /**
602
+ * A lofted part (product-roadmap RM8.6, backlog VA.1): its section (`round`, `radius` or a box)
603
+ * placed as one ring at the bottom and one at each height of this table, each `[height as a
604
+ * fraction of y0..y1, scale as a fraction of the box's half-extents]` about the box's centre,
605
+ * neighbouring rings joined by quads and the bottom and top rings capped: one closed shell whose
606
+ * silhouette slopes from ring to ring instead of stepping. Vertical parts only, no holes, no
607
+ * `profile`; its widest ring should scale 1, so the shell spans its box.
608
+ */
609
+ loft?: DomeTable;
374
610
  }
611
+ /**
612
+ * A dome's profile, each row `[a height as a fraction of the dome's, its radius there as a fraction
613
+ * of the half-extents]` (once the top of a stacked tier; since RM8.6 a lofted ring, `Part.loft`).
614
+ * The tables (`t0-outdoor.ts`) slice an ellipsoid at equal steps of latitude (15°), so the rings
615
+ * crowd toward the top and the dome rounds over; the radii are cos(mid-latitude), the widest scaled
616
+ * to 1, written out (no engine's `Math.cos` reaches a coordinate).
617
+ */
618
+ type DomeTable = ReadonlyArray<readonly [number, number]>;
375
619
 
376
620
  /**
377
621
  * T0 parametric furniture (archlang-3d plan §4.4, §5.1–5.3; card A2b; visual-assets V1–V3,
@@ -562,4 +806,64 @@ declare function fencePieces(f: Pick<Fence, "points" | "closed" | "style">, prof
562
806
  z: readonly [number, number];
563
807
  }>;
564
808
 
565
- export { ARCHLANG_3D_VERSION, type AdaptOptions, type AdaptResult, Assumption, type BuildOptions, CORE_POSTS_PER_RUN, CORE_POST_PITCH_MM, type CutSector, DOOR_POSES, type DoorPose, FENCE_HEIGHT_MM, FENCE_PROFILES, FLOOR_LIFT_UM, FLOOR_OVERLAP_MIN_UM2, FURNITURE_HEIGHT_MM, Fence, type FenceProfile, Floor, type FloorOverlap, Furniture, GroundTint, MAX_FENCE_REPEAT, MIN_CORE, MaterialSlot, Mesh3D, type MeshOptions, type MixedHeightJoint, OUTDOOR_MM, type OwnedWall, type Ownership, type Part, type Piece, Polygon, Pt, type Refusal, type RefusalCode, type Ring, Ring3, Scene3D, type SectionShape, Shell, Stair, StairFlight, type StairSolid, type Storey, T0_FAMILIES, T0_HANDED, T0_HEIGHT_MM, T0_HUNG_FROM_TOP, T0_MATERIALS, T0_MOUNT_MM, type ValidationIssue, type Warning3D, adaptPlan, assetFor, buildMesh, buildScene3D, clipToConvex, corePostCount, cutSector, fenceColour, fencePieces, fencePosts, fenceRuns, floorLifts, floorOverlaps, groundColour, handedAt, insideCut, mixedHeightJoints, openLeaf, outdoorColour, overlapArea, partShell, piecesOf, piecesTouch, prism, rectsOf, sectionRing, sectorBand, slab2d, slabRegion, stairRisers, stairSolid, t0LocalParts, t0Shells, um, umPoint, validateScene3D, wallOwnership };
809
+ /** The three buffers of a storey (see the header). */
810
+ type ShadowClass = "foot" | "corner" | "halo";
811
+ interface ShadowLayer {
812
+ /** The storey's level (its nodes' key prefix `L<level>/`). */
813
+ level: number;
814
+ cls: ShadowClass;
815
+ /** Flat `[x, y, z, …]` in µm, the nodes' axes (X plan x, Y up, Z plan y). */
816
+ positions: number[];
817
+ /** Per vertex: 1 on a band's inner edge, 0 on its outer edge (times its class's alpha when drawn). */
818
+ weight: number[];
819
+ /** Per vertex: its caster (`ContactShadows.casters`), whose rise fades it in. */
820
+ caster: number[];
821
+ indices: number[];
822
+ }
823
+ interface ContactShadows {
824
+ layers: ShadowLayer[];
825
+ /** Each caster: the node keys whose rise fades its bands in (the last of them up decides). */
826
+ casters: string[][];
827
+ /** What was built and how much was looked up, for the structural bounds (`test/shadows.test.ts`). */
828
+ counts: {
829
+ /** Outline stretches of the walls and columns that carry a band. */
830
+ edges: number;
831
+ /** Outside and inside corners sharper than 30° (a fan; two vertical bands). */
832
+ convex: number;
833
+ concave: number;
834
+ /** Joints flatter than 30° (a curved wall's chords): mitred, no corner. */
835
+ flatJoints: number;
836
+ /** Stretches left unbanded because the point just outside lies in another caster. */
837
+ dropped: number;
838
+ furniture: number;
839
+ /** Fence rail sides that carry a band. */
840
+ fenceSides: number;
841
+ /** Outline edges of the stairs' stringers that carry a band. */
842
+ stairEdges: number;
843
+ triangles: number;
844
+ /** Plan points looked up, and faces tested against them. */
845
+ probes: number;
846
+ tests: number;
847
+ };
848
+ }
849
+ /**
850
+ * The fade of a caster's bands at replay time `u` (design §1.1): 0 until the last quarter of its
851
+ * rise, then up to 1 by `ease` at its end; a caster that never rises (none here) shows from its time.
852
+ * A pure function of `u`, so a frame at `t` is the same however it was reached.
853
+ */
854
+ declare function contactFade(ev: {
855
+ riseFrom: number;
856
+ riseTo: number;
857
+ hidden?: boolean;
858
+ } | undefined, u: number): number;
859
+ /**
860
+ * The contact shadows of a replay's nodes (`ReplayPayload.nodes`). `ground` (its ground plane)
861
+ * receives under the lowest storey; `lines` (the walls' outline per node, `wallOutline`) narrows the
862
+ * inside-corner bands at a jamb, and without it they keep their full width. Pure: the same nodes give
863
+ * the same bands, byte for byte.
864
+ */
865
+ declare function contactShadows(nodes: readonly ReplayNode[], ground?: {
866
+ y: number;
867
+ }, lines?: ReadonlyArray<readonly number[] | undefined>): ContactShadows;
868
+
869
+ export { ARCHLANG_3D_VERSION, type AdaptOptions, type AdaptResult, Assumption, type BuildOptions, CORE_POSTS_PER_RUN, CORE_POST_PITCH_MM, type ContactShadows, type CutSector, DOOR_POSES, type DoorPose, FENCE_HEIGHT_MM, FENCE_PROFILES, FLAT_MM, FLOOR_LIFT_UM, FLOOR_OVERLAP_MIN_UM2, FURNITURE_HEIGHT_MM, Fence, type FenceProfile, Floor, type FloorOverlap, Furniture, GroundTint, Level, MAX_FENCE_REPEAT, MIN_CORE, MaterialSlot, Mesh3D, type MeshOptions, type MixedHeightJoint, OPENING_DETAIL, OUTDOOR_MM, type ObstacleClass, Opening, type OwnedWall, type Ownership, type Part, type Piece, Polygon, type Prism, Pt, type Refusal, type RefusalCode, type Ring, Ring3, STAIR_DETAIL, Scene3D, type SectionShape, type ShadowClass, type ShadowLayer, Shell, Side, Stair, type StairDetail, StairFlight, StairLanding, type StairSide, type StairSolid, type Storey, T0_FAMILIES, T0_HANDED, T0_HEIGHT_MM, T0_HUNG_FROM_TOP, T0_MATERIALS, T0_MOUNT_MM, type TrimInput, type TrimPart, type TrimResult, type ValidationIssue, type Warning3D, adaptPlan, assetFor, buildMesh, buildScene3D, clipToConvex, contactFade, contactShadows, corePostCount, cutSector, fenceColour, fencePieces, fencePosts, fenceRuns, floorLifts, floorOverlaps, groundColour, handedAt, insideCut, insideOf, mixedHeightJoints, openLeaf, outdoorColour, overlapArea, partShell, piecesOf, piecesTouch, prism, rectsOf, sectionRing, sectorBand, slab2d, slabRegion, stairDetail, stairRisers, stairSolid, storeyTrim, t0LocalParts, t0Shells, um, umPoint, validateScene3D, wallOwnership };
package/dist/index.js CHANGED
@@ -1,13 +1,20 @@
1
+ import {
2
+ contactFade,
3
+ contactShadows
4
+ } from "./chunk-MXKKNJPU.js";
1
5
  import {
2
6
  CORE_POSTS_PER_RUN,
3
7
  CORE_POST_PITCH_MM,
4
8
  DOOR_POSES,
5
9
  FENCE_HEIGHT_MM,
6
10
  FENCE_PROFILES,
11
+ FLAT_MM,
7
12
  FURNITURE_HEIGHT_MM,
8
13
  MAX_FENCE_REPEAT,
9
14
  MIN_CORE,
15
+ OPENING_DETAIL,
10
16
  OUTDOOR_MM,
17
+ STAIR_DETAIL,
11
18
  adaptPlan,
12
19
  buildMesh,
13
20
  corePostCount,
@@ -16,13 +23,16 @@ import {
16
23
  fencePosts,
17
24
  fenceRuns,
18
25
  groundColour,
26
+ insideOf,
19
27
  openLeaf,
20
28
  outdoorColour,
21
29
  rectsOf,
22
30
  slabRegion,
31
+ stairDetail,
23
32
  stairRisers,
24
- stairSolid
25
- } from "./chunk-VXGQYUMN.js";
33
+ stairSolid,
34
+ storeyTrim
35
+ } from "./chunk-WARUDAOQ.js";
26
36
  import {
27
37
  ARCHLANG_3D_VERSION,
28
38
  FLOOR_LIFT_UM,
@@ -57,8 +67,9 @@ import {
57
67
  umPoint,
58
68
  validateScene3D,
59
69
  wallOwnership
60
- } from "./chunk-6WCS4TAT.js";
70
+ } from "./chunk-B4PZWWSP.js";
61
71
  import {
72
+ CONTACT_SHADOW,
62
73
  ELEVATION_AZIMUTH,
63
74
  ELEVATION_RANGE,
64
75
  END_AZIMUTH,
@@ -70,6 +81,7 @@ import {
70
81
  FIXTURE_FAMILIES,
71
82
  FLOOR_FINISHES,
72
83
  FLOOR_FINISH_RULES,
84
+ FLOOR_WORD_FINISH,
73
85
  GROUND_PLANE,
74
86
  GROUND_ROUGHNESS,
75
87
  GROUND_SPLITS,
@@ -82,14 +94,17 @@ import {
82
94
  PRESET_NAMES,
83
95
  SITE_PALETTE,
84
96
  STAIR_MATERIAL,
97
+ STAIR_RAIL_MATERIAL,
85
98
  START_FOV,
86
99
  STOP_LEAD,
100
+ TRIM_MATERIAL,
87
101
  WALL_CAP_SRGB,
88
102
  ZOOM,
89
103
  authoringOrder,
90
104
  boxOfNodes,
91
105
  cameraAtStop,
92
106
  cameraStops,
107
+ contactBandMm,
93
108
  corners,
94
109
  coverage,
95
110
  distanceLimits,
@@ -118,10 +133,12 @@ import {
118
133
  targetBounds,
119
134
  timeline,
120
135
  viewLabel,
121
- viewMesh
122
- } from "./chunk-TNNJ7CAO.js";
136
+ viewMesh,
137
+ wordFinish
138
+ } from "./chunk-LNIVDMPG.js";
123
139
  export {
124
140
  ARCHLANG_3D_VERSION,
141
+ CONTACT_SHADOW,
125
142
  CORE_POSTS_PER_RUN,
126
143
  CORE_POST_PITCH_MM,
127
144
  DOOR_POSES,
@@ -136,10 +153,12 @@ export {
136
153
  FILL,
137
154
  FINISH_PALETTE,
138
155
  FIXTURE_FAMILIES,
156
+ FLAT_MM,
139
157
  FLOOR_FINISHES,
140
158
  FLOOR_FINISH_RULES,
141
159
  FLOOR_LIFT_UM,
142
160
  FLOOR_OVERLAP_MIN_UM2,
161
+ FLOOR_WORD_FINISH,
143
162
  FURNITURE_HEIGHT_MM,
144
163
  GROUND_PLANE,
145
164
  GROUND_ROUGHNESS,
@@ -150,12 +169,15 @@ export {
150
169
  MATERIAL_SLOTS,
151
170
  MAX_FENCE_REPEAT,
152
171
  MIN_CORE,
172
+ OPENING_DETAIL,
153
173
  OUTDOOR_MM,
154
174
  PALETTE,
155
175
  PHASE,
156
176
  PRESET_NAMES,
157
177
  SITE_PALETTE,
178
+ STAIR_DETAIL,
158
179
  STAIR_MATERIAL,
180
+ STAIR_RAIL_MATERIAL,
159
181
  START_FOV,
160
182
  STOP_LEAD,
161
183
  T0_FAMILIES,
@@ -164,6 +186,7 @@ export {
164
186
  T0_HUNG_FROM_TOP,
165
187
  T0_MATERIALS,
166
188
  T0_MOUNT_MM,
189
+ TRIM_MATERIAL,
167
190
  WALL_CAP_SRGB,
168
191
  ZOOM,
169
192
  adaptPlan,
@@ -175,6 +198,9 @@ export {
175
198
  cameraAtStop,
176
199
  cameraStops,
177
200
  clipToConvex,
201
+ contactBandMm,
202
+ contactFade,
203
+ contactShadows,
178
204
  corePostCount,
179
205
  corners,
180
206
  coverage,
@@ -197,6 +223,7 @@ export {
197
223
  groundColour,
198
224
  handedAt,
199
225
  insideCut,
226
+ insideOf,
200
227
  keyFrames,
201
228
  linearRgb,
202
229
  mixedHeightJoints,
@@ -220,10 +247,12 @@ export {
220
247
  slabRegion,
221
248
  slotColour,
222
249
  slotGroups,
250
+ stairDetail,
223
251
  stairRisers,
224
252
  stairSolid,
225
253
  stateAt,
226
254
  stopCount,
255
+ storeyTrim,
227
256
  storeysOf,
228
257
  stripAt,
229
258
  t0LocalParts,
@@ -236,5 +265,6 @@ export {
236
265
  validateScene3D,
237
266
  viewLabel,
238
267
  viewMesh,
239
- wallOwnership
268
+ wallOwnership,
269
+ wordFinish
240
270
  };