@chanmeng666/archlang-3d 0.1.2 → 0.2.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/CHANGELOG.md +52 -0
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +93 -48
- package/dist/{chunk-54YVSAVZ.js → chunk-2ZINQMUB.js} +18 -6
- package/dist/{chunk-DLZMYNAR.js → chunk-4AF5Q7M3.js} +104 -267
- package/dist/{chunk-CTFMM64C.js → chunk-EYEEIS4R.js} +128 -1
- package/dist/{chunk-KIRWFAD6.js → chunk-KUK6ARJC.js} +52 -32
- package/dist/chunk-VUSBWX7N.js +4125 -0
- package/dist/cli.js +5 -5
- package/dist/{facts-fLIb8sZ2.d.ts → facts-DHuCDilh.d.ts} +1 -1
- package/dist/index.d.ts +166 -64
- package/dist/index.js +51 -11
- package/dist/node.d.ts +10 -4
- package/dist/node.js +6 -4
- package/dist/replay.d.ts +12 -1
- package/dist/scene3d.schema.json +4 -0
- package/dist/{strip-DElA8ZbJ.d.ts → strip-CdTeMoHA.d.ts} +102 -1
- package/dist/viewer.iife.js +175 -175
- package/package.json +1 -1
- package/dist/chunk-PJMKP2ML.js +0 -950
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
DOOR_POSES,
|
|
4
4
|
adaptPlan,
|
|
5
5
|
buildMesh
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4AF5Q7M3.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-
|
|
16
|
+
} from "./chunk-KUK6ARJC.js";
|
|
17
17
|
import {
|
|
18
18
|
ARCHLANG_3D_VERSION,
|
|
19
19
|
replayFacts
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-VUSBWX7N.js";
|
|
21
|
+
import "./chunk-2ZINQMUB.js";
|
|
22
22
|
import {
|
|
23
23
|
storeysOf,
|
|
24
24
|
timeline,
|
|
25
25
|
viewLabel,
|
|
26
26
|
viewMesh
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-EYEEIS4R.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 {
|
|
2
|
+
import { y as ReplayView, R as ReplayFacts } from './strip-CdTeMoHA.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,8 +1,8 @@
|
|
|
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
|
|
4
|
-
export { D as DoorKind, E as EXPLODE_GAP_MM,
|
|
5
|
-
export { F as FactsOptions, r as replayFacts } from './facts-
|
|
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, g as ReplayEvent, h as ReplayState } from './strip-CdTeMoHA.js';
|
|
4
|
+
export { D as DoorKind, E as EXPLODE_GAP_MM, i as FINISH_PALETTE, j as FIXTURE_FAMILIES, k as FLOOR_FINISHES, l as FLOOR_FINISH_RULES, m as Fence, n as FloorFinish, K as KIND_PALETTE, o as KindMaterial, L as Level, p as MATERIAL_SLOTS, q as MeshNode, r as Meta, N as NodeKind, t as NodeState, O as Opening, u as Outdoor, v as PALETTE, w as PHASE, x as Provenance, R as ReplayFacts, 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-CdTeMoHA.js';
|
|
5
|
+
export { F as FactsOptions, r as replayFacts } from './facts-DHuCDilh.js';
|
|
6
6
|
|
|
7
7
|
/** The package's own version, stamped into `meta.tool`. */
|
|
8
8
|
declare const ARCHLANG_3D_VERSION: string;
|
|
@@ -17,6 +17,12 @@ interface BuildOptions {
|
|
|
17
17
|
coreVersion: string;
|
|
18
18
|
/** Largest sagitta (mm) of an arc's chords; default {@link DEFAULT_CURVE_TOL_MM}. */
|
|
19
19
|
curveTolMm?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Per storey (in `storeys` order), the ids of the furniture the plan reflects, or `null` where
|
|
22
|
+
* that is unknown; read only for a handed asset (`T0_HANDED`). Omitted: unknown everywhere, so a
|
|
23
|
+
* handed piece stands as a grey box. `adaptPlan` fills it from the core's Plan JSON.
|
|
24
|
+
*/
|
|
25
|
+
mirrored?: ReadonlyArray<ReadonlySet<string> | null>;
|
|
20
26
|
}
|
|
21
27
|
/** Resolved storeys (lowest first) → a Scene3D v0. */
|
|
22
28
|
declare function buildScene3D(storeys: readonly Storey[], opts: BuildOptions): Scene3D;
|
|
@@ -172,41 +178,14 @@ declare function umPoint(p: {
|
|
|
172
178
|
y: number;
|
|
173
179
|
}): [number, number];
|
|
174
180
|
|
|
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
181
|
/**
|
|
208
182
|
* Grey-box heights (mm) by catalogue family: rounded typical heights, drafting defaults, not
|
|
209
183
|
* measurements of any product. A family not listed stands {@link FURNITURE_DEFAULT_MM} high.
|
|
184
|
+
*
|
|
185
|
+
* Every family listed here now has a T0 generator (cards V3, V5, V6), so the table is read only
|
|
186
|
+
* when a T0 piece is built as a grey box after all: at a turn that is not a quarter turn (a
|
|
187
|
+
* hand-made Scene3D; the core turns furniture by quarter turns only). It stays for that, and
|
|
188
|
+
* because it is a public export of this package (removing it would break a consumer).
|
|
210
189
|
*/
|
|
211
190
|
declare const FURNITURE_HEIGHT_MM: Readonly<Record<string, number>>;
|
|
212
191
|
/** How the doors stand: `closed` (the default, Q11) or swung as the plan draws them (`plan`). */
|
|
@@ -309,50 +288,173 @@ declare function rectsOf(r: readonly Pt[]): Rect[];
|
|
|
309
288
|
declare function slabRegion(footprint: readonly Ring3[], floors: readonly Floor[], ledger: Assumption[]): Polygon[];
|
|
310
289
|
|
|
311
290
|
/**
|
|
312
|
-
* T0
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
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.
|
|
291
|
+
* The T0 kit (visual-assets V2, V5, V6): the part type every generator returns and the few helpers
|
|
292
|
+
* the generators share, kept apart from `t0.ts` so the batch modules (`t0-living.ts`,
|
|
293
|
+
* `t0-utility.ts`) and `t0.ts` itself read them without an import cycle. Local frame and units:
|
|
294
|
+
* `t0.ts`.
|
|
323
295
|
*/
|
|
324
296
|
|
|
325
|
-
/**
|
|
326
|
-
|
|
327
|
-
|
|
297
|
+
/** A section's shape inside its box: a box, the inscribed ellipse, rounded corners, or a polygon. */
|
|
298
|
+
interface SectionShape {
|
|
299
|
+
/** The ellipse inscribed in the box (a 16-gon). */
|
|
300
|
+
round?: boolean;
|
|
301
|
+
/** Rounded corners of this radius (mm; clamped to half the shorter side): quarter arcs. */
|
|
302
|
+
radius?: number;
|
|
303
|
+
/**
|
|
304
|
+
* An explicit polygon, each point a FRACTION of the box ([0, 1] on each axis, from its low
|
|
305
|
+
* corner; a point outside throws): a chaise's curve, a leaning cushion. It should touch all four
|
|
306
|
+
* sides of the box. It overrides `round` and `radius`.
|
|
307
|
+
*/
|
|
308
|
+
profile?: ReadonlyArray<readonly [number, number]>;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* One part, millimetres, local frame: the box `x0..x1` × `y0..y1` (above the floor) × `z0..z1`.
|
|
312
|
+
* Its section lies across the extrusion: plan (x, z) when vertical, (z, y) for `axis: "x"`,
|
|
313
|
+
* (x, y) for `axis: "z"`.
|
|
314
|
+
*/
|
|
315
|
+
interface Part extends SectionShape {
|
|
328
316
|
x0: number;
|
|
329
317
|
x1: number;
|
|
330
318
|
z0: number;
|
|
331
319
|
z1: number;
|
|
332
320
|
y0: number;
|
|
333
321
|
y1: number;
|
|
334
|
-
|
|
335
|
-
|
|
322
|
+
/** Its material slot; omitted = `body` (the furniture kind's own colour). */
|
|
323
|
+
mat?: MaterialSlot;
|
|
324
|
+
/** Extruded sideways: along the width (`x`: a bolster, a rail) or the depth (`z`: an arm). */
|
|
325
|
+
axis?: "x" | "z";
|
|
326
|
+
/** Holes through a vertical part's plan section (a worktop around its sink); a sideways part with holes throws. */
|
|
327
|
+
holes?: Array<SectionShape & {
|
|
328
|
+
x0: number;
|
|
329
|
+
x1: number;
|
|
330
|
+
z0: number;
|
|
331
|
+
z1: number;
|
|
332
|
+
}>;
|
|
336
333
|
}
|
|
337
|
-
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* T0 parametric furniture (archlang-3d plan §4.4, §5.1–5.3; card A2b; visual-assets V1–V3,
|
|
337
|
+
* V5–V7): pure generators that build a piece from a few parts, fitted EXACTLY to the plan's
|
|
338
|
+
* footprint. The twelve families laneway-house uses are here; the living, bedroom, dining and
|
|
339
|
+
* office batch is `t0-living.ts` (V5), the kitchen, bath and utility batch `t0-utility.ts` (V6),
|
|
340
|
+
* the site (planting, garden, vehicles, terrace, the small standing objects) `t0-outdoor.ts` and
|
|
341
|
+
* the office and commercial pieces `t0-office.ts` (V7). Every catalogued family is built; a word
|
|
342
|
+
* outside the catalogue stays a grey box.
|
|
343
|
+
*
|
|
344
|
+
* Every generator is mirror-symmetric across its own width, so a mirrored piece (`mirror`,
|
|
345
|
+
* `place … mirror`) needs no mirrored mesh and nothing gains handedness (`test/t0.test.ts` holds
|
|
346
|
+
* it) — except the few `handed` families whose shape cannot be (`T0_HANDED`: an L-sofa, a chaise,
|
|
347
|
+
* a grand piano, a reception desk; a bicycle and a motorcycle where they lie along their width,
|
|
348
|
+
* `handedAt`). The core draws those handed as well, and reflects the drawing of a mirrored
|
|
349
|
+
* piece; the model follows it: a handed piece the plan reflects carries `Furniture.mirror` and is
|
|
350
|
+
* built as the reflection (`t0Shells`), so the model never shows the other hand from the drawing.
|
|
351
|
+
*
|
|
352
|
+
* A wall-hung family hangs at a ledgered height instead of standing on the floor, by its underside
|
|
353
|
+
* (`T0_MOUNT_MM`: a wall cabinet, a hood, a mirror, a urinal) or by its top (`T0_HUNG_FROM_TOP`: a
|
|
354
|
+
* television, whose underside each piece's size sets and the ledger records per piece): the core
|
|
355
|
+
* marks such a piece only by drawing it dashed and exports no height, so the mount is this
|
|
356
|
+
* package's labelled default.
|
|
357
|
+
*
|
|
358
|
+
* A part is a prism over a SECTION: a box, the ellipse inscribed in it (`round`), a box with
|
|
359
|
+
* rounded corners (`radius`, quarter arcs from the exact 16-gon table) or an explicit polygon
|
|
360
|
+
* (`profile`), extruded up (the default) or sideways (`axis`: along the width, `x`, or the depth,
|
|
361
|
+
* `z`), optionally with holes (vertical parts). Each part names its material slot (`mat`,
|
|
362
|
+
* `materials.ts`); untagged is `body`.
|
|
363
|
+
*
|
|
364
|
+
* Local frame (plan §3.4, §4.4): origin at the footprint's centre on the floor finish; +x along
|
|
365
|
+
* the piece's width, +z its FRONT (an unturned piece faces plan +y, down the page), heights up.
|
|
366
|
+
* The plan's `rotate` turns it clockwise on the page; widths and depths are fitted (the footprint
|
|
367
|
+
* is never stretched in height: heights are fixed defaults, in the ledger). Lengths in mm here,
|
|
368
|
+
* micrometres once placed.
|
|
369
|
+
*/
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* The families with a generator, each with the catalogue names it answers to (plan §5.2): every
|
|
373
|
+
* word of the core's family row (`FIXTURE_FAMILIES`), so no alias of a built family falls back to
|
|
374
|
+
* a grey box (`test/t0.test.ts` reads the core's table). `double_bed` is built by the bed's
|
|
375
|
+
* generator and `dining_table` by the table's, as their catalogue rows are separate families.
|
|
376
|
+
*/
|
|
338
377
|
declare const T0_FAMILIES: Readonly<Record<string, readonly string[]>>;
|
|
339
378
|
/** The asset a category is built with: `t0:<family>`, or `greybox` (plan §4.4 step 1). */
|
|
340
379
|
declare const assetFor: (category: string) => string;
|
|
341
380
|
/** The tallest point of each family (mm): the height the ledger records. */
|
|
342
381
|
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;
|
|
348
|
-
}
|
|
349
382
|
/**
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
*
|
|
383
|
+
* The underside of each wall-hung family (mm above the floor finish; the ledger's
|
|
384
|
+
* `furniture-mount-default`): a wall cabinet's 1400 mm (card V6), a hood 700 mm over a 900 mm hob,
|
|
385
|
+
* a mirror over a basin, a urinal's rim height less its bowl. Nothing of the piece is drawn below
|
|
386
|
+
* it and the piece is never carried down to the floor.
|
|
387
|
+
*/
|
|
388
|
+
declare const T0_MOUNT_MM: Readonly<Record<string, number>>;
|
|
389
|
+
/**
|
|
390
|
+
* The families hung by their TOP at their `T0_HEIGHT_MM` (a television: its panel 16:9 from its
|
|
391
|
+
* width, at most 760 mm tall), so each piece's underside depends on its size: the mesh builder
|
|
392
|
+
* ledgers the piece's own (`furniture-mount-from-top`), never one figure for the family.
|
|
393
|
+
*/
|
|
394
|
+
declare const T0_HUNG_FROM_TOP: ReadonlySet<string>;
|
|
395
|
+
/** The handed families (`T0Family.handed`): built reflected when the plan reflects the piece. */
|
|
396
|
+
declare const T0_HANDED: ReadonlySet<string>;
|
|
397
|
+
/**
|
|
398
|
+
* Whether a piece of `family`, `W` × `D` mm in its own frame, is handed: always for an L-sofa or
|
|
399
|
+
* a reception desk, only along its width for a bicycle or a motorcycle (the core reads both off
|
|
400
|
+
* their long axis), never for a symmetric family.
|
|
401
|
+
*/
|
|
402
|
+
declare function handedAt(family: string, W: number, D: number): boolean;
|
|
403
|
+
/**
|
|
404
|
+
* The material slots each family's parts use (the ledger's `furniture-material-default`, ADR 0030
|
|
405
|
+
* decision 5): a property of the family, never read from a label. `test/t0.test.ts` holds every
|
|
406
|
+
* generator to its row.
|
|
407
|
+
*/
|
|
408
|
+
declare const T0_MATERIALS: Readonly<Record<string, readonly Exclude<MaterialSlot, "body">[]>>;
|
|
409
|
+
/**
|
|
410
|
+
* A section's ring in whole micrometres: the box `u0..u1` × `v0..v1` (mm) as a box, the ellipse
|
|
411
|
+
* inscribed in it, a box with rounded corners (four quarter arcs, five points each, from the
|
|
412
|
+
* 16-gon table) or an explicit polygon in fractions of the box (`profile` wins over `round` and
|
|
413
|
+
* `radius`). No repeated points. An empty or inverted box (`u0 ≥ u1` or `v0 ≥ v1`) has no ring:
|
|
414
|
+
* `[]`, which the extruder treats as degenerate (a hole it leaves out, an outer it refuses).
|
|
415
|
+
*/
|
|
416
|
+
declare function sectionRing(u0: number, u1: number, v0: number, v1: number, shape?: SectionShape): Pt[];
|
|
417
|
+
/**
|
|
418
|
+
* One part's closed, outward-wound shell in local micrometres (x width, y up from the floor
|
|
419
|
+
* finish, z front), carrying its slot unless `body`; `null` if its box is empty or inverted, or
|
|
420
|
+
* its section is degenerate.
|
|
421
|
+
*
|
|
422
|
+
* Holes never open a shell: a degenerate hole is left out, and holes that touch the outline or
|
|
423
|
+
* each other are all left out (the part is built whole); either way their count is added to
|
|
424
|
+
* `dropped.holes`, so the mesh builder ledgers them (`hole-degenerate`), never silently.
|
|
425
|
+
*
|
|
426
|
+
* The extruder builds every prism upright (plan ring, heights up). A sideways part is that prism
|
|
427
|
+
* with its axes relabelled: `x` maps (u, h, v) → (h, v, u), a cyclic permutation, so the winding
|
|
428
|
+
* stays outward; `z` maps (u, h, v) → (u, v, h), a swap, so each triangle is turned back over.
|
|
429
|
+
*/
|
|
430
|
+
declare function partShell(p: Part, dropped?: {
|
|
431
|
+
holes: number;
|
|
432
|
+
}): Shell | null;
|
|
433
|
+
/**
|
|
434
|
+
* A family's parts for a piece `W` × `D` mm (local frame), or `null` for a family without a
|
|
435
|
+
* generator. Every part is clipped to the footprint and to the family's ledgered height, so no ink
|
|
436
|
+
* leaves either on a small or thin piece, and a part the clip leaves thinner than `MIN_PART_MM`
|
|
437
|
+
* is left out. The clip is symmetric about x = 0, so a mirror-symmetric generator stays so.
|
|
438
|
+
*/
|
|
439
|
+
declare function t0LocalParts(family: string, W: number, D: number): Part[] | null;
|
|
440
|
+
/**
|
|
441
|
+
* `f`'s T0 shells, placed in plan micrometres with the floor finish at `floor` (µm), and how many
|
|
442
|
+
* holes they were built without (`partShell`; the mesh builder ledgers them): `null` when its
|
|
443
|
+
* asset is not T0 or its turn is not a quarter turn (the grey box stands instead); a `null` shell
|
|
444
|
+
* is a part whose section was degenerate (the mesh builder ledgers it too). The plan's `rotate`
|
|
445
|
+
* (clockwise on the page, y down) maps local (x, z) to plan (x cos r − z sin r, x sin r + z cos r)
|
|
446
|
+
* about the footprint's centre, a proper rotation, so every shell stays outward-wound; at a quarter
|
|
447
|
+
* turn the piece's own width runs along plan y (`Furniture.size` is the turned box).
|
|
448
|
+
*
|
|
449
|
+
* A reflected piece (`f.mirror`, set on a handed family only) is built as its reflection across
|
|
450
|
+
* its own width BEFORE the turn, exactly as the core draws it (`glyph-chirality.ts`: reflect the
|
|
451
|
+
* symbol about its own vertical centre line, then apply the quarter turn): local x → −x on every
|
|
452
|
+
* vertex, each triangle turned back over so the shell stays outward-wound. Exact in integers.
|
|
354
453
|
*/
|
|
355
|
-
declare function
|
|
454
|
+
declare function t0Shells(f: Furniture, floor: number): {
|
|
455
|
+
shells: Array<Shell | null>;
|
|
456
|
+
holesDropped: number;
|
|
457
|
+
} | null;
|
|
356
458
|
|
|
357
459
|
/**
|
|
358
460
|
* The replay's end camera as plain maths (card A3, look notes round 1): the viewer and the tests
|
|
@@ -472,4 +574,4 @@ declare function drawingFrame(viewBox: readonly [number, number, number, number]
|
|
|
472
574
|
oh: number;
|
|
473
575
|
};
|
|
474
576
|
|
|
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,
|
|
577
|
+
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, MaterialSlot, Mesh3D, type MeshOptions, type MixedHeightJoint, type Orbit, type OwnedWall, type Ownership, type Part, type Piece, Polygon, Pt, type Refusal, type RefusalCode, ReplayEvent, ReplayState, type Ring, Ring3, START_FOV, 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 Vec3, type Warning3D, adaptPlan, assetFor, boxOfNodes, buildMesh, buildScene3D, cameraAtStop, cameraStops, clipToConvex, corners, coverage, cutSector, drawingFrame, endElevation, fitEndCamera, floorLifts, floorOverlaps, frameCamera, handedAt, insideCut, mixedHeightJoints, openLeaf, overlapArea, partShell, piecesOf, piecesTouch, prism, projectBox, rectsOf, sectionRing, sectorBand, slab2d, slabRegion, t0LocalParts, t0Shells, um, umPoint, validateScene3D, wallOwnership };
|
package/dist/index.js
CHANGED
|
@@ -4,46 +4,61 @@ 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-
|
|
10
|
+
} from "./chunk-4AF5Q7M3.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
|
-
|
|
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-
|
|
45
|
+
} from "./chunk-VUSBWX7N.js";
|
|
38
46
|
import {
|
|
39
47
|
END_AZIMUTH,
|
|
40
48
|
END_FOV,
|
|
41
49
|
EXPLODE_GAP_MM,
|
|
42
50
|
FILL,
|
|
51
|
+
FINISH_PALETTE,
|
|
43
52
|
FIXTURE_FAMILIES,
|
|
53
|
+
FLOOR_FINISHES,
|
|
54
|
+
FLOOR_FINISH_RULES,
|
|
55
|
+
KIND_PALETTE,
|
|
56
|
+
MATERIAL_SLOTS,
|
|
57
|
+
PALETTE,
|
|
44
58
|
PHASE,
|
|
45
59
|
START_FOV,
|
|
46
60
|
STOP_LEAD,
|
|
61
|
+
WALL_CAP_SRGB,
|
|
47
62
|
authoringOrder,
|
|
48
63
|
boxOfNodes,
|
|
49
64
|
cameraAtStop,
|
|
@@ -54,17 +69,22 @@ import {
|
|
|
54
69
|
ease,
|
|
55
70
|
endElevation,
|
|
56
71
|
explodeLifts,
|
|
72
|
+
finishColour,
|
|
57
73
|
fitEndCamera,
|
|
74
|
+
floorFinish,
|
|
58
75
|
frameCamera,
|
|
59
76
|
keyFrames,
|
|
77
|
+
linearRgb,
|
|
60
78
|
projectBox,
|
|
79
|
+
slotColour,
|
|
80
|
+
slotGroups,
|
|
61
81
|
stateAt,
|
|
62
82
|
storeysOf,
|
|
63
83
|
stripAt,
|
|
64
84
|
timeline,
|
|
65
85
|
viewLabel,
|
|
66
86
|
viewMesh
|
|
67
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-EYEEIS4R.js";
|
|
68
88
|
export {
|
|
69
89
|
ARCHLANG_3D_VERSION,
|
|
70
90
|
DOOR_POSES,
|
|
@@ -72,16 +92,27 @@ export {
|
|
|
72
92
|
END_FOV,
|
|
73
93
|
EXPLODE_GAP_MM,
|
|
74
94
|
FILL,
|
|
95
|
+
FINISH_PALETTE,
|
|
75
96
|
FIXTURE_FAMILIES,
|
|
97
|
+
FLOOR_FINISHES,
|
|
98
|
+
FLOOR_FINISH_RULES,
|
|
76
99
|
FLOOR_LIFT_UM,
|
|
77
100
|
FLOOR_OVERLAP_MIN_UM2,
|
|
78
101
|
FURNITURE_HEIGHT_MM,
|
|
102
|
+
KIND_PALETTE,
|
|
103
|
+
MATERIAL_SLOTS,
|
|
79
104
|
MIN_CORE,
|
|
105
|
+
PALETTE,
|
|
80
106
|
PHASE,
|
|
81
107
|
START_FOV,
|
|
82
108
|
STOP_LEAD,
|
|
83
109
|
T0_FAMILIES,
|
|
110
|
+
T0_HANDED,
|
|
84
111
|
T0_HEIGHT_MM,
|
|
112
|
+
T0_HUNG_FROM_TOP,
|
|
113
|
+
T0_MATERIALS,
|
|
114
|
+
T0_MOUNT_MM,
|
|
115
|
+
WALL_CAP_SRGB,
|
|
85
116
|
adaptPlan,
|
|
86
117
|
assetFor,
|
|
87
118
|
authoringOrder,
|
|
@@ -98,28 +129,37 @@ export {
|
|
|
98
129
|
ease,
|
|
99
130
|
endElevation,
|
|
100
131
|
explodeLifts,
|
|
132
|
+
finishColour,
|
|
101
133
|
fitEndCamera,
|
|
134
|
+
floorFinish,
|
|
102
135
|
floorLifts,
|
|
103
136
|
floorOverlaps,
|
|
104
137
|
frameCamera,
|
|
138
|
+
handedAt,
|
|
105
139
|
insideCut,
|
|
106
140
|
keyFrames,
|
|
141
|
+
linearRgb,
|
|
107
142
|
mixedHeightJoints,
|
|
108
143
|
openLeaf,
|
|
109
144
|
overlapArea,
|
|
145
|
+
partShell,
|
|
110
146
|
piecesOf,
|
|
111
147
|
piecesTouch,
|
|
112
148
|
prism,
|
|
113
149
|
projectBox,
|
|
114
150
|
rectsOf,
|
|
115
151
|
replayFacts,
|
|
152
|
+
sectionRing,
|
|
116
153
|
sectorBand,
|
|
117
154
|
slab2d,
|
|
118
155
|
slabRegion,
|
|
156
|
+
slotColour,
|
|
157
|
+
slotGroups,
|
|
119
158
|
stateAt,
|
|
120
159
|
storeysOf,
|
|
121
160
|
stripAt,
|
|
122
|
-
|
|
161
|
+
t0LocalParts,
|
|
162
|
+
t0Shells,
|
|
123
163
|
timeline,
|
|
124
164
|
um,
|
|
125
165
|
umPoint,
|
package/dist/node.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { World } from '@chanmeng666/archlang';
|
|
2
|
-
import { M as Mesh3D,
|
|
3
|
-
export { R as ReplayFacts, S as StripItem, s as stripAt } from './strip-
|
|
2
|
+
import { M as Mesh3D, g as ReplayEvent, q as MeshNode, a as Scene3D, c as Shell } from './strip-CdTeMoHA.js';
|
|
3
|
+
export { R as ReplayFacts, S as StripItem, s as stripAt } from './strip-CdTeMoHA.js';
|
|
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-
|
|
6
|
+
export { F as FactsOptions, r as replayFacts } from './facts-DHuCDilh.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-
|
|
23
|
+
} from "./chunk-KUK6ARJC.js";
|
|
23
24
|
import {
|
|
24
25
|
replayFacts
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-VUSBWX7N.js";
|
|
26
27
|
import {
|
|
27
28
|
PREVIEW_LABEL,
|
|
28
29
|
replayPayload,
|
|
29
30
|
viewBoxOf
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-2ZINQMUB.js";
|
|
31
32
|
import {
|
|
32
33
|
stripAt
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-EYEEIS4R.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,
|
package/dist/replay.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ReplayFacts,
|
|
1
|
+
import { e as MaterialSlot, n as FloorFinish, R as ReplayFacts, g as ReplayEvent, M as Mesh3D } from './strip-CdTeMoHA.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The replay's data (card A3), browser-safe: `replayPayload(mesh, opts)` is what a replay carries
|
|
@@ -15,6 +15,17 @@ interface ReplayNode {
|
|
|
15
15
|
/** Flat `[x, y, z, …]` in micrometres, exporters' axes (X plan x, Y up, Z plan y). */
|
|
16
16
|
positions: number[];
|
|
17
17
|
indices: number[];
|
|
18
|
+
/**
|
|
19
|
+
* A T0 piece's material slots (visual-assets V1): consecutive runs of `indices`, in order, each
|
|
20
|
+
* drawn in its slot's colour (`materials.ts`; `body` is the kind's own). Absent on every node
|
|
21
|
+
* without a slotted shell, which is then drawn exactly as before.
|
|
22
|
+
*/
|
|
23
|
+
groups?: Array<{
|
|
24
|
+
slot: MaterialSlot;
|
|
25
|
+
count: number;
|
|
26
|
+
}>;
|
|
27
|
+
/** A floor's finish (visual-assets V9, `extras.finish`), drawn in its colour; absent on every other node. */
|
|
28
|
+
finish?: FloorFinish;
|
|
18
29
|
}
|
|
19
30
|
interface ReplayPayload {
|
|
20
31
|
title: string;
|
package/dist/scene3d.schema.json
CHANGED
|
@@ -447,6 +447,10 @@
|
|
|
447
447
|
"asset": {
|
|
448
448
|
"type": "string",
|
|
449
449
|
"description": "What the mesh builds it with: t0:<family> (a parametric generator) or greybox."
|
|
450
|
+
},
|
|
451
|
+
"mirror": {
|
|
452
|
+
"const": true,
|
|
453
|
+
"description": "Reflected across its own width (the core's Plan JSON mirror); recorded only on a handed asset."
|
|
450
454
|
}
|
|
451
455
|
}
|
|
452
456
|
},
|