@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.
- package/CHANGELOG.md +35 -0
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +13 -5
- package/dist/{camera-DcyxtBjK.d.ts → camera-CGIIudHj.d.ts} +1 -1
- package/dist/{chunk-CX6IVI7I.js → chunk-FHBR2U5Z.js} +1 -1
- package/dist/{chunk-LMFD5NP4.js → chunk-FVD3DZU2.js} +6 -4
- package/dist/{chunk-6WCS4TAT.js → chunk-GXWLZ2KC.js} +61 -9
- package/dist/chunk-QN4LQTVG.js +2192 -0
- package/dist/{chunk-TNNJ7CAO.js → chunk-TI4RYEOL.js} +28 -4
- package/dist/cli.js +5 -5
- package/dist/{facts-Dje5wcHh.d.ts → facts-3wb9egIT.d.ts} +1 -1
- package/dist/index.d.ts +242 -7
- package/dist/index.js +20 -4
- package/dist/node.d.ts +3 -3
- package/dist/node.js +4 -4
- package/dist/replay.d.ts +1 -1
- package/dist/{strip-CA-IAT0N.d.ts → strip-Sdsm54Qw.d.ts} +45 -1
- package/dist/viewer.iife.js +173 -173
- package/package.json +1 -1
- package/dist/chunk-VXGQYUMN.js +0 -1198
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.7.0] - 2026-11-12
|
|
6
|
+
|
|
7
|
+
The core peer range stays `^1.57.0`: nothing below needs an export newer than core 1.57.0.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Doorways, windows and stairs are built in their parts (product-roadmap card RM8.6). Every door
|
|
12
|
+
and cased opening gets a lining on its jambs and head (0.1 of the wall's thickness, 12–25 mm; a
|
|
13
|
+
door's in two halves round a 40 mm slot for its leaf, which keeps its length and place) and a
|
|
14
|
+
casing on each wall face (0.35 t wide, 50–90 mm, 0.1 t proud, 10–20 mm), as parts `lining` and
|
|
15
|
+
`casing` of its node. A barn door has no casing on the face its panel hangs on, a garage door
|
|
16
|
+
none, a door on a curved wall no trim; a casing leg that would stand in another wall, a column,
|
|
17
|
+
standing furniture (a rug is passed through), another doorway or a neighbour's trim is left out,
|
|
18
|
+
never shortened, and a sill or board end that would meet a neighbour's stops at its jamb (every
|
|
19
|
+
omission ledgered). A storey's trim is decided all at once, never in the order the plan writes its
|
|
20
|
+
openings: every casing before any sill or board (a casing beats a horn), and two casing legs, or two
|
|
21
|
+
windows' horns or spans, that meet are both left out or cut back, so swapping two openings' lines changes nothing and
|
|
22
|
+
a mirror-symmetric plan gets mirror-symmetric trim. Every window gets a reveal
|
|
23
|
+
lining on its inside half (`reveal`, in the frame's colour), an exterior sill proud of the outside
|
|
24
|
+
face and past each jamb by 0.2 t, as the core draws it (`sill`, pale stone), and an interior board
|
|
25
|
+
(`board`, oak); the outside is the core's own rule (`insideOf`, one wall thickness off each face).
|
|
26
|
+
A stair is tread boards with open risers and solid landings (its own node), two stringers a flight
|
|
27
|
+
(`stringer`) and a balustrade on each edge the probe finds open (`rail`, walnut: a sloping
|
|
28
|
+
handrail 900 mm over the nosing line, a baluster a tread, a newel at each end; a level rail
|
|
29
|
+
1000 mm over the stretches of a landing edge that no flight arrives on and no wall closes). Every size is a clamped share of the wall's thickness or the
|
|
30
|
+
stair's own riser, going and width (`OPENING_DETAIL`, `STAIR_DETAIL`) and ledgered per opening
|
|
31
|
+
and per stair; `stair-solid-default` is gone. New exports: `storeyTrim`, `insideOf`,
|
|
32
|
+
`OPENING_DETAIL`, `stairDetail`, `STAIR_DETAIL`, `STAIR_RAIL_MATERIAL`.
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- A tree's, a plant's and a shrub's crown and a bean bag are one lofted shell through the dome's
|
|
37
|
+
rings (`Part.loft`) instead of stacked round tiers, so they read smooth (backlog VA.1). The
|
|
38
|
+
conifer keeps its tiers.
|
|
39
|
+
|
|
5
40
|
## [0.6.0] - 2026-11-12
|
|
6
41
|
|
|
7
42
|
The core peer range stays `^1.57.0`. The wall-joint fix below is the core's, so it takes core 1.59.0;
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as PresetName, V as Vec3 } from './camera-
|
|
1
|
+
import { P as PresetName, V as Vec3 } from './camera-CGIIudHj.js';
|
|
2
2
|
import { ReplayPayload } from './replay.js';
|
|
3
3
|
export { PREVIEW_ABOUT_URL, PREVIEW_LABEL, PREVIEW_LEAD, PREVIEW_LIMITS, ReplayNode, ReplayOptions, replayPayload, viewBoxOf } from './replay.js';
|
|
4
|
-
import { S as StripItem } from './strip-
|
|
5
|
-
export { R as ReplayFacts, s as stripAt } from './strip-
|
|
4
|
+
import { S as StripItem } from './strip-Sdsm54Qw.js';
|
|
5
|
+
export { R as ReplayFacts, s as stripAt } from './strip-Sdsm54Qw.js';
|
|
6
6
|
import '@chanmeng666/archlang';
|
|
7
7
|
|
|
8
8
|
interface ReplayHandle {
|
package/dist/browser.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
replayPayload,
|
|
10
10
|
viewBoxOf,
|
|
11
11
|
viewToolbar
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FHBR2U5Z.js";
|
|
13
13
|
import {
|
|
14
14
|
ELEVATION_RANGE,
|
|
15
15
|
END_AZIMUTH,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
stripAt,
|
|
37
37
|
takenLens,
|
|
38
38
|
targetBounds
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-TI4RYEOL.js";
|
|
40
40
|
|
|
41
41
|
// src/replay/mount.ts
|
|
42
42
|
import {
|
|
@@ -570,6 +570,14 @@ var THEMES = {
|
|
|
570
570
|
door: "#7aa6c9",
|
|
571
571
|
"window:frame": "#5d86a8",
|
|
572
572
|
"window:glass": "#86c5ee",
|
|
573
|
+
// The trim and the balustrade (card RM8.6): a reveal as its frame, a sill and a board as a
|
|
574
|
+
// door, a cased opening's trim as a door, a handrail as a window frame.
|
|
575
|
+
"window:reveal": "#5d86a8",
|
|
576
|
+
"window:sill": "#7aa6c9",
|
|
577
|
+
"window:board": "#7aa6c9",
|
|
578
|
+
"opening:lining": "#7aa6c9",
|
|
579
|
+
"opening:casing": "#7aa6c9",
|
|
580
|
+
"stair:rail": "#3b5b78",
|
|
573
581
|
"wall:demolish": "#e07a5f",
|
|
574
582
|
furniture: "#3f6a8f",
|
|
575
583
|
stair: "#5d86a8"
|
|
@@ -684,7 +692,7 @@ function mountReplay(out, p, strip, opts = {}) {
|
|
|
684
692
|
for (const { slot, count } of n.groups) {
|
|
685
693
|
const run = n.indices.slice(at, at + count);
|
|
686
694
|
at += count;
|
|
687
|
-
if (slot === "body") add(attr, run, theme.colors[key2] ?? furniture, false, 1, false);
|
|
695
|
+
if (slot === "body") add(attr, run, theme.colors[key2] ?? theme.colors[n.kind] ?? furniture, false, 1, false);
|
|
688
696
|
else {
|
|
689
697
|
const { alpha } = PALETTE[slot];
|
|
690
698
|
add(attr, run, slotColour(slot, p.theme, furniture), alpha < 1, alpha, false);
|
|
@@ -717,7 +725,7 @@ function mountReplay(out, p, strip, opts = {}) {
|
|
|
717
725
|
add(
|
|
718
726
|
attr,
|
|
719
727
|
n.indices,
|
|
720
|
-
theme.colors[key2] ?? furniture,
|
|
728
|
+
theme.colors[key2] ?? theme.colors[n.kind] ?? furniture,
|
|
721
729
|
glass,
|
|
722
730
|
glass ? KIND_PALETTE["window:glass"].alpha : 1,
|
|
723
731
|
true,
|
|
@@ -725,7 +733,7 @@ function mountReplay(out, p, strip, opts = {}) {
|
|
|
725
733
|
);
|
|
726
734
|
}
|
|
727
735
|
if (fix && fix.group >= 0) {
|
|
728
|
-
const colour = theme.colors[key2] ?? furniture;
|
|
736
|
+
const colour = theme.colors[key2] ?? theme.colors[n.kind] ?? furniture;
|
|
729
737
|
patched.push({
|
|
730
738
|
key: n.key,
|
|
731
739
|
...parts.alone.length > 0 ? { alone: add(attr, parts.alone, colour, false, 1, true, false) } : {},
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ARCHLANG_3D_VERSION,
|
|
3
3
|
validateScene3D
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GXWLZ2KC.js";
|
|
5
5
|
import {
|
|
6
6
|
PREVIEW_LABEL,
|
|
7
7
|
PREVIEW_LIMITS,
|
|
8
8
|
VIEW_CONTROLS_LABEL,
|
|
9
9
|
replayPayload
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FHBR2U5Z.js";
|
|
11
11
|
import {
|
|
12
12
|
FENCE_PALETTE,
|
|
13
13
|
FINISH_PALETTE,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
keyFrames,
|
|
21
21
|
linearRgb,
|
|
22
22
|
slotGroups
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-TI4RYEOL.js";
|
|
24
24
|
|
|
25
25
|
// src/world.ts
|
|
26
26
|
import { readFileSync, realpathSync, statSync } from "node:fs";
|
|
@@ -354,7 +354,9 @@ var GLB_GENERATOR = `archlang-3d ${ARCHLANG_3D_VERSION}`;
|
|
|
354
354
|
function bodyMaterialName(n) {
|
|
355
355
|
if (n.kind === "floor") return `floor:${FLOOR_FINISHES.find((f) => f === n.extras.finish) ?? "neutral"}`;
|
|
356
356
|
if (n.kind === "wall" && n.part === "demolish") return "wall:demolish";
|
|
357
|
-
if (n.kind === "window" &&
|
|
357
|
+
if (n.kind === "window" && n.part && `window:${n.part}` in KIND_PALETTE) return `window:${n.part}`;
|
|
358
|
+
if ((n.kind === "opening" || n.kind === "stair") && n.part && `${n.kind}:${n.part}` in KIND_PALETTE)
|
|
359
|
+
return `${n.kind}:${n.part}`;
|
|
358
360
|
if (n.kind === "outdoor") return `outdoor:${String(n.extras.surface)}`;
|
|
359
361
|
if (n.kind === "fence") return `fence:${String(n.extras.style)}`;
|
|
360
362
|
return n.kind;
|
|
@@ -371,13 +371,7 @@ var HEMI = [
|
|
|
371
371
|
[1, 0.132]
|
|
372
372
|
];
|
|
373
373
|
function dome(mat, cx, cz, rx, rz, y0, y1, table) {
|
|
374
|
-
|
|
375
|
-
return table.map(([t, f], k) => {
|
|
376
|
-
const hi = k === table.length - 1 ? y1 : y0 + (y1 - y0) * t;
|
|
377
|
-
const p = P(mat, cx - rx * f, cx + rx * f, cz - rz * f, cz + rz * f, lo, hi, { round: true });
|
|
378
|
-
lo = hi;
|
|
379
|
-
return p;
|
|
380
|
-
});
|
|
374
|
+
return [P(mat, cx - rx, cx + rx, cz - rz, cz + rz, y0, y1, { round: true, loft: table })];
|
|
381
375
|
}
|
|
382
376
|
function cabinet(W, D, opts = {}) {
|
|
383
377
|
const [hw, hd] = [W / 2, D / 2];
|
|
@@ -3260,9 +3254,12 @@ function sectionRing(u0, u1, v0, v1, shape = {}) {
|
|
|
3260
3254
|
}
|
|
3261
3255
|
function partShell(p, dropped) {
|
|
3262
3256
|
if (p.axis && p.holes?.length) throw new Error("a sideways T0 part takes no holes");
|
|
3257
|
+
if (p.loft && (p.axis || p.holes?.length || p.profile)) throw new Error("a lofted T0 part is vertical and plain");
|
|
3263
3258
|
if (!(um(p.x0) < um(p.x1) && um(p.y0) < um(p.y1) && um(p.z0) < um(p.z1))) return null;
|
|
3264
3259
|
let s;
|
|
3265
|
-
if (
|
|
3260
|
+
if (p.loft) {
|
|
3261
|
+
s = loftShell(p, p.loft);
|
|
3262
|
+
} else if (!p.axis) {
|
|
3266
3263
|
const outer = sectionRing(p.x0, p.x1, p.z0, p.z1, p);
|
|
3267
3264
|
const holes = (p.holes ?? []).map((h) => sectionRing(h.x0, h.x1, h.z0, h.z1, h));
|
|
3268
3265
|
const poly = { outer, ...holes.length ? { holes } : {} };
|
|
@@ -3298,6 +3295,61 @@ function partShell(p, dropped) {
|
|
|
3298
3295
|
if (s && p.mat && p.mat !== "body") s.slot = p.mat;
|
|
3299
3296
|
return s;
|
|
3300
3297
|
}
|
|
3298
|
+
function loftShell(p, table) {
|
|
3299
|
+
if (table.length === 0) return null;
|
|
3300
|
+
const [cx, cz, rx, rz] = [(p.x0 + p.x1) / 2, (p.z0 + p.z1) / 2, (p.x1 - p.x0) / 2, (p.z1 - p.z0) / 2];
|
|
3301
|
+
const shape = { ...p.round ? { round: true } : {}, ...p.radius ? { radius: p.radius } : {} };
|
|
3302
|
+
const levels = [
|
|
3303
|
+
[um(p.y0), table[0][1]],
|
|
3304
|
+
...table.map(([t, f], k) => [
|
|
3305
|
+
k === table.length - 1 ? um(p.y1) : um(p.y0 + (p.y1 - p.y0) * t),
|
|
3306
|
+
f
|
|
3307
|
+
])
|
|
3308
|
+
];
|
|
3309
|
+
const rings = levels.map(([, f]) => sectionRing(cx - rx * f, cx + rx * f, cz - rz * f, cz + rz * f, shape));
|
|
3310
|
+
const n = rings[0]?.length ?? 0;
|
|
3311
|
+
if (n < 3 || rings.some((r) => r.length !== n)) return null;
|
|
3312
|
+
for (let k = 1; k < levels.length; k++)
|
|
3313
|
+
if (!(levels[k][0] > levels[k - 1][0])) return null;
|
|
3314
|
+
const positions = [];
|
|
3315
|
+
rings.forEach((r, k) => {
|
|
3316
|
+
for (const [x, z] of r) positions.push(x, levels[k][0], z);
|
|
3317
|
+
});
|
|
3318
|
+
const [ax, az] = [um(cx), um(cz)];
|
|
3319
|
+
const indices = [];
|
|
3320
|
+
const at = (i) => [
|
|
3321
|
+
positions[3 * i],
|
|
3322
|
+
positions[3 * i + 1],
|
|
3323
|
+
positions[3 * i + 2]
|
|
3324
|
+
];
|
|
3325
|
+
const face = (a, b, c, want) => {
|
|
3326
|
+
const [A, B, C] = [at(a), at(b), at(c)];
|
|
3327
|
+
const u = [B[0] - A[0], B[1] - A[1], B[2] - A[2]];
|
|
3328
|
+
const w = [C[0] - A[0], C[1] - A[1], C[2] - A[2]];
|
|
3329
|
+
const nx = u[1] * w[2] - u[2] * w[1];
|
|
3330
|
+
const ny = u[2] * w[0] - u[0] * w[2];
|
|
3331
|
+
const nz = u[0] * w[1] - u[1] * w[0];
|
|
3332
|
+
if (nx * want[0] + ny * want[1] + nz * want[2] >= 0) indices.push(a, b, c);
|
|
3333
|
+
else indices.push(a, c, b);
|
|
3334
|
+
};
|
|
3335
|
+
const last = rings.length - 1;
|
|
3336
|
+
for (let i = 1; i < n - 1; i++) {
|
|
3337
|
+
face(0, i, i + 1, [0, -1, 0]);
|
|
3338
|
+
face(last * n, last * n + i, last * n + i + 1, [0, 1, 0]);
|
|
3339
|
+
}
|
|
3340
|
+
for (let k = 0; k < last; k++) {
|
|
3341
|
+
for (let i = 0; i < n; i++) {
|
|
3342
|
+
const j = (i + 1) % n;
|
|
3343
|
+
const [a, b, c, d] = [k * n + i, k * n + j, (k + 1) * n + j, (k + 1) * n + i];
|
|
3344
|
+
const m = [a, b, c, d].map(at);
|
|
3345
|
+
const mx = m.reduce((s, q) => s + q[0], 0) / 4 - ax;
|
|
3346
|
+
const mz = m.reduce((s, q) => s + q[2], 0) / 4 - az;
|
|
3347
|
+
face(a, b, c, [mx, 0, mz]);
|
|
3348
|
+
face(a, c, d, [mx, 0, mz]);
|
|
3349
|
+
}
|
|
3350
|
+
}
|
|
3351
|
+
return { positions, indices };
|
|
3352
|
+
}
|
|
3301
3353
|
var MIN_PART_MM = 1;
|
|
3302
3354
|
function t0LocalParts(family, W, D) {
|
|
3303
3355
|
const gen = GENERATORS[family];
|
|
@@ -3571,7 +3623,7 @@ function floorLifts(floors, overlaps) {
|
|
|
3571
3623
|
}
|
|
3572
3624
|
|
|
3573
3625
|
// package.json
|
|
3574
|
-
var version = "0.
|
|
3626
|
+
var version = "0.7.0";
|
|
3575
3627
|
|
|
3576
3628
|
// src/scene3d/build.ts
|
|
3577
3629
|
import * as core2 from "@chanmeng666/archlang";
|