@chanmeng666/archlang-3d 0.1.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { ResolvedPlan, RWall, Point, JoinedCut, loopsToPolygons, World, Diagnostic } from '@chanmeng666/archlang';
2
2
  export { Point } from '@chanmeng666/archlang';
3
- 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 Furniture, f as ReplayEvent, g as ReplayState } from './strip-DElA8ZbJ.js';
4
- export { D as DoorKind, E as EXPLODE_GAP_MM, h as FIXTURE_FAMILIES, i as Fence, L as Level, j as MeshNode, k as Meta, N as NodeKind, l as NodeState, O as Opening, m as Outdoor, n as PHASE, o as Provenance, R as ReplayFacts, p as ReplayView, q as Roof, r as STOP_LEAD, t as Source, u as Stage, v as Stair, S as StripItem, U as Um, W as Wall, w as authoringOrder, x as ease, y as explodeLifts, z as keyFrames, B as stateAt, C as storeysOf, s as stripAt, G as timeline, H as viewLabel, I as viewMesh } from './strip-DElA8ZbJ.js';
5
- export { F as FactsOptions, r as replayFacts } from './facts-fLIb8sZ2.js';
3
+ 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 MaterialSlot, f as Furniture } from './strip-CN_dTKqy.js';
4
+ export { D as DoorKind, E as EXPLODE_GAP_MM, g as FINISH_PALETTE, h as FIXTURE_FAMILIES, i as FLOOR_FINISHES, j as FLOOR_FINISH_RULES, k as Fence, l as FloorFinish, K as KIND_PALETTE, m as KindMaterial, L as Level, n as MATERIAL_SLOTS, o as MeshNode, p as Meta, N as NodeKind, q as NodeState, O as Opening, r as Outdoor, t as PALETTE, u as PHASE, v as Provenance, w as ReplayEvent, R as ReplayFacts, x as ReplayState, y as ReplayView, z as Roof, B as STOP_LEAD, C as SlotMaterial, G as Source, H as Stage, I as Stair, S as StripItem, U as Um, W as WALL_CAP_SRGB, J as Wall, Q as authoringOrder, T as ease, V as explodeLifts, X as finishColour, Y as floorFinish, Z as keyFrames, _ as linearRgb, $ as slotColour, a0 as slotGroups, a1 as stateAt, a2 as storeysOf, s as stripAt, a3 as timeline, a4 as viewLabel, a5 as viewMesh } from './strip-CN_dTKqy.js';
5
+ export { F as FactsOptions, r as replayFacts } from './facts-B47HOKOh.js';
6
+ 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 takenLens, v as targetBounds } from './camera-CLNYQ1Xv.js';
6
7
 
7
8
  /** The package's own version, stamped into `meta.tool`. */
8
9
  declare const ARCHLANG_3D_VERSION: string;
@@ -17,6 +18,12 @@ interface BuildOptions {
17
18
  coreVersion: string;
18
19
  /** Largest sagitta (mm) of an arc's chords; default {@link DEFAULT_CURVE_TOL_MM}. */
19
20
  curveTolMm?: number;
21
+ /**
22
+ * Per storey (in `storeys` order), the ids of the furniture the plan reflects, or `null` where
23
+ * that is unknown; read only for a handed asset (`T0_HANDED`). Omitted: unknown everywhere, so a
24
+ * handed piece stands as a grey box. `adaptPlan` fills it from the core's Plan JSON.
25
+ */
26
+ mirrored?: ReadonlyArray<ReadonlySet<string> | null>;
20
27
  }
21
28
  /** Resolved storeys (lowest first) → a Scene3D v0. */
22
29
  declare function buildScene3D(storeys: readonly Storey[], opts: BuildOptions): Scene3D;
@@ -172,41 +179,14 @@ declare function umPoint(p: {
172
179
  y: number;
173
180
  }): [number, number];
174
181
 
