@chanmeng666/archlang-3d 0.6.0 → 0.7.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.
@@ -47,20 +47,42 @@ var PALETTE = {
47
47
  water: m("#a3c6d0", 0.1, 0, 0.7)
48
48
  };
49
49
  var STAIR_MATERIAL = "wood";
50
+ var STAIR_RAIL_MATERIAL = "wood_dark";
51
+ var DOOR_OAK = m("#c2a27e", 0.7);
52
+ var FRAME_BRONZE = m("#55534f", 0.5);
50
53
  var KIND_PALETTE = {
51
54
  slab: m("#bdb6ab", 0.9),
52
55
  column: m("#e6e1d8", 0.85),
53
56
  wall: m("#f2f0eb", 0.9),
54
- door: m("#c2a27e", 0.7),
55
- "window:frame": m("#55534f", 0.5),
57
+ door: DOOR_OAK,
58
+ "window:frame": FRAME_BRONZE,
56
59
  "window:glass": m("#bcd6e0", 0.05, 0, 0.4),
60
+ // The trim (card RM8.6): a window's reveal in its frame's bronze, its exterior sill in the pale
61
+ // stone and its interior board in the oak of the palette; a cased opening's lining and casing in
62
+ // the doors' oak (a door's own lining and casing are `door`). Drafting defaults, ledgered once per
63
+ // Mesh3D as `trim-material-default` from `TRIM_MATERIAL`.
64
+ "window:reveal": FRAME_BRONZE,
65
+ "window:sill": PALETTE.stone,
66
+ "window:board": PALETTE.wood,
67
+ "opening:lining": DOOR_OAK,
68
+ "opening:casing": DOOR_OAK,
57
69
  opening: m("#e6e1d8", 0.85),
58
70
  furniture: m("#d6cec1", 0.9),
59
71
  roof: m("#9c958a", 0.9),
60
72
  "wall:demolish": m("#c8553d", 0.9, 0, 0.3),
61
73
  // A stair (card X3): the core gives it no material, so the ledgered default (`STAIR_MATERIAL`,
62
74
  // `stair-material-default`): that slot's own entry, never a second copy of its colour.
63
- stair: PALETTE[STAIR_MATERIAL]
75
+ stair: PALETTE[STAIR_MATERIAL],
76
+ "stair:rail": PALETTE[STAIR_RAIL_MATERIAL]
77
+ };
78
+ var TRIM_MATERIAL = {
79
+ "door:lining": { material: "door", srgb: KIND_PALETTE.door.srgb },
80
+ "door:casing": { material: "door", srgb: KIND_PALETTE.door.srgb },
81
+ "opening:lining": { material: "opening:lining", srgb: KIND_PALETTE["opening:lining"].srgb },
82
+ "opening:casing": { material: "opening:casing", srgb: KIND_PALETTE["opening:casing"].srgb },
83
+ "window:reveal": { material: "window:reveal", srgb: KIND_PALETTE["window:reveal"].srgb },
84
+ "window:sill": { material: "window:sill", srgb: KIND_PALETTE["window:sill"].srgb },
85
+ "window:board": { material: "window:board", srgb: KIND_PALETTE["window:board"].srgb }
64
86
  };
65
87
  var WALL_CAP_SRGB = "#8f877d";
66
88
  var FLOOR_FINISHES = ["timber", "tile", "neutral"];
