@chanmeng666/archlang-3d 0.4.0 → 0.6.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 +105 -0
- package/README.md +5 -4
- package/THIRD_PARTY_NOTICES +2 -2
- package/dist/browser.d.ts +34 -4
- package/dist/browser.js +658 -21
- package/dist/{camera-DVOiag0F.d.ts → camera-DcyxtBjK.d.ts} +1 -1
- package/dist/{chunk-EG7UT2HG.js → chunk-6WCS4TAT.js} +1 -1
- package/dist/{chunk-KF5ME6KH.js → chunk-CX6IVI7I.js} +76 -9
- package/dist/{chunk-RPGAMA3G.js → chunk-LMFD5NP4.js} +124 -32
- package/dist/{chunk-EQBMPXB5.js → chunk-TNNJ7CAO.js} +52 -1
- package/dist/{chunk-VS4OAVPD.js → chunk-VXGQYUMN.js} +293 -45
- package/dist/cli.js +5 -5
- package/dist/{facts-BRIFxHL_.d.ts → facts-Dje5wcHh.d.ts} +1 -1
- package/dist/index.d.ts +71 -5
- package/dist/index.js +45 -3
- package/dist/node.d.ts +16 -6
- package/dist/node.js +4 -4
- package/dist/replay.d.ts +30 -3
- package/dist/{strip-Nt7eJ-4E.d.ts → strip-CA-IAT0N.d.ts} +74 -4
- package/dist/viewer.iife.js +504 -499
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,111 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.6.0] - 2026-11-12
|
|
6
|
+
|
|
7
|
+
The core peer range stays `^1.57.0`. The wall-joint fix below is the core's, so it takes core 1.59.0;
|
|
8
|
+
with an older core in the range those walls build as before.
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `renderReplay({ supersample: k })` (from `@chanmeng666/archlang-3d/node`; `VideoOptions.supersample`)
|
|
13
|
+
draws each frame as the rounded mean of k × k renders shifted by fractions of a pixel, a whole
|
|
14
|
+
number from 1 to 4, so edges are anti-aliased; 1, the default, draws as before. The replay page
|
|
15
|
+
reads it from `ReplayPayload.supersample`, which `replayPayload` never sets: it is for offline
|
|
16
|
+
generation, and a live page that sets it draws every frame k × k times. The posters and replay
|
|
17
|
+
videos on archlang.uk are generated with 3 × 3 and 2 × 2.
|
|
18
|
+
- Outdoor surfaces and fences are built. Each of the nine `outdoor` kinds is a 50 mm slab whose top
|
|
19
|
+
is its storey's floor level (Mesh3D kind `outdoor`, node `outdoor:<id>`, stage `brief`), in a
|
|
20
|
+
colour from the core's theme: the tint the drawing fills it with (`lawn`, `paving` or `water`,
|
|
21
|
+
`GROUND_TINT`) laid on six times over the theme's paper (`GROUND_WASH`), so lawn is #99b76f,
|
|
22
|
+
paving #ab9f87 and water #699fc3. Four kinds the drawing tells apart only by hatch get colours of
|
|
23
|
+
their own (`GROUND_SPLITS`, `SITE_PALETTE`): planting, deck, gravel and driveway. A surface never
|
|
24
|
+
lies in the plane of a face it overlaps: over the slab it stands a step (0.5 mm) above the slab's
|
|
25
|
+
top, over an earlier surface a step above that one, and a step more where it would meet a floor's
|
|
26
|
+
bottom or top. Each `fence` (kind `fence`, stage `walls`, rising with the walls) has a post on
|
|
27
|
+
every tick the core draws (round(run / pitch) divisions, 1 to 60, `fencePosts`) and its style's
|
|
28
|
+
rails: a picket fence two rails and pickets, 1000 mm; a panel fence one board, 1800 mm; a
|
|
29
|
+
post-and-rail fence a top rail, 1100 mm (`FENCE_PROFILES`, `FENCE_HEIGHT_MM`, `FENCE_PALETTE`).
|
|
30
|
+
A fence whose points are all one point builds nothing. The colour rides on the node
|
|
31
|
+
(`extras.colour`), and the GLB writes it as `outdoor:<kind>` and `fence:<style>`. Every default
|
|
32
|
+
is in the ledger (`outdoor-thickness-default`, `outdoor-colour-wash`, `outdoor-colour-theme`,
|
|
33
|
+
`outdoor-colour-3d`, `outdoor-overlap-lift`, `outdoor-rail-omitted`, `fence-height-default`,
|
|
34
|
+
`fence-profile-default`, `fence-colour-default`, `fence-no-run`), in place of the two
|
|
35
|
+
`m1-omits-outdoor-fences` rows. A balcony's railing is not built.
|
|
36
|
+
- The replay stands the building on a ground plane: a backdrop the viewer draws, not part of the
|
|
37
|
+
building and not in the file (no Mesh3D node, not in the GLB). Its top is the lowest storey's
|
|
38
|
+
floor level, so a garden lies flush in it, and it reaches 6 m past everything drawn
|
|
39
|
+
(`GROUND_PLANE`, `ReplayPayload.ground`); it fades in as the core's drawing fades out
|
|
40
|
+
(`ReplayState.ground`, 0 to 1). A view of an upper storey on its own draws no ground. Every
|
|
41
|
+
Mesh3D says so in one ledger row, `ground-plane-viewer-only` (the storey, the margin, the light
|
|
42
|
+
and dark colours). A plan without outdoor surfaces or fences builds the same nodes and the same GLB
|
|
43
|
+
as before.
|
|
44
|
+
- `PREVIEW_LIMITS` names outdoor surfaces and fences, the ground backdrop and the balcony railings
|
|
45
|
+
that are not built.
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- three.js 0.187.0 (was 0.186.1), pinned exactly and inlined into the replay HTML with its MIT
|
|
50
|
+
notice, as before.
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- `mountReplay` no longer draws a line on a flat wall surface where two wall pieces meet: beside a
|
|
55
|
+
door or a window only the reveal between sill and head is outlined; the flat back of a T
|
|
56
|
+
junction, the outer face of an L corner made of two walls and the joint of two walls in line
|
|
57
|
+
carry no line, and no line cuts across a wall top there. The inside corners of a T or an X
|
|
58
|
+
junction keep their lines. The walls' and columns' outlines are worked out across each storey
|
|
59
|
+
(`src/replay/wall-lines.ts`) in place of three.js's `EdgesGeometry` per node, which every other
|
|
60
|
+
node keeps. The faces two pieces share are not drawn either (they showed through a flat wall at
|
|
61
|
+
a grazing angle): inside one wall always, and between two nodes once the walls and columns connected
|
|
62
|
+
to it on the same storey are all up, so while the replay raises the walls each is drawn whole and no
|
|
63
|
+
frame shows a gap. Known limit: during the rise, a face two walls share can still show a faint
|
|
64
|
+
seam at a grazing angle; the finished storey has none. The
|
|
65
|
+
playground's 3D tab, the replay HTML and the generated posters and videos all draw this way;
|
|
66
|
+
Mesh3D, the GLB and Scene3D are unchanged.
|
|
67
|
+
- With core 1.59.0, walls that come within 0.015 mm of meeting no longer build a triangular piece
|
|
68
|
+
next to the joint, or keep a slanted edge a few µm long: the core's wall joinery now closes those
|
|
69
|
+
outlines (core `CHANGELOG.md`, 1.59.0, Fixed). No shipped plan hits it: every Mesh3D and GLB over
|
|
70
|
+
the corpus is byte-identical.
|
|
71
|
+
|
|
72
|
+
## [0.5.0] - 2026-11-11
|
|
73
|
+
|
|
74
|
+
The core peer range stays `^1.57.0`. The rooted `import` below works with any core in it; with
|
|
75
|
+
1.58.0 or later a refused module reports the core's own refusal code.
|
|
76
|
+
|
|
77
|
+
### Breaking
|
|
78
|
+
|
|
79
|
+
- `archlang3d build`, `check` and `view` can now refuse a plan they built under 0.4.0: an `import`
|
|
80
|
+
outside both the working directory and the plan's own directory, one that is not a `.arch` file,
|
|
81
|
+
or one over 1 MiB is refused (exit 2, the refusal under `E3D_PLAN_ERRORS`; Fixed, below). The
|
|
82
|
+
CLI has no flag to widen the root: run it from a directory that contains the module. A program
|
|
83
|
+
can pass a wider root as the second argument of `makeNodeWorld(baseDir, root)` from
|
|
84
|
+
`@chanmeng666/archlang-3d/node`. Nothing widens the `.arch` or 1 MiB rule.
|
|
85
|
+
|
|
86
|
+
### Added
|
|
87
|
+
|
|
88
|
+
- For a host page whose canvas follows its container (the playground's 3D stage):
|
|
89
|
+
`handle.resize(width, height)` gives the canvas a new drawing size and redraws the last frame at
|
|
90
|
+
it, the same frame a fresh mount at that size draws; `view.spin(degrees)` turns the view about
|
|
91
|
+
its pivot by one step the host chooses (a turntable), taking the view as a drag does; and
|
|
92
|
+
`viewToolbar(view, { compact: true })` puts Reset first and the six presets in a `View ▾`
|
|
93
|
+
popover, every button keeping its name, `data-*` and `aria-pressed`. All three are opt-in: a
|
|
94
|
+
host that never calls them, and the single-file replay HTML, draw and show exactly what they did.
|
|
95
|
+
- `viewToolbar(view, { storeys: false })` leaves out the "Storeys shown" buttons, for a host with
|
|
96
|
+
its own storey control (the playground). On by default: the replay HTML's toolbar is unchanged.
|
|
97
|
+
|
|
98
|
+
### Changed
|
|
99
|
+
|
|
100
|
+
- The line every surface carries (`PREVIEW_LABEL`) now says what "checked against the plan" means:
|
|
101
|
+
every 3D element comes from the plan's elements, and every solid is closed. The package
|
|
102
|
+
description says the same; the npm page shows the new README at the next publish.
|
|
103
|
+
- A `winders` landing (core 1.58.0) is built as a level landing for now: its tapered steps are not
|
|
104
|
+
built yet.
|
|
105
|
+
|
|
106
|
+
### Fixed
|
|
107
|
+
|
|
108
|
+
- An `import` is rooted like the core CLI's: `makeNodeWorld(baseDir, root?)` (and so `archlang3d build`, `check` and `view`) reads a module only from under `root` (default: the working directory) or `baseDir`, with links and junctions followed, only a `.arch` file, and only up to 1 MiB. A refused module is the core's `E_IMPORT_OUTSIDE_ROOT`, `E_IMPORT_NOT_ARCH` or `E_IMPORT_TOO_LARGE` at the `import` (reported through `E3D_PLAN_ERRORS`); with a core older than 1.58 the refusal reads as `E_IMPORT_NOT_FOUND`; the file is still never read. Before, any path an `import` named was read.
|
|
109
|
+
|
|
5
110
|
## [0.4.0] - 2026-11-06
|
|
6
111
|
|
|
7
112
|
The core peer range is now `^1.57.0` (was `^1.45.0`): 1.57.0 is the first core that exports
|
package/README.md
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
your source and the core's drawing as they are.
|
|
6
6
|
|
|
7
7
|
From a plan it writes a replay (one HTML file: the plan draws itself, then the walls rise) and a GLB
|
|
8
|
-
for any glTF viewer. Same source, plan and 3D preview. The 3D preview is extruded from the same .arch file by the separate archlang-3d package, and checked against the plan.
|
|
8
|
+
for any glTF viewer. Same source, plan and 3D preview. The 3D preview is extruded from the same .arch file by the separate archlang-3d package, and checked against the plan: every 3D element comes from the plan's elements, and every solid is closed.
|
|
9
9
|
|
|
10
|
-
3D preview: walls, openings, floors, stairs and
|
|
11
|
-
|
|
10
|
+
3D preview: walls, openings, floors, stairs, furniture, outdoor surfaces and fences in flat colours;
|
|
11
|
+
the ground is a backdrop the viewer draws, not part of the building and not in the file; no pitched
|
|
12
|
+
roofs or balcony railings yet, and no sections, elevations or BIM.
|
|
12
13
|
|
|
13
14
|
## Install
|
|
14
15
|
|
|
@@ -29,7 +30,7 @@ cp node_modules/@chanmeng666/archlang/examples/laneway-house.arch plan.arch
|
|
|
29
30
|
npx archlang3d view plan.arch --replay -o plan.html
|
|
30
31
|
```
|
|
31
32
|
|
|
32
|
-
`plan.html` opens offline. three.js
|
|
33
|
+
`plan.html` opens offline. The pinned three.js is inside the file with its licence notice, and nothing
|
|
33
34
|
is fetched from a network. `--theme dark` and `--storey <n>` change what it shows.
|
|
34
35
|
|
|
35
36
|
A plan of several storeys rises storey by storey, each lifted clear of the one below so the floor
|
package/THIRD_PARTY_NOTICES
CHANGED
|
@@ -947,10 +947,10 @@ This software contains code derived from the Puppeteer project (https://github.c
|
|
|
947
947
|
available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE).
|
|
948
948
|
|
|
949
949
|
==============================================================================
|
|
950
|
-
three 0.
|
|
950
|
+
three 0.187.0 — MIT
|
|
951
951
|
https://github.com/mrdoob/three.js
|
|
952
952
|
|
|
953
|
-
LICENSE is MIT (three.js authors). The core build
|
|
953
|
+
LICENSE is MIT (three.js authors). The viewer imports the core build and OrbitControls (examples/jsm/controls), both three.js's own code under this LICENSE; OrbitControls carries no notice of its own (read at 0.187.0). The other addons, some of which carry their own notices, are not imported. Inlined into the replay HTML with its notice.
|
|
954
954
|
|
|
955
955
|
The MIT License
|
|
956
956
|
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { P as PresetName, V as Vec3 } from './camera-
|
|
1
|
+
import { P as PresetName, V as Vec3 } from './camera-DcyxtBjK.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-CA-IAT0N.js';
|
|
5
|
+
export { R as ReplayFacts, s as stripAt } from './strip-CA-IAT0N.js';
|
|
6
|
+
import '@chanmeng666/archlang';
|
|
6
7
|
|
|
7
8
|
interface ReplayHandle {
|
|
8
9
|
/** Render the frame at replay time `t` (clamped to [0, 1]) into the canvas, synchronously. */
|
|
@@ -15,6 +16,14 @@ interface ReplayHandle {
|
|
|
15
16
|
dispose: () => void;
|
|
16
17
|
/** The camera the user moves (card CR4); present when mounted with `interactive: true`. */
|
|
17
18
|
view?: ViewControl;
|
|
19
|
+
/**
|
|
20
|
+
* Give the canvas a new drawing size (a host whose canvas follows its container, playground card
|
|
21
|
+
* PG1) and redraw the last frame at it. Everything the frame reads from the size (the drawing's
|
|
22
|
+
* frame, the cameras' aspect, the stops' framing, the presets) is worked out again as a mount at
|
|
23
|
+
* that size works it out, so after `resize(w, h)` the frame at `t` is the frame a fresh mount at
|
|
24
|
+
* `w`×`h` draws at `t`. Never called, nothing changes: the payload's size is the canvas's.
|
|
25
|
+
*/
|
|
26
|
+
resize: (width: number, height: number) => void;
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
/** Who holds the camera: the replay, a preset, or the user's own orbit. */
|
|
@@ -60,6 +69,13 @@ interface ViewControl {
|
|
|
60
69
|
restore: (s: ViewState) => void;
|
|
61
70
|
/** Hear when `camera` or `shown` changes (a drag, a preset, a seek, a restore); returns the unsubscribe. */
|
|
62
71
|
onChange: (fn: () => void) => () => void;
|
|
72
|
+
/**
|
|
73
|
+
* Turn the view `degrees` about its pivot, as a drag across would (a host's turntable, playground
|
|
74
|
+
* card PG1), and draw it. The host chooses each step; nothing here reads a clock. The first step
|
|
75
|
+
* takes the view from the replay or a preset (the camera becomes "free", `onTake`), from the
|
|
76
|
+
* frame on the canvas. A host that never calls it draws exactly what it drew before.
|
|
77
|
+
*/
|
|
78
|
+
spin: (degrees: number) => void;
|
|
63
79
|
}
|
|
64
80
|
interface MountOptions {
|
|
65
81
|
/**
|
|
@@ -105,8 +121,22 @@ interface ToolbarOptions {
|
|
|
105
121
|
buttonClass?: string;
|
|
106
122
|
/** An id for the hint line, so the canvas can point at it (`aria-describedby`). */
|
|
107
123
|
hintId?: string;
|
|
124
|
+
/**
|
|
125
|
+
* The compact form, for a host that lays the toolbar over its canvas (playground card PG1): Reset
|
|
126
|
+
* first ("⟲ Reset"), then a "View ▾" button whose popover holds the preset buttons, then the
|
|
127
|
+
* storeys and the hint. Every button keeps its text, accessible name, `data-*` and `aria-pressed`;
|
|
128
|
+
* only where the presets sit changes. Off by default: the row the replay HTML shows.
|
|
129
|
+
*/
|
|
130
|
+
compact?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* The "Storeys shown" cut-away buttons (a plan of more than one storey). On by default: the row
|
|
133
|
+
* the replay HTML shows. `false` leaves them out, for a host with its own storey control that
|
|
134
|
+
* already chooses which storeys the view shows (the playground's storey switcher, card PG5b), so
|
|
135
|
+
* the page has one storey control, not two. `view.showStoreys` is unchanged either way.
|
|
136
|
+
*/
|
|
137
|
+
storeys?: boolean;
|
|
108
138
|
}
|
|
109
|
-
/** The toolbar for `view`: preset buttons, Reset, the storeys (more than one), the hint. */
|
|
139
|
+
/** The toolbar for `view`: preset buttons, Reset, the storeys (more than one, unless `storeys: false`), the hint. */
|
|
110
140
|
declare function viewToolbar(view: ViewControl, opts?: ToolbarOptions): HTMLElement;
|
|
111
141
|
|
|
112
142
|
/** The strip's DOM half, apart from `strip.ts` so that the types of `.` and `./node` need no DOM lib. */
|