175
- /**
176
- * Scene3D → Mesh3D (archlang-3d M1a, card A2). Every solid is a closed prism over a Scene3D polygon
177
- * (`extrude.ts`); no boolean is computed here, because the core's joinery already gave each wall its
178
- * owned pieces with the openings removed (`Wall.body`) and each opening its cut. What the plan does
179
- * not state is a labelled default in the ledger (ADR 0005).
180
- *
181
- * Per storey, at its elevation `e` (µm):
182
- * - slab: the rooms ∪ the storey's wall outline, less its voids, [e − 200 mm, e] (Q6, `slab.ts`);
183
- * - floor: each room, a 5 mm finish [e, e + 5 mm], a void inside it as a hole; a room overlapping
184
- * an earlier one is lifted 0.5 mm per step (V-GEO-05, `Floor.lift`);
185
- * - column: its box, [e, e + storey height];
186
- * - wall: its body pieces [e, e + h]; under each cut a sill [e, e + sill], over it a lintel
187
- * [e + head, e + h] (§4.1 step 2; a cased opening's head at the wall top makes no lintel). The
188
- * body's vertical edges are split at every sill and head that meets them, so body, sill and
189
- * lintel meet vertex to vertex (no T-junction);
190
- * - a demolished wall (B3a): its own pieces [e, e + h], a ghost keyed `wall:<id>:demolish` with
191
- * `extras.status` "demolish", never one of the standing walls;
192
- * - door: leaves 40 mm thick, [e + sill, e + head]. Closed by default (Q11): the core's leaves for a
193
- * swinging door, one panel across the jambs for every other kind. `doors: "plan"` (`--doors plan`)
194
- * swings each of the core's leaves to the pose the plan draws (`openLeaf`); a kind that sweeps no
195
- * leaf (or a pre-A7 Scene3D leaf without its open tip) keeps its closed panel, ledgered. The 3D
196
- * leaf is a fixed 40 mm (at most half the leaf) where the core draws max(40 mm, 2 pens) capped at
197
- * 6 % of the width, so the two slabs can differ by a few mm in thickness; both share the hinge
198
- * edge on the open radius and lie inside the one sector (not a misalignment);
199
- * - window: a 16 mm glass pane across the jambs and a 40 × 60 mm frame (§4.3), every part kept
200
- * inside its cut; on a curved host both follow the arc from jamb face to jamb face (`cutSector`);
201
- * - furniture: a T0 parametric piece (`t0.ts`) fitted to its footprint for the twelve families it
202
- * covers, else a grey box on the floor finish, its height a per-family default;
203
- * - roof: a 150 mm flat slab on the storey's ring at the top of its tallest wall, hidden (Q7, D3).
204
- * Stairs, outdoor surfaces and fences are not built yet (M4 and later); the ledger says so.
205
- */
206
-
207
182
  /**
208
183
  * Grey-box heights (mm) by catalogue family: rounded typical heights, drafting defaults, not
209
184
  * measurements of any product. A family not listed stands {@link FURNITURE_DEFAULT_MM} high.
185
+ *
186
+ * Every family listed here now has a T0 generator (cards V3, V5, V6), so the table is read only
187
+ * when a T0 piece is built as a grey box after all: at a turn that is not a quarter turn (a
188
+ * hand-made Scene3D; the core turns furniture by quarter turns only). It stays for that, and
189
+ * because it is a public export of this package (removing it would break a consumer).
210
190
  */
211
191
  declare const FURNITURE_HEIGHT_MM: Readonly<Record<string, number>>;
212
192
  /** How the doors stand: `closed` (the default, Q11) or swung as the plan draws them (`plan`). */
@@ -309,167 +289,172 @@ declare function rectsOf(r: readonly Pt[]): Rect[];
309
289
  declare function slabRegion(footprint: readonly Ring3[], floors: readonly Floor[], ledger: Assumption[]): Polygon[];
310
290
 
311
291
  /**
312
- * T0 parametric furniture (archlang-3d plan §4.4, §5.1–5.3; card A2b): pure generators that build
313
- * a piece from a few boxes, rounded parts and plates with holes, fitted EXACTLY to the plan's
314
- * footprint. The twelve families laneway-house uses have one each; every other family stays a grey
315
- * box. Each generator is mirror-symmetric across its own width, so a mirrored piece (`place …
316
- * mirror`) needs no mirrored mesh and nothing gains handedness.
317
- *
318
- * Local frame (plan §3.4, §4.4): origin at the footprint's centre on the floor finish; +x along
319
- * the piece's width, +z its FRONT (an unturned piece faces plan +y, down the page), heights up.
320
- * The plan's `rotate` turns it clockwise on the page; widths and depths are fitted (the footprint
321
- * is never stretched in height: heights are fixed defaults, in the ledger). Lengths in mm here,
322
- * micrometres once placed.
292
+ * The T0 kit (visual-assets V2, V5, V6): the part type every generator returns and the few helpers
293
+ * the generators share, kept apart from `t0.ts` so the batch modules (`t0-living.ts`,
294
+ * `t0-utility.ts`) and `t0.ts` itself read them without an import cycle. Local frame and units:
295
+ * `t0.ts`.
323
296
  */
324
297
 