@@ -306,7 +328,7 @@ function timeline(mesh) {
306
328
  if (isGhost(n)) rise = [a, w];
307
329
  else if (wallRise.has(n.key)) rise = wallRise.get(n.key);
308
330
  else if (thingRise.has(n.key)) rise = thingRise.get(n.key);
309
- else if (n.kind === "door" || n.kind === "window")
331
+ else if (n.kind === "door" || n.kind === "window" || n.kind === "opening")
310
332
  rise = hostRise.get(`${n.level}/${String(n.extras.host)}`) ?? [a, w];
311
333
  else if (isFlat(n)) {
312
334
  const at = appearOf.get(n.key) ?? a;
@@ -612,7 +634,9 @@ export {
612
634
  MATERIAL_SLOTS,
613
635
  PALETTE,
614
636
  STAIR_MATERIAL,
637
+ STAIR_RAIL_MATERIAL,
615
638
  KIND_PALETTE,
639
+ TRIM_MATERIAL,
616
640
  WALL_CAP_SRGB,
617
641
  FLOOR_FINISHES,
618
642
  FINISH_PALETTE,
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-QN4LQTVG.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-FVD3DZU2.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-GXWLZ2KC.js";
21
+ import "./chunk-FHBR2U5Z.js";
22
22
  import {
23
23
  storeysOf,
24
24
  timeline,
25
25
  viewLabel,
26
26
  viewMesh
27
- } from "./chunk-TNNJ7CAO.js";
27
+ } from "./chunk-TI4RYEOL.js";
28
28
 
29
29
  // src/cli/run.ts
30
30
  import { readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
@@ -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 { U as ReplayView, R as ReplayFacts } from './strip-Sdsm54Qw.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,10 +1,10 @@
1
1
  import * as _chanmeng666_archlang from '@chanmeng666/archlang';
2
2
  import { ResolvedPlan, RWall, Point, JoinedCut, loopsToPolygons, 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';
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, O as Opening, L as Level, e as Side, f as Stair, g as StairFlight, h as MaterialSlot, i as Furniture, j as Fence, G as GroundTint } from './strip-Sdsm54Qw.js';
5
+ export { D as DoorKind, E as EXPLODE_GAP_MM, k as FENCE_PALETTE, l as FINISH_PALETTE, m as FIXTURE_FAMILIES, n as FLOOR_FINISHES, o as FLOOR_FINISH_RULES, p as FloorFinish, q as GROUND_PLANE, r as GROUND_ROUGHNESS, t as GROUND_SPLITS, u as GROUND_TINT, v as GROUND_WASH, K as KIND_PALETTE, w as KindMaterial, x as MATERIAL_SLOTS, y as MeshNode, z as Meta, N as NodeKind, B as NodeState, C as Outdoor, H as PALETTE, I as PHASE, J as Provenance, Q as ReplayEvent, R as ReplayFacts, T as ReplayState, U as ReplayView, V as Roof, W as SITE_PALETTE, X as STAIR_MATERIAL, Y as STAIR_RAIL_MATERIAL, Z as STOP_LEAD, _ as SlotMaterial, $ as Source, a0 as Stage, a1 as StairLanding, S as StripItem, a2 as TRIM_MATERIAL, a3 as Um, a4 as WALL_CAP_SRGB, a5 as Wall, a6 as authoringOrder, a7 as ease, a8 as explodeLifts, a9 as finishColour, aa as floorFinish, ab as keyFrames, ac as linearRgb, ad as siteColour, ae as slotColour, af as slotGroups, ag as stateAt, ah as storeysOf, s as stripAt, ai as timeline, aj as viewLabel, ak as viewMesh } from './strip-Sdsm54Qw.js';
6
+ export { F as FactsOptions, r as replayFacts } from './facts-3wb9egIT.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-CGIIudHj.js';
8
8
 
9
9
  /** The package's own version, stamped into `meta.tool`. */
10
10
  declare const ARCHLANG_3D_VERSION: string;
@@ -293,8 +293,131 @@ declare function rectsOf(r: readonly Pt[]): Rect[];
293
293
  declare function slabRegion(footprint: readonly Ring3[], floors: readonly Floor[], ledger: Assumption[]): Polygon[];
294
294
 
295
295
  /**
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.
296
+ * The trim of a doorway and a window (product-roadmap card RM8.6; design
297
+ * `docs/plans/product-roadmap/design/visual-language.md` §2.1, §2.2), as parts of the opening's
298
+ * node, every size a clamped share of the host wall's thickness `t`, rounded to a whole millimetre:
299
+ *
300
+ * - a door (every kind) and a cased `opening`: a lining on the two jamb faces and the head, `l` =
301
+ * 0.1 t in [12, 25] thick along the wall; a door's in two halves across the wall, a 40 mm slot
302
+ * between them for the leaf (which keeps its length and place, so it stays the core's `doorLeaves`
303
+ * leaf); and a casing (architrave) on each wall face, `c` = 0.35 t in [50, 90] wide and `p` =
304
+ * 0.1 t in [10, 20] proud, its legs from the floor to the head, its head piece over the full width,
305
+ * cut at the wall's top (none when the head is at the top). A barn door has no casing on the face
306
+ * its panel hangs on (the core's `swing`), a garage door none at all, a door on a curved host no
307
+ * trim (its closed leaf is the chord between its jambs; a cased opening there keeps its lining,
308
+ * along the arc), and a leg that would stand in a wall or a column (a doorway at a corner), in
309
+ * standing furniture (not a rug: `FLAT_MM`), in another doorway or in another doorway's casing
310
+ * (two doorways side by side: both legs) is left out, never shortened, its head piece then
311
+ * stopping at that jamb;
312
+ * - a window: on the interior half of the cut, a reveal lining 0.075 t in [10, 20] on the jambs and
313
+ * the head, in the frame's colour; on its sill, an exterior sill 0.15 t in [20, 40] thick, proud
314
+ * of the outside face by 0.2 t and past each jamb by 0.2 t (the core's `SILL_PROJECTION` and
315
+ * `SILL_HORN`, of the host's own `t`), and an interior board 0.1 t in [18, 30] thick, past the
316
+ * inside face and each jamb by 0.1 t in [15, 30]. Which face is outside is the core's own rule
317
+ * (`exteriorNormal`, `src/elements/window.ts`): one wall thickness off each face, the side with no
318
+ * room or void of the storey there. Inside on both sides (an interior window): a reveal on both
319
+ * halves, no sill; on neither (a free-standing wall): nothing. A window with no sill (`sill 0`)
320
+ * has neither sill nor board. At a mitred end (a window run to a corner) a sill or a board stops
321
+ * on the mitre, past no jamb, and an end that would stand in a neighbour's doorway, casing, sill
322
+ * or board stops at its jamb (`window-sill-horn-omitted`); on a curved host the reveals follow the
323
+ * arc and the sill and the board stay inside the cut.
324
+ *
325
+ * A storey's trim is decided all at once (`storeyTrim`), never in the order the plan writes its
326
+ * openings: every casing before any sill or board (a casing beats a horn), and two casing legs, or
327
+ * two windows' horns or spans, that meet are both left out or cut back, so a plan's trim is the same whatever order
328
+ * its openings are written in, and a mirror-symmetric plan gets mirror-symmetric trim (RM8.6b).
329
+ *
330
+ * Every part is square to its wall, built in its jamb frame and rounded to whole micrometres; every
331
+ * shell closed (`prism`). Each default is ledgered per opening (ADR 0030 decision 5).
332
+ */
333
+
334
+ /** The trim's sizes (mm) for a host `t` mm thick (design §2.1, §2.2). */
335
+ declare const OPENING_DETAIL: {
336
+ /** The slot a door's lining leaves for its leaf: the leaf's own thickness (`LEAF_MM`). */
337
+ readonly slot: 40;
338
+ readonly lining: (t: number) => number;
339
+ readonly casingWidth: (t: number) => number;
340
+ readonly casingProud: (t: number) => number;
341
+ readonly sillThickness: (t: number) => number;
342
+ /** The core's `SILL_PROJECTION` and `SILL_HORN` (both 0.2 of the host's thickness). */
343
+ readonly sillProjection: (t: number) => number;
344
+ readonly sillHorn: (t: number) => number;
345
+ readonly boardThickness: (t: number) => number;
346
+ readonly boardOverhang: (t: number) => number;
347
+ readonly reveal: (t: number) => number;
348
+ /** The window frame's half depth (`FRAME_DEPTH_MM` / 2): where the reveal and the sills start. */
349
+ readonly frameHalfDepth: 30;
350
+ };
351
+ /** One part of an opening's node: its name and its shells (a `null` one was degenerate). */
352
+ interface TrimPart {
353
+ part: "lining" | "casing" | "sill" | "board" | "reveal";
354
+ shells: Array<Shell | null>;
355
+ }
356
+ /**
357
+ * The side of the frame (`+1`: `+v`, `−1`: `−v`) a room or void lies on, one wall thickness off each
358
+ * face at the opening's centre (the core's `exteriorNormal`, through `wallFaceProbes`): `"both"` for
359
+ * an interior window, `null` for one on a free-standing wall.
360
+ */
361
+ declare function insideOf(o: Opening, t: number, level: Level): 1 | -1 | "both" | null;
362
+ /**
363
+ * What a trim piece can stand in: one class per kind of obstacle a piece is tested against. A
364
+ * neighbour's doorway (its cut and a casing's depth off each face) is three of them:
365
+ * - `opening`: between its sill and its head, what a casing is tested against (above a door's head
366
+ * is its lintel, which a neighbour's casing may well pass in front of);
367
+ * - `doorway`: at every height, what a sill's or a board's span is tested against;
368
+ * - `jamb`: at every height and a millimetre wider each way along its wall, what a sill's or a
369
+ * board's horn is tested against. Its pier's jamb face runs from the floor to the wall's top
370
+ * whatever the doorway's own height, so a horn ending flush with it (a horn exactly as long as the
371
+ * pier is wide) would share that face at any height (RM8.6b n2; the coplanar check found it).
372
+ */
373
+ type ObstacleClass = "wall" | "column" | "furniture" | "opening" | "doorway" | "jamb" | "trim";
374
+ /** Furniture lower than this (mm) lies flat on the floor (a rug, a mat): trim passes through it. */
375
+ declare const FLAT_MM = 50;
376
+ /** The extruder `build.ts` counts degenerate holes with. */
377
+ type Prism = (poly: Polygon, z0: number, z1: number) => Shell | null;
378
+ /** One opening the storey's trim is built for. */
379
+ interface TrimInput {
380
+ o: Opening;
381
+ /** The host's thickness (µm). */
382
+ t: number;
383
+ /** The head as built (µm over `e`; the opening's head capped at the host's built top). */
384
+ head: number;
385
+ /** The host's built top (µm over `e`). */
386
+ top: number;
387
+ }
388
+ /** An opening's trim: its parts (each a part of its node) and the ledger rows that say what was assumed. */
389
+ interface TrimResult {
390
+ parts: TrimPart[];
391
+ ledger: Assumption[];
392
+ }
393
+ /**
394
+ * The trim of every opening of a storey (product-roadmap RM8.6, RM8.6b), decided all at once so it
395
+ * never depends on the order the plan writes its openings in (review of PR #729, S1):
396
+ *
397
+ * 1. Each doorway's casing legs are tested against the storey's fixed obstacles (`fixedObstacles`)
398
+ * and every OTHER doorway's casing legs as planned. A leg that meets one is left out, never
399
+ * shortened; two legs that meet each other are both left out (two doorways closer than two
400
+ * casings), so neither doorway wins by coming first and a symmetric plan stays symmetric.
401
+ * 2. Each head piece's two ends past the jambs, one at a time (S3): an end is cut back to its jamb
402
+ * when its leg was left out, or when it meets a fixed obstacle (a neighbour's doorway above this
403
+ * one's head, a wall, a column, tall furniture); its span between the jambs is left out when it
404
+ * meets a fixed obstacle. Another doorway's casing cannot reach either: an end stands over its own
405
+ * leg, which met that casing first, and the span over its own doorway, which that casing's leg met
406
+ * first.
407
+ * 3. Only then each window's sill and board, a casing beating a horn: each horn past a jamb is cut
408
+ * back when it meets a neighbour's jamb (`jamb`), any built casing, or another window's sill or
409
+ * board as planned (both cut); a sill or board whose span meets a neighbour's doorway
410
+ * (`doorway`), a built casing or another window's span is left out. The reveal stands on the
411
+ * board, or on the sill block when the board is left out.
412
+ *
413
+ * Every omission is ledgered with what it met, end by end.
414
+ */
415
+ declare function storeyTrim(level: Level, inputs: readonly TrimInput[], e: number, prism: Prism, furnitureZ: (f: Level["furniture"][number]) => [number, number]): Map<string, TrimResult>;
416
+
417
+ /**
418
+ * A stair as stepped solids (card X3, `stairSolid`) and in its parts (card RM8.6, `stairDetail`:
419
+ * what the mesh builds), from the Scene3D's flights and landings, which are the core's own
420
+ * (`scene3d/build.ts`): nothing here re-derives a stair from its bounding box. The solid:
298
421
  *
299
422
  * - Risers: one per tread the plan draws on a flight, plus one more at its head, because a flight's
300
423
  * last riser lands on the landing or the floor above. So a stair of flights with `n₁ … n_F` treads
@@ -327,6 +450,101 @@ interface StairSolid {
327
450
  declare function stairSolid(stair: Stair, z0: number, rise: number): (StairSolid & {
328
451
  dropped: number;
329
452
  }) | null;
453
+ /**
454
+ * The drafting defaults a stair's parts are built to (mm), each a clamped share of its own geometry
455
+ * (design `docs/plans/product-roadmap/design/visual-language.md` §2.3): `r` the riser (`rise / R`),
456
+ * `g` a flight's going (`run / treads`), `W` the flight band's width. They are drawing defaults,
457
+ * never a check against any regulation.
458
+ */
459
+ declare const STAIR_DETAIL: {
460
+ /** A tread board, 0.25 r in [30, 50] thick (never more than half a riser). */
461
+ readonly tread: (r: number) => number;
462
+ /** Its nosing past the front edge (not on a flight's first tread), 0.1 g in [15, 30]. */
463
+ readonly nosing: (g: number) => number;
464
+ /** A stringer, 0.05 W in [40, 60] wide (at most a quarter of the band). */
465
+ readonly stringer: (W: number) => number;
466
+ /** The stringer's band: 0.3 r in [40, 60] over the nosing line, 1.2 r in [150, 250] under it. */
467
+ readonly above: (r: number) => number;
468
+ readonly below: (r: number) => number;
469
+ /** The handrail's top over the nosing line (measured upright), and its 50 × 50 section. */
470
+ readonly railHeight: 900;
471
+ readonly rail: 50;
472
+ /** A baluster a tread, 0.03 W in [20, 30] square. */
473
+ readonly baluster: (W: number) => number;
474
+ /** A newel at each end of a flight, 0.06 W in [60, 90] square, this far over the handrail. */
475
+ readonly newel: (W: number) => number;
476
+ readonly newelAbove: 100;
477
+ /** A landing's open edge: its handrail's top over the landing; balusters a going apart. */
478
+ readonly landingRailHeight: 1000;
479
+ /** How far past an edge the wall probe looks. */
480
+ readonly probe: 100;
481
+ };
482
+ /** What a flight's long edge, or a landing's edge, has past it (the probe's answer). */
483
+ interface StairSide {
484
+ /** `flight <k>` or `landing <k>`, 1-based in climbing order. */
485
+ of: string;
486
+ side: Side;
487
+ /**
488
+ * `flight` / `landing`: the stair's other flights (and landings) lie past the whole edge; `newel`: a
489
+ * landing edge open past it, but wholly held by the flights' newels standing on it.
490
+ */
491
+ against: "wall" | "open" | "flight" | "landing" | "newel";
492
+ }
493
+ /** A stair built in its parts (RM8.6): treads and landings, stringers, the balustrade. */
494
+ interface StairDetail {
495
+ /** The treads (the risers open) and the solid landings: the stair node's own shells. */
496
+ treads: Shell[];
497
+ stringers: Shell[];
498
+ /** Handrails, balusters and newels. */
499
+ rails: Shell[];
500
+ risers: number;
501
+ /** Shells left out as degenerate. */
502
+ dropped: number;
503
+ /** Every edge the probe looked past, in climbing order. */
504
+ sides: StairSide[];
505
+ /** The sizes used (mm). */
506
+ dims: {
507
+ tread: number;
508
+ nosing: number[];
509
+ stringer: {
510
+ width: number;
511
+ above: number;
512
+ below: number;
513
+ };
514
+ balustrade: {
515
+ height: number;
516
+ rail: [number, number];
517
+ baluster: number;
518
+ newel: number;
519
+ newel_above: number;
520
+ landing_height: number;
521
+ };
522
+ };
523
+ }
524
+ /**
525
+ * `stair` climbing `rise` µm from `z0`, in its parts (product-roadmap RM8.6; design
526
+ * `visual-language.md` §2.3), or `null` where `stairSolid` refuses one. Every tread top is
527
+ * `stairSolid`'s riser top (`z0 + round(rise·k/R)`), so the climb is the same; the stair is built:
528
+ *
529
+ * - each tread a board `STAIR_DETAIL.tread` thick under its riser top, from its tread line (less
530
+ * the nosing, but on a flight's first tread) to the next, between the two stringers (so no face
531
+ * of a tread lies in a stringer's); the risers are open;
532
+ * - two stringers on the flight band's long edges, their side section the band from `below` under
533
+ * to `above` over the nosing line (through the tread tops' front edges), clipped to the run and
534
+ * to `[z0, the flight's head]`;
535
+ * - each landing a solid box, as before;
536
+ * - a balustrade on each long edge the probe finds open (`solidAt` false 100 mm past it at mid-run;
537
+ * the caller answers from the storey's wall bodies and columns): a sloping handrail centred on the
538
+ * stringer, a baluster under the middle of each tread from inside the stringer to inside the rail,
539
+ * a newel centred on each end of the flight; on a landing's open edge (no flight and no wall past
540
+ * it) a level handrail inside the edge with balusters a going apart, stopping where a newel or an
541
+ * earlier rail already stands.
542
+ *
543
+ * Square to the plan, integer micrometres, every shell closed and wound outward (`prism`,
544
+ * `sideways`). Read from the shape alone: a mirrored plan probes the mirrored edges and builds the
545
+ * mirrored stair, so nothing gains a hand.
546
+ */
547
+ declare function stairDetail(stair: Stair, z0: number, rise: number, solidAt: (p: Pt) => boolean): StairDetail | null;
330
548
 
331
549
  /**
332
550
  * The T0 kit (visual-assets V2, V5, V6): the part type every generator returns and the few helpers
@@ -371,7 +589,24 @@ interface Part extends SectionShape {
371
589
  z0: number;
372
590
  z1: number;
373
591
  }>;
592
+ /**
593
+ * A lofted part (product-roadmap RM8.6, backlog VA.1): its section (`round`, `radius` or a box)
594
+ * placed as one ring at the bottom and one at each height of this table, each `[height as a
595
+ * fraction of y0..y1, scale as a fraction of the box's half-extents]` about the box's centre,
596
+ * neighbouring rings joined by quads and the bottom and top rings capped: one closed shell whose
597
+ * silhouette slopes from ring to ring instead of stepping. Vertical parts only, no holes, no
598
+ * `profile`; its widest ring should scale 1, so the shell spans its box.
599
+ */
600
+ loft?: DomeTable;
374
601
  }
602
+ /**
603
+ * A dome's profile, each row `[a height as a fraction of the dome's, its radius there as a fraction
604
+ * of the half-extents]` (once the top of a stacked tier; since RM8.6 a lofted ring, `Part.loft`).
605
+ * The tables (`t0-outdoor.ts`) slice an ellipsoid at equal steps of latitude (15°), so the rings
606
+ * crowd toward the top and the dome rounds over; the radii are cos(mid-latitude), the widest scaled
607
+ * to 1, written out (no engine's `Math.cos` reaches a coordinate).
608
+ */
609
+ type DomeTable = ReadonlyArray<readonly [number, number]>;
375
610
 
376
611
  /**
377
612
  * T0 parametric furniture (archlang-3d plan §4.4, §5.1–5.3; card A2b; visual-assets V1–V3,
@@ -562,4 +797,4 @@ declare function fencePieces(f: Pick<Fence, "points" | "closed" | "style">, prof
562
797
  z: readonly [number, number];
563
798
  }>;
564
799
 
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 };
800
+ 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, 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, Shell, Side, Stair, type StairDetail, StairFlight, 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, 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
@@ -4,10 +4,13 @@ import {
4
4
  DOOR_POSES,
5
5
  FENCE_HEIGHT_MM,
6
6
  FENCE_PROFILES,
7
+ FLAT_MM,
7
8
  FURNITURE_HEIGHT_MM,
8
9
  MAX_FENCE_REPEAT,
9
10
  MIN_CORE,
11
+ OPENING_DETAIL,
10
12
  OUTDOOR_MM,
13
+ STAIR_DETAIL,
11
14
  adaptPlan,
12
15
  buildMesh,
13
16
  corePostCount,
@@ -16,13 +19,16 @@ import {
16
19
  fencePosts,
17
20
  fenceRuns,
18
21
  groundColour,
22
+ insideOf,
19
23
  openLeaf,
20
24
  outdoorColour,
21
25
  rectsOf,
22
26
  slabRegion,
27
+ stairDetail,
23
28
  stairRisers,
24
- stairSolid
25
- } from "./chunk-VXGQYUMN.js";
29
+ stairSolid,
30
+ storeyTrim
31
+ } from "./chunk-QN4LQTVG.js";
26
32
  import {
27
33
  ARCHLANG_3D_VERSION,
28
34
  FLOOR_LIFT_UM,
@@ -57,7 +63,7 @@ import {
57
63
  umPoint,
58
64
  validateScene3D,
59
65
  wallOwnership
60
- } from "./chunk-6WCS4TAT.js";
66
+ } from "./chunk-GXWLZ2KC.js";
61
67
  import {
62
68
  ELEVATION_AZIMUTH,
63
69
  ELEVATION_RANGE,
@@ -82,8 +88,10 @@ import {
82
88
  PRESET_NAMES,
83
89
  SITE_PALETTE,
84
90
  STAIR_MATERIAL,
91
+ STAIR_RAIL_MATERIAL,
85
92
  START_FOV,
86
93
  STOP_LEAD,
94
+ TRIM_MATERIAL,
87
95
  WALL_CAP_SRGB,
88
96
  ZOOM,
89
97
  authoringOrder,
@@ -119,7 +127,7 @@ import {
119
127
  timeline,
120
128
  viewLabel,
121
129
  viewMesh
122
- } from "./chunk-TNNJ7CAO.js";
130
+ } from "./chunk-TI4RYEOL.js";
123
131
  export {
124
132
  ARCHLANG_3D_VERSION,
125
133
  CORE_POSTS_PER_RUN,
@@ -136,6 +144,7 @@ export {
136
144
  FILL,
137
145
  FINISH_PALETTE,
138
146
  FIXTURE_FAMILIES,
147
+ FLAT_MM,
139
148
  FLOOR_FINISHES,
140
149
  FLOOR_FINISH_RULES,
141
150
  FLOOR_LIFT_UM,
@@ -150,12 +159,15 @@ export {
150
159
  MATERIAL_SLOTS,
151
160
  MAX_FENCE_REPEAT,
152
161
  MIN_CORE,
162
+ OPENING_DETAIL,
153
163
  OUTDOOR_MM,
154
164
  PALETTE,
155
165
  PHASE,
156
166
  PRESET_NAMES,
157
167
  SITE_PALETTE,
168
+ STAIR_DETAIL,
158
169
  STAIR_MATERIAL,
170
+ STAIR_RAIL_MATERIAL,
159
171
  START_FOV,
160
172
  STOP_LEAD,
161
173
  T0_FAMILIES,
@@ -164,6 +176,7 @@ export {
164
176
  T0_HUNG_FROM_TOP,
165
177
  T0_MATERIALS,
166
178
  T0_MOUNT_MM,
179
+ TRIM_MATERIAL,
167
180
  WALL_CAP_SRGB,
168
181
  ZOOM,
169
182
  adaptPlan,
@@ -197,6 +210,7 @@ export {
197
210
  groundColour,
198
211
  handedAt,
199
212
  insideCut,
213
+ insideOf,
200
214
  keyFrames,
201
215
  linearRgb,
202
216
  mixedHeightJoints,
@@ -220,10 +234,12 @@ export {
220
234
  slabRegion,
221
235
  slotColour,
222
236
  slotGroups,
237
+ stairDetail,
223
238
  stairRisers,
224
239
  stairSolid,
225
240
  stateAt,
226
241
  stopCount,
242
+ storeyTrim,
227
243
  storeysOf,
228
244
  stripAt,
229
245
  t0LocalParts,
package/dist/node.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { World } from '@chanmeng666/archlang';
2
- import { M as Mesh3D, J as ReplayEvent, x as MeshNode, a as Scene3D, c as Shell } from './strip-CA-IAT0N.js';
3
- export { R as ReplayFacts, S as StripItem, s as stripAt } from './strip-CA-IAT0N.js';
2
+ import { M as Mesh3D, Q as ReplayEvent, y as MeshNode, a as Scene3D, c as Shell } from './strip-Sdsm54Qw.js';
3
+ export { R as ReplayFacts, S as StripItem, s as stripAt } from './strip-Sdsm54Qw.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-Dje5wcHh.js';
6
+ export { F as FactsOptions, r as replayFacts } from './facts-3wb9egIT.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
package/dist/node.js CHANGED
@@ -20,10 +20,10 @@ import {
20
20
  signedVolume,
21
21
  viewerScript,
22
22
  writeGlb
23
- } from "./chunk-LMFD5NP4.js";
23
+ } from "./chunk-FVD3DZU2.js";
24
24
  import {
25
25
  replayFacts
26
- } from "./chunk-6WCS4TAT.js";
26
+ } from "./chunk-GXWLZ2KC.js";
27
27
  import {
28
28
  PREVIEW_ABOUT_URL,
29
29
  PREVIEW_LABEL,
@@ -31,10 +31,10 @@ import {
31
31
  PREVIEW_LIMITS,
32
32
  replayPayload,
33
33
  viewBoxOf
34
- } from "./chunk-CX6IVI7I.js";
34
+ } from "./chunk-FHBR2U5Z.js";
35
35
  import {
36
36
  stripAt
37
- } from "./chunk-TNNJ7CAO.js";
37
+ } from "./chunk-TI4RYEOL.js";
38
38
  export {
39
39
  GLB_GENERATOR,
40
40
  PREVIEW_ABOUT_URL,
package/dist/replay.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { g as MaterialSlot, o as FloorFinish, R as ReplayFacts, J as ReplayEvent, M as Mesh3D } from './strip-CA-IAT0N.js';
1
+ import { h as MaterialSlot, p as FloorFinish, R as ReplayFacts, Q as ReplayEvent, M as Mesh3D } from './strip-Sdsm54Qw.js';
2
2
  import '@chanmeng666/archlang';
3
3
 
4
4
  /**
@@ -32,6 +32,9 @@ declare const PALETTE: Readonly<Record<Exclude<MaterialSlot, "body">, SlotMateri
32
32
  /** The slot a stair is built in (card X3): oak treads. The core gives a stair no material, so
33
33
  * this is a drafting default, ledgered (`stair-material-default`). */
34
34
  declare const STAIR_MATERIAL = "wood";
35
+ /** The slot a stair's handrails, balusters and newels are built in (card RM8.6): walnut, so the
36
+ * balustrade reads against the oak treads. A drafting default, ledgered (`stair-rail-material-default`). */
37
+ declare const STAIR_RAIL_MATERIAL = "wood_dark";
35
38
  /**
36
39
  * The building's own materials (visual-assets V9), by Mesh3D kind, and `<kind>:<part>` where a
37
40
  * part differs (a window's frame and glass, a demolished wall's ghost): the light replay's colours
@@ -46,13 +49,54 @@ declare const KIND_PALETTE: {
46
49
  readonly door: SlotMaterial;
47
50
  readonly "window:frame": SlotMaterial;
48
51
  readonly "window:glass": SlotMaterial;
52
+ readonly "window:reveal": SlotMaterial;
53
+ readonly "window:sill": SlotMaterial;
54
+ readonly "window:board": SlotMaterial;
55
+ readonly "opening:lining": SlotMaterial;
56
+ readonly "opening:casing": SlotMaterial;
49
57
  readonly opening: SlotMaterial;
50
58
  readonly furniture: SlotMaterial;
51
59
  readonly roof: SlotMaterial;
52
60
  readonly "wall:demolish": SlotMaterial;
53
61
  readonly stair: SlotMaterial;
62
+ readonly "stair:rail": SlotMaterial;
54
63
  };
55
64
  type KindMaterial = keyof typeof KIND_PALETTE;
65
+ /**
66
+ * What each trim part (card RM8.6) is built in, as the ledger records it (`trim-material-default`,
67
+ * review m1 on PR #729): the material its node is written in (`KIND_PALETTE` entry) and that
68
+ * entry's colour. A door's lining and casing are its leaf's oak.
69
+ */
70
+ declare const TRIM_MATERIAL: {
71
+ readonly "door:lining": {
72
+ readonly material: "door";
73
+ readonly srgb: string;
74
+ };
75
+ readonly "door:casing": {
76
+ readonly material: "door";
77
+ readonly srgb: string;
78
+ };
79
+ readonly "opening:lining": {
80
+ readonly material: "opening:lining";
81
+ readonly srgb: string;
82
+ };
83
+ readonly "opening:casing": {
84
+ readonly material: "opening:casing";
85
+ readonly srgb: string;
86
+ };
87
+ readonly "window:reveal": {
88
+ readonly material: "window:reveal";
89
+ readonly srgb: string;
90
+ };
91
+ readonly "window:sill": {
92
+ readonly material: "window:sill";
93
+ readonly srgb: string;
94
+ };
95
+ readonly "window:board": {
96
+ readonly material: "window:board";
97
+ readonly srgb: string;
98
+ };
99
+ };
56
100
  /**
57
101
  * The replay's colour for a wall's cut top (its cap, the faces at its full height): the poché of a
58
102
  * plan, read as the section through a model whose roof is lifted off. A display convention of the
@@ -655,4 +699,4 @@ interface StripItem {
655
699
  */
656
700
  declare function stripAt(facts: ReplayFacts, events: readonly ReplayEvent[], t: number): StripItem[];
657
701
 
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 };
702
+ export { type Source as $, type Assumption as A, type NodeState as B, type Outdoor as C, type DoorKind as D, EXPLODE_GAP_MM as E, type Floor as F, type GroundTint as G, PALETTE as H, PHASE as I, type Provenance 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 ReplayEvent as Q, type ReplayFacts as R, type StripItem as S, type ReplayState as T, type ReplayView as U, type Roof as V, SITE_PALETTE as W, STAIR_MATERIAL as X, STAIR_RAIL_MATERIAL as Y, STOP_LEAD as Z, type SlotMaterial as _, type Scene3D as a, type Stage as a0, type StairLanding as a1, TRIM_MATERIAL as a2, type Um as a3, WALL_CAP_SRGB as a4, type Wall as a5, authoringOrder as a6, ease as a7, explodeLifts as a8, finishColour as a9, floorFinish as aa, keyFrames as ab, linearRgb as ac, siteColour as ad, slotColour as ae, slotGroups as af, stateAt as ag, storeysOf as ah, timeline as ai, viewLabel as aj, viewMesh as ak, type Pt as b, type Shell as c, type Ring3 as d, type Side as e, type Stair as f, type StairFlight as g, type MaterialSlot as h, type Furniture as i, type Fence as j, FENCE_PALETTE as k, FINISH_PALETTE as l, FIXTURE_FAMILIES as m, FLOOR_FINISHES as n, FLOOR_FINISH_RULES as o, type FloorFinish as p, GROUND_PLANE as q, GROUND_ROUGHNESS as r, stripAt as s, GROUND_SPLITS as t, GROUND_TINT as u, GROUND_WASH as v, type KindMaterial as w, MATERIAL_SLOTS as x, type MeshNode as y, type Meta as z };