325
- /** One part: a plan rectangle (or the ellipse inscribed in it) from `y0` to `y1` above the floor,
326
- * optionally with holes (a worktop around its sink). Millimetres, local frame. */
327
- interface Part {
298
+ /** A section's shape inside its box: a box, the inscribed ellipse, rounded corners, or a polygon. */
299
+ interface SectionShape {
300
+ /** The ellipse inscribed in the box (a 16-gon). */
301
+ round?: boolean;
302
+ /** Rounded corners of this radius (mm; clamped to half the shorter side): quarter arcs. */
303
+ radius?: number;
304
+ /**
305
+ * An explicit polygon, each point a FRACTION of the box ([0, 1] on each axis, from its low
306
+ * corner; a point outside throws): a chaise's curve, a leaning cushion. It should touch all four
307
+ * sides of the box. It overrides `round` and `radius`.
308
+ */
309
+ profile?: ReadonlyArray<readonly [number, number]>;
310
+ }
311
+ /**
312
+ * One part, millimetres, local frame: the box `x0..x1` × `y0..y1` (above the floor) × `z0..z1`.
313
+ * Its section lies across the extrusion: plan (x, z) when vertical, (z, y) for `axis: "x"`,
314
+ * (x, y) for `axis: "z"`.
315
+ */
316
+ interface Part extends SectionShape {
328
317
  x0: number;
329
318
  x1: number;
330
319
  z0: number;
331
320
  z1: number;
332
321
  y0: number;
333
322
  y1: number;
334
- round?: boolean;
335
- holes?: Array<Omit<Part, "y0" | "y1" | "holes">>;
336
- }
337
- /** The families with a generator, each with the catalogue names it answers to (plan §5.2). */
338
- declare const T0_FAMILIES: Readonly<Record<string, readonly string[]>>;
339
- /** The asset a category is built with: `t0:<family>`, or `greybox` (plan §4.4 step 1). */
340
- declare const assetFor: (category: string) => string;
341
- /** The tallest point of each family (mm): the height the ledger records. */
342
- declare const T0_HEIGHT_MM: Readonly<Record<string, number>>;
343
- interface PlacedPart {
344
- polygon: Polygon;
345
- /** Above the floor finish, µm. */
346
- y0: number;
347
- y1: number;
323
+ /** Its material slot; omitted = `body` (the furniture kind's own colour). */
324
+ mat?: MaterialSlot;
325
+ /** Extruded sideways: along the width (`x`: a bolster, a rail) or the depth (`z`: an arm). */
326
+ axis?: "x" | "z";
327
+ /** Holes through a vertical part's plan section (a worktop around its sink); a sideways part with holes throws. */
328
+ holes?: Array<SectionShape & {
329
+ x0: number;
330
+ x1: number;
331
+ z0: number;
332
+ z1: number;
333
+ }>;
348
334
  }
335
+
349
336
  /**
350
- * `f`'s T0 parts, placed in plan micrometres: `null` when its asset is not T0 or its turn is not a
351
- * quarter turn (the grey box stands instead). The plan's `rotate` (clockwise on the page, y down)
352
- * maps local (x, z) to plan (x cos r − z sin r, x sin r + z cos r) about the footprint's centre; at
353
- * a quarter turn the piece's own width runs along plan y (`Furniture.size` is the turned box).
337
+ * T0 parametric furniture (archlang-3d plan §4.4, §5.1–5.3; card A2b; visual-assets V1–V3,
338
+ * V5–V7): pure generators that build a piece from a few parts, fitted EXACTLY to the plan's
339
+ * footprint. The twelve families laneway-house uses are here; the living, bedroom, dining and
340
+ * office batch is `t0-living.ts` (V5), the kitchen, bath and utility batch `t0-utility.ts` (V6),
341
+ * the site (planting, garden, vehicles, terrace, the small standing objects) `t0-outdoor.ts` and
342
+ * the office and commercial pieces `t0-office.ts` (V7). Every catalogued family is built; a word
343
+ * outside the catalogue stays a grey box.
344
+ *
345
+ * Every generator is mirror-symmetric across its own width, so a mirrored piece (`mirror`,
346
+ * `place … mirror`) needs no mirrored mesh and nothing gains handedness (`test/t0.test.ts` holds
347
+ * it) — except the few `handed` families whose shape cannot be (`T0_HANDED`: an L-sofa, a chaise,
348
+ * a grand piano, a reception desk; a bicycle and a motorcycle where they lie along their width,
349
+ * `handedAt`). The core draws those handed as well, and reflects the drawing of a mirrored
350
+ * piece; the model follows it: a handed piece the plan reflects carries `Furniture.mirror` and is
351
+ * built as the reflection (`t0Shells`), so the model never shows the other hand from the drawing.
352
+ *
353
+ * A wall-hung family hangs at a ledgered height instead of standing on the floor, by its underside
354
+ * (`T0_MOUNT_MM`: a wall cabinet, a hood, a mirror, a urinal) or by its top (`T0_HUNG_FROM_TOP`: a
355
+ * television, whose underside each piece's size sets and the ledger records per piece): the core
356
+ * marks such a piece only by drawing it dashed and exports no height, so the mount is this
357
+ * package's labelled default.
358
+ *
359
+ * A part is a prism over a SECTION: a box, the ellipse inscribed in it (`round`), a box with
360
+ * rounded corners (`radius`, quarter arcs from the exact 16-gon table) or an explicit polygon
361
+ * (`profile`), extruded up (the default) or sideways (`axis`: along the width, `x`, or the depth,
362
+ * `z`), optionally with holes (vertical parts). Each part names its material slot (`mat`,
363
+ * `materials.ts`); untagged is `body`.
364
+ *
365
+ * Local frame (plan §3.4, §4.4): origin at the footprint's centre on the floor finish; +x along
366
+ * the piece's width, +z its FRONT (an unturned piece faces plan +y, down the page), heights up.
367
+ * The plan's `rotate` turns it clockwise on the page; widths and depths are fitted (the footprint
368
+ * is never stretched in height: heights are fixed defaults, in the ledger). Lengths in mm here,
369
+ * micrometres once placed.
354
370
  */
355
- declare function t0Parts(f: Furniture): PlacedPart[] | null;
356
371
 
357
372
  /**
358
- * The replay's end camera as plain maths (card A3, look notes round 1): the viewer and the tests
359
- * read the same functions, so "the end frame fills the canvas" is a property a test can check
360
- * without a browser. Millimetres, the exporters' axes (X plan x, Y up, Z plan y). No three.js here:
361
- * the conventions copy three.js's `lookAt` for a camera (it looks down its local −Z; right =
362
- * up × back, true up = back × right, world up +Y).
373
+ * The families with a generator, each with the catalogue names it answers to (plan §5.2): every
374
+ * word of the core's family row (`FIXTURE_FAMILIES`), so no alias of a built family falls back to
375
+ * a grey box (`test/t0.test.ts` reads the core's table). `double_bed` is built by the bed's
376
+ * generator and `dining_table` by the table's, as their catalogue rows are separate families.
363
377
  */
364
-
365
- type Vec3 = [number, number, number];
366
- interface Box {
367
- lo: Vec3;
368
- hi: Vec3;
369
- }
370
- /** Where the end camera looks from: elevation and azimuth in degrees, vertical field of view. */
371
- interface Orbit {
372
- elevation: number;
373
- azimuth: number;
374
- fov: number;
375
- /** Canvas width / height. */
376
- aspect: number;
377
- }
378
- interface EndCamera {
379
- target: Vec3;
380
- /** Distance from the target to the camera (mm). */
381
- dist: number;
382
- }
378
+ declare const T0_FAMILIES: Readonly<Record<string, readonly string[]>>;
379
+ /** The asset a category is built with: `t0:<family>`, or `greybox` (plan §4.4 step 1). */
380
+ declare const assetFor: (category: string) => string;
381
+ /** The tallest point of each family (mm): the height the ledger records. */
382
+ declare const T0_HEIGHT_MM: Readonly<Record<string, number>>;
383
383
  /**
384
- * The fraction of each half-axis the building may use: a margin of 6 % of the frame on each side
385
- * of the binding axis.
384
+ * The underside of each wall-hung family (mm above the floor finish; the ledger's
385
+ * `furniture-mount-default`): a wall cabinet's 1400 mm (card V6), a hood 700 mm over a 900 mm hob,
386
+ * a mirror over a basin, a urinal's rim height less its bowl. Nothing of the piece is drawn below
387
+ * it and the piece is never carried down to the floor.
386
388
  */
387
- declare const FILL = 0.88;
388
- declare function corners(b: Box): Vec3[];
389
+ declare const T0_MOUNT_MM: Readonly<Record<string, number>>;
389
390
  /**
390
- * The projected extent of `box` in normalised device coordinates (−1…1 on each axis) for a camera
391
- * at `cam` with orbit `o`.
391
+ * The families hung by their TOP at their `T0_HEIGHT_MM` (a television: its panel 16:9 from its
392
+ * width, at most 760 mm tall), so each piece's underside depends on its size: the mesh builder
393
+ * ledgers the piece's own (`furniture-mount-from-top`), never one figure for the family.
392
394
  */
393
- declare function projectBox(box: Box, cam: EndCamera, o: Orbit): {
394
- x: [number, number];
395
- y: [number, number];
396
- };
395
+ declare const T0_HUNG_FROM_TOP: ReadonlySet<string>;
396
+ /** The handed families (`T0Family.handed`): built reflected when the plan reflects the piece. */
397
+ declare const T0_HANDED: ReadonlySet<string>;
397
398
  /**
398
- * The end camera that fills the frame with `box`: the 8 corners are projected through the end
399
- * orbit and the distance is solved so the binding corner sits at `FILL` of the half-frame; the
400
- * target is then re-centred on the projected box (perspective makes the near half larger) and the
401
- * distance solved again. A fixed number of rounds, so the result is a pure function of its input.
399
+ * Whether a piece of `family`, `W` × `D` mm in its own frame, is handed: always for an L-sofa or
400
+ * a reception desk, only along its width for a bicycle or a motorcycle (the core reads both off
401
+ * their long axis), never for a symmetric family.
402
402
  */
403
- declare function fitEndCamera(box: Box, o: Orbit): EndCamera;
404
- /** The share of the binding axis the projected box fills (1 = edge to edge). */
405
- declare function coverage(box: Box, cam: EndCamera, o: Orbit): number;
406
- /** The end camera's lens and bearing. */
407
- declare const END_FOV = 30;
408
- declare const END_AZIMUTH = -32;
403
+ declare function handedAt(family: string, W: number, D: number): boolean;
409
404
  /**
410
- * The end camera's elevation: 45° for every view. The combined view of a taller building needs it so
411
- * the exploded gaps show the floors below (see `timeline.ts`'s header); a one-storey view took it
412
- * too (card A9, by delegation, the owner may veto on a look): at 30° the near walls hid the floor,
413
- * the inner doors and most furniture of `studio`. The storey count stays a parameter so a later
414
- * look can split the two again without a signature change.
405
+ * The material slots each family's parts use (the ledger's `furniture-material-default`, ADR 0030
406
+ * decision 5): a property of the family, never read from a label. `test/t0.test.ts` holds every
407
+ * generator to its row.
415
408
  */
416
- declare const endElevation: (_storeys: number) => number;
409
+ declare const T0_MATERIALS: Readonly<Record<string, readonly Exclude<MaterialSlot, "body">[]>>;
417
410
  /**
418
- * The scene's box (mm) from the payload's nodes: positions in micrometres, each node lifted by its
419
- * `lift` (the combined view's exploded storeys). A demolished wall's ghost (`part` "demolish") is not
420
- * the building and is left out of a fit (`timeline.ts`'s header), unless nothing else is there;
421
- * `ghosts: true` keeps it, for a box that must hold everything drawn (the viewer's clip range).
411
+ * A section's ring in whole micrometres: the box `u0..u1` × `v0..v1` (mm) as a box, the ellipse
412
+ * inscribed in it, a box with rounded corners (four quarter arcs, five points each, from the
413
+ * 16-gon table) or an explicit polygon in fractions of the box (`profile` wins over `round` and
414
+ * `radius`). No repeated points. An empty or inverted box (`u0 ≥ u1` or `v0 ≥ v1`) has no ring:
415
+ * `[]`, which the extruder treats as degenerate (a hole it leaves out, an outer it refuses).
422
416
  */
423
- declare function boxOfNodes(nodes: ReadonlyArray<{
424
- positions: readonly number[];
425
- lift?: number;
426
- part?: string;
427
- }>, opts?: {
428
- ghosts?: boolean;
429
- }): Box;
430
- /** The perspective camera's lens at the start of the dolly (a near-orthographic top-down view). */
431
- declare const START_FOV = 1.5;
417
+ declare function sectionRing(u0: number, u1: number, v0: number, v1: number, shape?: SectionShape): Pt[];
432
418
  /**
433
- * One fitted camera per stop: stop k fills the frame with storeys 0…k (the combined view; a node's
434
- * storey is its event's), the last stop with the whole building. One storey: one stop. Each stop is
435
- * fitted for the end orbit, which `stateAt` has reached by the time of the first stop.
419
+ * One part's closed, outward-wound shell in local micrometres (x width, y up from the floor
420
+ * finish, z front), carrying its slot unless `body`; `null` if its box is empty or inverted, or
421
+ * its section is degenerate.
422
+ *
423
+ * Holes never open a shell: a degenerate hole is left out, and holes that touch the outline or
424
+ * each other are all left out (the part is built whole); either way their count is added to
425
+ * `dropped.holes`, so the mesh builder ledgers them (`hole-degenerate`), never silently.
426
+ *
427
+ * The extruder builds every prism upright (plan ring, heights up). A sideways part is that prism
428
+ * with its axes relabelled: `x` maps (u, h, v) → (h, v, u), a cyclic permutation, so the winding
429
+ * stays outward; `z` maps (u, h, v) → (u, v, h), a swap, so each triangle is turned back over.
436
430
  */
437
- declare function cameraStops(nodes: ReadonlyArray<{
438
- key: string;
439
- positions: readonly number[];
440
- lift?: number;
441
- part?: string;
442
- }>, events: readonly ReplayEvent[], o: Orbit): EndCamera[];
443
- /** The fitted camera at a (fractional) stop: between two stops, a straight blend of the two. */
444
- declare function cameraAtStop(fits: readonly EndCamera[], stop: number): EndCamera;
445
- /** The perspective camera of one frame: where it aims, from how far, with which lens and bearing. */
446
- interface FrameCamera {
447
- target: Vec3;
448
- dist: number;
449
- fov: number;
450
- elevation: number;
451
- azimuth: number;
452
- }
431
+ declare function partShell(p: Part, dropped?: {
432
+ holes: number;
433
+ }): Shell | null;
453
434
  /**
454
- * The perspective camera at state `s` (the viewer's `seek`): from straight down over the drawing's
455
- * centre (`cx`, `cz`; `oh` the drawing's height in the frame) it tilts to the end orbit and dollies
456
- * to the fitted camera of the current stop.
435
+ * A family's parts for a piece `W` × `D` mm (local frame), or `null` for a family without a
436
+ * generator. Every part is clipped to the footprint and to the family's ledgered height, so no ink
437
+ * leaves either on a small or thin piece, and a part the clip leaves thinner than `MIN_PART_MM`
438
+ * is left out. The clip is symmetric about x = 0, so a mirror-symmetric generator stays so.
457
439
  */
458
- declare function frameCamera(s: Pick<ReplayState, "tilt" | "dolly" | "stop">, fits: readonly EndCamera[], view: {
459
- cx: number;
460
- cz: number;
461
- oh: number;
462
- elevation: number;
463
- }): FrameCamera;
440
+ declare function t0LocalParts(family: string, W: number, D: number): Part[] | null;
464
441
  /**
465
- * The first frame frames the core drawing's viewBox exactly, letterboxed as the image is: its
466
- * centre (`cx`, `cz`) and the height (`oh`) and width (`ow`) it spans in the frame, in plan mm.
442
+ * `f`'s T0 shells, placed in plan micrometres with the floor finish at `floor` (µm), and how many
443
+ * holes they were built without (`partShell`; the mesh builder ledgers them): `null` when its
444
+ * asset is not T0 or its turn is not a quarter turn (the grey box stands instead); a `null` shell
445
+ * is a part whose section was degenerate (the mesh builder ledgers it too). The plan's `rotate`
446
+ * (clockwise on the page, y down) maps local (x, z) to plan (x cos r − z sin r, x sin r + z cos r)
447
+ * about the footprint's centre, a proper rotation, so every shell stays outward-wound; at a quarter
448
+ * turn the piece's own width runs along plan y (`Furniture.size` is the turned box).
449
+ *
450
+ * A reflected piece (`f.mirror`, set on a handed family only) is built as its reflection across
451
+ * its own width BEFORE the turn, exactly as the core draws it (`glyph-chirality.ts`: reflect the
452
+ * symbol about its own vertical centre line, then apply the quarter turn): local x → −x on every
453
+ * vertex, each triangle turned back over so the shell stays outward-wound. Exact in integers.
467
454
  */
468
- declare function drawingFrame(viewBox: readonly [number, number, number, number], aspect: number): {
469
- cx: number;
470
- cz: number;
471
- ow: number;
472
- oh: number;
473
- };
455
+ declare function t0Shells(f: Furniture, floor: number): {
456
+ shells: Array<Shell | null>;
457
+ holesDropped: number;
458
+ } | null;
474
459
 
475
- export { ARCHLANG_3D_VERSION, type AdaptOptions, type AdaptResult, Assumption, type Box, type BuildOptions, type CutSector, DOOR_POSES, type DoorPose, END_AZIMUTH, END_FOV, type EndCamera, FILL, FLOOR_LIFT_UM, FLOOR_OVERLAP_MIN_UM2, FURNITURE_HEIGHT_MM, Floor, type FloorOverlap, type FrameCamera, Furniture, MIN_CORE, Mesh3D, type MeshOptions, type MixedHeightJoint, type Orbit, type OwnedWall, type Ownership, type Part, type Piece, type PlacedPart, Polygon, Pt, type Refusal, type RefusalCode, ReplayEvent, ReplayState, type Ring, Ring3, START_FOV, Scene3D, Shell, type Storey, T0_FAMILIES, T0_HEIGHT_MM, type ValidationIssue, type Vec3, type Warning3D, adaptPlan, assetFor, boxOfNodes, buildMesh, buildScene3D, cameraAtStop, cameraStops, clipToConvex, corners, coverage, cutSector, drawingFrame, endElevation, fitEndCamera, floorLifts, floorOverlaps, frameCamera, insideCut, mixedHeightJoints, openLeaf, overlapArea, piecesOf, piecesTouch, prism, projectBox, rectsOf, sectorBand, slab2d, slabRegion, t0Parts, um, umPoint, validateScene3D, wallOwnership };
460
+ export { ARCHLANG_3D_VERSION, type AdaptOptions, type AdaptResult, Assumption, type BuildOptions, type CutSector, DOOR_POSES, type DoorPose, FLOOR_LIFT_UM, FLOOR_OVERLAP_MIN_UM2, FURNITURE_HEIGHT_MM, Floor, type FloorOverlap, Furniture, MIN_CORE, MaterialSlot, Mesh3D, type MeshOptions, type MixedHeightJoint, type OwnedWall, type Ownership, type Part, type Piece, Polygon, Pt, type Refusal, type RefusalCode, type Ring, Ring3, Scene3D, type SectionShape, Shell, 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, cutSector, floorLifts, floorOverlaps, handedAt, insideCut, mixedHeightJoints, openLeaf, overlapArea, partShell, piecesOf, piecesTouch, prism, rectsOf, sectionRing, sectorBand, slab2d, slabRegion, t0LocalParts, t0Shells, um, umPoint, validateScene3D, wallOwnership };
package/dist/index.js CHANGED
@@ -4,84 +4,128 @@ import {
4
4
  MIN_CORE,
5
5
  adaptPlan,
6
6
  buildMesh,
7
- clipToConvex,
8
- cutSector,
9
- insideCut,
10
7
  openLeaf,
11
- prism,
12
8
  rectsOf,
13
- sectorBand,
14
- slab2d,
15
9
  slabRegion
16
- } from "./chunk-DLZMYNAR.js";
10
+ } from "./chunk-QUSG4UCO.js";
17
11
  import {
18
12
  ARCHLANG_3D_VERSION,
19
13
  FLOOR_LIFT_UM,
20
14
  FLOOR_OVERLAP_MIN_UM2,
21
15
  T0_FAMILIES,
16
+ T0_HANDED,
22
17
  T0_HEIGHT_MM,
18
+ T0_HUNG_FROM_TOP,
19
+ T0_MATERIALS,
20
+ T0_MOUNT_MM,
23
21
  assetFor,
24
22
  buildScene3D,
23
+ clipToConvex,
24
+ cutSector,
25
25
  floorLifts,
26
26
  floorOverlaps,
27
+ handedAt,
28
+ insideCut,
27
29
  mixedHeightJoints,
28
30
  overlapArea,
31
+ partShell,
29
32
  piecesOf,
30
33
  piecesTouch,
34
+ prism,
31
35
  replayFacts,
32
- t0Parts,
36
+ sectionRing,
37
+ sectorBand,
38
+ slab2d,
39
+ t0LocalParts,
40
+ t0Shells,
33
41
  um,
34
42
  umPoint,
35
43
  validateScene3D,
36
44
  wallOwnership
37
- } from "./chunk-PJMKP2ML.js";
45
+ } from "./chunk-PRZXP6FP.js";
38
46
  import {
47
+ ELEVATION_AZIMUTH,
48
+ ELEVATION_RANGE,
39
49
  END_AZIMUTH,
40
50
  END_FOV,
41
51
  EXPLODE_GAP_MM,
42
52
  FILL,
53
+ FINISH_PALETTE,
43
54
  FIXTURE_FAMILIES,
55
+ FLOOR_FINISHES,
56
+ FLOOR_FINISH_RULES,
57
+ KIND_PALETTE,
58
+ MATERIAL_SLOTS,
59
+ PALETTE,
44
60
  PHASE,
61
+ PRESET_NAMES,
45
62
  START_FOV,
46
63
  STOP_LEAD,
64
+ WALL_CAP_SRGB,
65
+ ZOOM,
47
66
  authoringOrder,
48
67
  boxOfNodes,
49
68
  cameraAtStop,
50
69
  cameraStops,
51
70
  corners,
52
71
  coverage,
72
+ distanceLimits,
53
73
  drawingFrame,
54
74
  ease,
55
75
  endElevation,
56
76
  explodeLifts,
77
+ finishColour,
57
78
  fitEndCamera,
79
+ floorFinish,
58
80
  frameCamera,
59
81
  keyFrames,
82
+ linearRgb,
83
+ pivotAbove,
84
+ presetCamera,
60
85
  projectBox,
86
+ slotColour,
87
+ slotGroups,
61
88
  stateAt,
62
89
  storeysOf,
63
90
  stripAt,
91
+ takenLens,
92
+ targetBounds,
64
93
  timeline,
65
94
  viewLabel,
66
95
  viewMesh
67
- } from "./chunk-CTFMM64C.js";
96
+ } from "./chunk-VPYTRKMK.js";
68
97
  export {
69
98
  ARCHLANG_3D_VERSION,
70
99
  DOOR_POSES,
100
+ ELEVATION_AZIMUTH,
101
+ ELEVATION_RANGE,
71
102
  END_AZIMUTH,
72
103
  END_FOV,
73
104
  EXPLODE_GAP_MM,
74
105
  FILL,
106
+ FINISH_PALETTE,
75
107
  FIXTURE_FAMILIES,
108
+ FLOOR_FINISHES,
109
+ FLOOR_FINISH_RULES,
76
110
  FLOOR_LIFT_UM,
77
111
  FLOOR_OVERLAP_MIN_UM2,
78
112
  FURNITURE_HEIGHT_MM,
113
+ KIND_PALETTE,
114
+ MATERIAL_SLOTS,
79
115
  MIN_CORE,
116
+ PALETTE,
80
117
  PHASE,
118
+ PRESET_NAMES,
81
119
  START_FOV,
82
120
  STOP_LEAD,
83
121
  T0_FAMILIES,
122
+ T0_HANDED,
84
123
  T0_HEIGHT_MM,
124
+ T0_HUNG_FROM_TOP,
125
+ T0_MATERIALS,
126
+ T0_MOUNT_MM,
127
+ WALL_CAP_SRGB,
128
+ ZOOM,
85
129
  adaptPlan,
86
130
  assetFor,
87
131
  authoringOrder,
@@ -94,32 +138,46 @@ export {
94
138
  corners,
95
139
  coverage,
96
140
  cutSector,
141
+ distanceLimits,
97
142
  drawingFrame,
98
143
  ease,
99
144
  endElevation,
100
145
  explodeLifts,
146
+ finishColour,
101
147
  fitEndCamera,
148
+ floorFinish,
102
149
  floorLifts,
103
150
  floorOverlaps,
104
151
  frameCamera,
152
+ handedAt,
105
153
  insideCut,
106
154
  keyFrames,
155
+ linearRgb,
107
156
  mixedHeightJoints,
108
157
  openLeaf,
109
158
  overlapArea,
159
+ partShell,
110
160
  piecesOf,
111
161
  piecesTouch,
162
+ pivotAbove,
163
+ presetCamera,
112
164
  prism,
113
165
  projectBox,
114
166
  rectsOf,
115
167
  replayFacts,
168
+ sectionRing,
116
169
  sectorBand,
117
170
  slab2d,
118
171
  slabRegion,
172
+ slotColour,
173
+ slotGroups,
119
174
  stateAt,
120
175
  storeysOf,
121
176
  stripAt,
122
- t0Parts,
177
+ t0LocalParts,
178
+ t0Shells,
179
+ takenLens,
180
+ targetBounds,
123
181
  timeline,
124
182
  um,
125
183
  umPoint,
package/dist/node.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { World } from '@chanmeng666/archlang';
2
- import { M as Mesh3D, f as ReplayEvent, j as MeshNode, a as Scene3D, c as Shell } from './strip-DElA8ZbJ.js';
3
- export { R as ReplayFacts, S as StripItem, s as stripAt } from './strip-DElA8ZbJ.js';
2
+ import { M as Mesh3D, w as ReplayEvent, o as MeshNode, a as Scene3D, c as Shell } from './strip-CN_dTKqy.js';
3
+ export { R as ReplayFacts, S as StripItem, s as stripAt } from './strip-CN_dTKqy.js';
4
4
  import { ReplayOptions } from './replay.js';
5
5
  export { PREVIEW_LABEL, replayPayload, viewBoxOf } from './replay.js';
6
- export { F as FactsOptions, r as replayFacts } from './facts-fLIb8sZ2.js';
6
+ export { F as FactsOptions, r as replayFacts } from './facts-B47HOKOh.js';
7
7
 
8
8
  /** The viewer and the parts of three.js it uses, as one minified browser script (read once). */
9
9
  declare function viewerScript(): Promise<string>;
@@ -54,6 +54,12 @@ declare function renderReplay(o: VideoOptions): Promise<VideoReport>;
54
54
 
55
55
  /** `asset.generator`: the package and its version, never a time (plan §3.7). */
56
56
  declare const GLB_GENERATOR: string;
57
+ /**
58
+ * The material a node's untagged (`body`) shells are written in (visual-assets V9): a floor's finish
59
+ * (`floor:<finish>`, from `extras.finish`), a window's frame or glass, a demolished wall's ghost
60
+ * (`wall:demolish`, B3a), else its kind. Each reads the one palette the viewer reads (`materials.ts`).
61
+ */
62
+ declare function bodyMaterialName(n: MeshNode): string;
57
63
  /** The glTF node name of a Mesh3D node: its key without the storey prefix (plan §3.6). */
58
64
  declare const glbNodeName: (n: MeshNode) => string;
59
65
  /** The storey group node's name. */
@@ -127,4 +133,4 @@ declare function checkGlb(glb: Uint8Array, mesh?: Mesh3D): Promise<CheckResult[]
127
133
  /** A World that reads an `import`ed module relative to `baseDir`; a missing file reads as `null`. */
128
134
  declare function makeNodeWorld(baseDir: string): World;
129
135
 
130
- export { type CheckId, type CheckResult, GLB_GENERATOR, type GlbNode, type KeyFrame, ReplayOptions, SWIFTSHADER_ARGS, type VideoOptions, type VideoReport, checkGlb, checkNaming, checkScene, checkShells, checkValidator, glbJson, glbLeaks, glbNodeName, levelNodeName, makeNodeWorld, nodeExtras, openEdges, readGlbNodes, renderReplay, replayHtml, signedVolume, viewerScript, writeGlb };
136
+ export { type CheckId, type CheckResult, GLB_GENERATOR, type GlbNode, type KeyFrame, ReplayOptions, SWIFTSHADER_ARGS, type VideoOptions, type VideoReport, bodyMaterialName, checkGlb, checkNaming, checkScene, checkShells, checkValidator, glbJson, glbLeaks, glbNodeName, levelNodeName, makeNodeWorld, nodeExtras, openEdges, readGlbNodes, renderReplay, replayHtml, signedVolume, viewerScript, writeGlb };
package/dist/node.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  GLB_GENERATOR,
3
3
  SWIFTSHADER_ARGS,
4
+ bodyMaterialName,
4
5
  checkGlb,
5
6
  checkNaming,
6
7
  checkScene,
@@ -19,22 +20,23 @@ import {
19
20
  signedVolume,
20
21
  viewerScript,
21
22
  writeGlb
22
- } from "./chunk-KIRWFAD6.js";
23
+ } from "./chunk-ZE4PL6KP.js";
23
24
  import {
24
25
  replayFacts
25
- } from "./chunk-PJMKP2ML.js";
26
+ } from "./chunk-PRZXP6FP.js";
26
27
  import {
27
28
  PREVIEW_LABEL,
28
29
  replayPayload,
29
30
  viewBoxOf
30
- } from "./chunk-54YVSAVZ.js";
31
+ } from "./chunk-WBA4LABI.js";
31
32
  import {
32
33
  stripAt
33
- } from "./chunk-CTFMM64C.js";
34
+ } from "./chunk-VPYTRKMK.js";
34
35
  export {
35
36
  GLB_GENERATOR,
36
37
  PREVIEW_LABEL,
37
38
  SWIFTSHADER_ARGS,
39
+ bodyMaterialName,
38
40
  checkGlb,
39
41
  checkNaming,
40
42
  checkScene,