fast-mesh-wasm 0.4.0 → 0.5.1
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/README.md +51 -3
- package/dist/{api-BUy7FRx7.js → api-4kz45-Mq.js} +2 -3
- package/dist/{client-Bpjy-eFY.js → client-C61Kku4i.js} +102 -24
- package/dist/{client-D-O5-tAg.d.ts → client-tP6R9foI.d.ts} +19 -8
- package/dist/{colormap-DxGMYVfs.js → colormap-Dr5V3bvs.js} +1 -2
- package/dist/{core-Cke_kZ2e.js → core-4OcWKu3r.js} +2 -2
- package/dist/{core-D2X9GPfK.d.ts → core-CJ9D6U5A.d.ts} +1 -3
- package/dist/{engine-D6MpGb9i.js → engine-X1Awlc5y.js} +58 -28
- package/dist/io.d.ts +294 -0
- package/dist/io.js +1395 -0
- package/dist/{mesh-zj7-wJBw.js → mesh-CWvrjO8S.js} +3 -4
- package/dist/{mesh-BUVxv3jo.d.ts → mesh-D3fv56nF.d.ts} +1 -3
- package/dist/node.d.ts +3 -5
- package/dist/node.js +4 -5
- package/dist/{protocol-CK6_3aqo.d.ts → protocol-BGQAB0op.d.ts} +16 -3
- package/dist/{protocol-CAUYm1gd.js → protocol-Ci9LLiwO.js} +7 -6
- package/dist/r3f.d.ts +22 -6
- package/dist/r3f.js +28 -19
- package/dist/{react-CTADh3NN.js → react-DzrtrzZy.js} +4 -6
- package/dist/react.d.ts +4 -6
- package/dist/react.js +1 -1
- package/dist/{scene-D6m9XM3O.js → scene-BnkCS0sv.js} +668 -14
- package/dist/{scene-like-DJKQP5uf.d.ts → scene-like-BzkDNHCy.d.ts} +502 -42
- package/dist/{snapshot-Cf6NgDl7.js → snapshot-BkbGPspK.js} +1 -2
- package/dist/{store-QWRDXlAn.d.ts → store-BKFzSykN.d.ts} +3 -9
- package/dist/{store-Ml3TQGsR.js → store-CEd2y2KS.js} +7 -9
- package/dist/store.d.ts +2 -4
- package/dist/store.js +4 -5
- package/dist/three.d.ts +2 -6
- package/dist/three.js +4 -6
- package/dist/{views-Dh3aWc2q.js → views-CUBMOK0U.js} +5 -8
- package/dist/wasm/fast_mesh_wasm.d.ts +86 -6
- package/dist/wasm/fast_mesh_wasm.js +192 -6
- package/dist/wasm/fast_mesh_wasm_bg.wasm +0 -0
- package/dist/wasm/fast_mesh_wasm_bg.wasm.d.ts +9 -1
- package/dist/wasm-threads/fast_mesh_wasm.d.ts +86 -6
- package/dist/wasm-threads/fast_mesh_wasm.js +192 -6
- package/dist/wasm-threads/fast_mesh_wasm_bg.wasm +0 -0
- package/dist/wasm-threads/fast_mesh_wasm_bg.wasm.d.ts +9 -1
- package/dist/web.d.ts +3 -5
- package/dist/web.js +4 -5
- package/dist/worker-engine.d.ts +1 -7
- package/dist/worker-engine.js +1 -1
- package/dist/worker-entry.js +2 -3
- package/dist/worker.d.ts +2 -2
- package/dist/worker.js +1 -1
- package/package.json +16 -4
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@ Fast triangle mesh utilities for JavaScript and TypeScript, written in Rust and
|
|
|
8
8
|
|
|
9
9
|
**[Live demo](https://yoondonggeun.github.io/fast-mesh-wasm/)**: the [showcase app](examples/showcase) in your browser.
|
|
10
10
|
|
|
11
|
+
**[API reference](https://yoondonggeun.github.io/fast-mesh-wasm/api/)**: the [TypeScript API](https://yoondonggeun.github.io/fast-mesh-wasm/api/js/) of the `fast-mesh-wasm` package and the [Rust API](https://yoondonggeun.github.io/fast-mesh-wasm/api/rust/) of the workspace crates, rebuilt from `main` on every push. Task-oriented recipes live in the [cookbook](docs/cookbook).
|
|
12
|
+
|
|
11
13
|
- Works in browsers (Vite, webpack, Next.js), Node.js and Bun
|
|
12
14
|
- Installs the same way with npm, pnpm and bun. No native build step, no install scripts, zero dependencies
|
|
13
15
|
- Full TypeScript types and inline docs, generated from the Rust source
|
|
@@ -202,7 +204,7 @@ const closest = scene.meshDistance(upper, lower); // { distance, a, b, ... }
|
|
|
202
204
|
scene.free(); // or `using scene = new Scene()`
|
|
203
205
|
```
|
|
204
206
|
|
|
205
|
-
Errors are `FastMeshError`s with a `code` (`UNKNOWN_MESH`, `INVALID_ARGUMENT`, `STALE_BVH`, ...). After a trap inside the WebAssembly module every later call throws `INSTANCE_POISONED`. A view is only valid until the next scene call that may allocate or move buffers: a kept view may read other data or be empty, so re-acquire views after any scene call. `new Scene({ debug: true })` makes views warn when they are read after such a call. Mesh edits (`scene.edit`), `analyze`, `repair`, sections (`addSection`, `section`, `sectionGap`) and `findContacts` are documented in the types.
|
|
207
|
+
Errors are `FastMeshError`s with a `code` (`UNKNOWN_MESH`, `INVALID_ARGUMENT`, `STALE_BVH`, ...). After a trap inside the WebAssembly module every later call throws `INSTANCE_POISONED`. A view is only valid until the next scene call that may allocate or move buffers: a kept view may read other data or be empty, so re-acquire views after any scene call. `new Scene({ debug: true })` makes views warn when they are read after such a call. Mesh edits (`scene.edit`), `analyze`, `measure`, `repair`, sections (`addSection`, `section`, `sectionGap`) and `findContacts` are documented in the types.
|
|
206
208
|
|
|
207
209
|
### Contact groups: fields to several meshes
|
|
208
210
|
|
|
@@ -293,7 +295,7 @@ const values = await scene.fetchFieldValues(gap); // `fieldValues` on Scene
|
|
|
293
295
|
- **Requests run in order.** A newer colouring, section plane/meshes/fill or drag move drops the older one if it has not started yet, so fast toggling settles on the last state without doing the steps in between. Edits, repairs, `setPlacement`, adds, removals and undo/redo are never dropped. Each `setPlacement` is an undo step: for pointer-rate updates use a drag. Long work runs in steps: the Worker yields every few milliseconds during a field build, a field update or a large add, so newer batches are received (and coalesced) meanwhile.
|
|
294
296
|
- **Drags are optimistic.** `scene.drag(mesh).move(pose)` moves the placement mirror at once, so the object follows the pointer; colours and sections catch up when the Worker's result arrives. In 9a a key's status covers only requests made under that key: a drag, `setPlacement` or edit puts its own key (`placement:<id>`, `edit:<id>`) into `"computing"`, not the `display:<id>` or `section:<id>:*` keys of the state that catches up after it. `end()` and `cancel()` return at once; `cancel()` restores the start pose and records nothing.
|
|
295
297
|
- **Wide-range colouring during a drag.** After each batch the Worker recomputes the fields the batch made due in small steps, and drops the recompute when a newer move, `setPlacement`, edit, repair, compact, undo/redo or removal of either mesh is already queued; other requests wait for it. A pose's colours are applied all at once, never partly. So while the pointer keeps moving and one recompute takes longer than a frame, newer moves drop the recompute, until 200 ms have passed since the last colours were applied: then the recompute under way finishes and is shown, and the newest pose follows. During a sustained drag the colours therefore update about every 200 ms plus one recompute, each update exactly one pose, and when the drag ends (`end()`) the last pose's colours arrive within about one recompute (measured: one at 1M, but about 1.5 at 10M when most of the mesh is in range): the end drops a recompute kept for an older pose. A pointer that only pauses, without ending the drag, may wait up to two recomputes. Edits, undo/redo, removals and cancels always drop a stale recompute. `fetchFieldValues()` and `fieldStatus()` first bring every due field up to date in one go, which cannot be dropped, so do not poll them during a drag. On two touching 1M-triangle meshes with `maxDistance` 8, a recompute takes from about 0.07 s to 0.7 s depending on how much of the mesh is in range, and about ten times that at 10M; the Worker is never blocked for long, since a recompute runs in steps: about 12 ms at a time at 1M, and 14 to 18 ms for field builds and edits at 10M (see [docs/benchmarks.md](docs/benchmarks.md)). These are single-threaded figures; on a cross-origin isolated page the threaded engine makes a recompute 1.4 to 4.5 times faster (see [Multithreading (COOP/COEP)](#multithreading-coopcoep)). A contact range (a small `maxDistance`) keeps up with the pointer.
|
|
296
|
-
- **Queries and anything that returns data** (`raycast`, `closestPoint`, `meshDistance`, `intersects`, `findContacts`, `analyze`, `edit`, `repair`, `fetchFieldValues`, `fieldStatus`, `sectionGap`) return promises. Once a frame loop runs they go out with the next `commitFrame()` (or after 100 ms if no frame comes); before the first `commitFrame()` they are sent on a microtask. For latency-critical picking, keep a light picking copy in a main-thread `Scene`.
|
|
298
|
+
- **Queries and anything that returns data** (`raycast`, `closestPoint`, `meshDistance`, `intersects`, `findContacts`, `analyze`, `measure`, `edit`, `repair`, `fetchFieldValues`, `fieldStatus`, `sectionGap`) return promises. Once a frame loop runs they go out with the next `commitFrame()` (or after 100 ms if no frame comes); before the first `commitFrame()` they are sent on a microtask. For latency-critical picking, keep a light picking copy in a main-thread `Scene`.
|
|
297
299
|
- **Errors.** A failed state change shows on its key (`status(key).error`, a `FastMeshError` with the same `code` as on `Scene`); a failed promise rejects with it. After a trap inside the Worker every call fails with `INSTANCE_POISONED`, also when it happens on one of the multithreaded engine's pool threads (a panic or a trap in work split across threads); a few kinds of pool-thread failure still cannot be detected (see [Multithreading (COOP/COEP)](#multithreading-coopcoep)). `await scene.restart()` starts a new Worker and replays the scene from the main thread's mirrors: meshes (compacted: slot ids change, handles do not), placements, fields, colourings and sections. History is cleared, and edits or queries that had not finished fail and must be re-issued.
|
|
298
300
|
- **Not in the Worker scene:** user-opened steps (`beginStep`/`endStep`/`cancelStep`), Lazy and Manual modes (it is always eager) and `takeChanges` (use `onChanges` or the return value of `commitFrame()`). `terminate()` stops the Worker.
|
|
299
301
|
- **Large meshes.** `addMesh` copies its inputs on the main thread (they are then transferred to the Worker) and, without an `origin` option, scans the positions for the bounding-box centre. That takes about 9 ms for 1M triangles and about 63 ms for 10M (see [docs/benchmarks.md](docs/benchmarks.md)); passing `origin` skips the scan.
|
|
@@ -307,7 +309,53 @@ const scene = await createWorkerScene({ workerUrl: "/fast-mesh-wasm/worker-entry
|
|
|
307
309
|
const scene = await createWorkerScene({ createWorker: () => new Worker(myUrl, { type: "module" }) });
|
|
308
310
|
```
|
|
309
311
|
|
|
310
|
-
`fast-mesh-wasm/worker`
|
|
312
|
+
**Node.js.** `fast-mesh-wasm/worker` has no zero-config Node entry: `createWorkerScene()` with no
|
|
313
|
+
arguments creates a browser `Worker`. In Node use the synchronous `Scene` instead — each call blocks
|
|
314
|
+
until it returns, which is fine for a batch pipeline with no frame budget (repair, distance checks):
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
import { Scene } from "fast-mesh-wasm"; // Node entry: the .wasm loads from disk on import
|
|
318
|
+
|
|
319
|
+
const scene = new Scene(); // no init() needed, as in browsers
|
|
320
|
+
const upper = scene.addMesh(upperPositions, upperIndices);
|
|
321
|
+
const lower = scene.addMesh(lowerPositions, lowerIndices);
|
|
322
|
+
scene.repair(upper, [{ op: "removeDegenerate" }]);
|
|
323
|
+
const gap = scene.addDistanceField({ name: "gap", on: upper, to: lower, maxDistance: 2 });
|
|
324
|
+
scene.setColoring(upper, { field: gap, map: "turbo", range: [-0.5, 1] });
|
|
325
|
+
const distance = scene.meshDistance(upper, lower)?.distance ?? Infinity;
|
|
326
|
+
const colors = scene.views(upper).colors(); // RGBA8, 4 bytes per vertex slot (null when uncoloured)
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
`WorkerScene` still runs in Node through the `createWorker` option with a small `node:worker_threads`
|
|
330
|
+
adapter. It is always single-threaded there: Node reports no `crossOriginIsolated`, so `threads` is
|
|
331
|
+
ignored and `scene.threads` reads `1`. The bench and test harnesses do this
|
|
332
|
+
(`packages/fast-mesh-wasm/bench/worker-harness.mjs`, `test/harness/node-worker.mjs`); the shape is:
|
|
333
|
+
|
|
334
|
+
```ts
|
|
335
|
+
import { Worker } from "node:worker_threads";
|
|
336
|
+
import { createWorkerScene } from "fast-mesh-wasm/worker";
|
|
337
|
+
|
|
338
|
+
const scene = await createWorkerScene({
|
|
339
|
+
createWorker: () => {
|
|
340
|
+
const worker = new Worker(workerUrl, { workerData: { serve: true } });
|
|
341
|
+
const listeners: ((e: { data: unknown }) => void)[] = [];
|
|
342
|
+
worker.on("message", (data) => {
|
|
343
|
+
for (const cb of listeners) cb({ data });
|
|
344
|
+
});
|
|
345
|
+
return {
|
|
346
|
+
postMessage: (msg: unknown, transfer?: Transferable[]) => worker.postMessage(msg, transfer),
|
|
347
|
+
addEventListener: (type: string, cb: (e: { data: unknown }) => void) => {
|
|
348
|
+
if (type === "message") listeners.push(cb);
|
|
349
|
+
},
|
|
350
|
+
terminate: () => worker.terminate(),
|
|
351
|
+
};
|
|
352
|
+
},
|
|
353
|
+
});
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
where the worker script serves the engine on `parentPort` (see `bench/worker-harness.mjs`). Prefer
|
|
357
|
+
the synchronous `Scene` above unless a headless pipeline needs `WorkerScene` parity (status keys,
|
|
358
|
+
background adds).
|
|
311
359
|
|
|
312
360
|
## Multithreading (COOP/COEP)
|
|
313
361
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as call, r as ensureInitialized, s as setMemory } from "./core-
|
|
1
|
+
import { n as call, r as ensureInitialized, s as setMemory } from "./core-4OcWKu3r.js";
|
|
2
2
|
import * as wasm from "./wasm/fast_mesh_wasm.js";
|
|
3
|
-
|
|
3
|
+
// src/api.ts
|
|
4
4
|
/**
|
|
5
5
|
* Called by the entry point once the WebAssembly module is instantiated, with
|
|
6
6
|
* what `initSync` / the default init returned; keeps its memory for views.
|
|
@@ -60,5 +60,4 @@ function computeBounds(positions) {
|
|
|
60
60
|
]
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
//#endregion
|
|
64
63
|
export { computeVertexNormals as n, markInitialized as r, computeBounds as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { o as reportListenerError, t as FastMeshError } from "./core-
|
|
2
|
-
import { a as FieldHandle, c as rotationMatrix, l as targetsOf, o as MeshHandle, r as copyRule, s as SectionHandle, t as ViewGuard } from "./views-
|
|
3
|
-
import { a as supersedes, n as isLastWins, r as keyOf } from "./protocol-
|
|
4
|
-
|
|
1
|
+
import { o as reportListenerError, t as FastMeshError } from "./core-4OcWKu3r.js";
|
|
2
|
+
import { a as FieldHandle, c as rotationMatrix, l as targetsOf, o as MeshHandle, r as copyRule, s as SectionHandle, t as ViewGuard } from "./views-CUBMOK0U.js";
|
|
3
|
+
import { a as supersedes, n as isLastWins, r as keyOf } from "./protocol-Ci9LLiwO.js";
|
|
4
|
+
// src/worker/client.ts
|
|
5
5
|
/**
|
|
6
6
|
* Starts a Worker running the scene engine and resolves once it is ready.
|
|
7
7
|
* Rejects with `INSTANCE_POISONED` when the Worker could not load fast-mesh.
|
|
@@ -33,6 +33,8 @@ async function createWorkerScene(options = {}) {
|
|
|
33
33
|
if (skipped && debug) console.warn(THREADS_UNAVAILABLE);
|
|
34
34
|
return scene;
|
|
35
35
|
}
|
|
36
|
+
/** The most threads {@link WorkerSceneOptions.threads} asks for; more are clamped. */
|
|
37
|
+
const MAX_THREADS = 64;
|
|
36
38
|
/**
|
|
37
39
|
* Set by `WorkerScene`'s static block: makes a scene (the constructor is
|
|
38
40
|
* private) and returns it with its first Worker's start.
|
|
@@ -73,24 +75,45 @@ function transferOf(batch) {
|
|
|
73
75
|
}
|
|
74
76
|
/** The most failed requests kept for `restart()`. */
|
|
75
77
|
const FAILED_LOG_LIMIT = 1e4;
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
+
/**
|
|
79
|
+
* `placement · translate(origin)`, column-major, as `Scene.matrix4`: the
|
|
80
|
+
* rotation columns carry the scale and the last column is
|
|
81
|
+
* `rotation · (scale · origin) + translation`, in the same operation order
|
|
82
|
+
* as the engine, so the mirrors stay bit-identical to it.
|
|
83
|
+
*/
|
|
84
|
+
function poseOf(rotation, translation, origin, scale) {
|
|
78
85
|
const r = rotation;
|
|
79
86
|
const o = origin;
|
|
87
|
+
const s = scale;
|
|
80
88
|
const m = /* @__PURE__ */ new Float64Array(16);
|
|
81
89
|
for (let row = 0; row < 3; row++) {
|
|
82
|
-
for (let col = 0; col < 3; col++) m[4 * col + row] = r[3 * row + col];
|
|
83
|
-
m[12 + row] = r[3 * row] * o[0] + r[3 * row + 1] * o[1] + r[3 * row + 2] * o[2] + translation[row];
|
|
90
|
+
for (let col = 0; col < 3; col++) m[4 * col + row] = s[col] * r[3 * row + col];
|
|
91
|
+
m[12 + row] = r[3 * row] * (s[0] * o[0]) + r[3 * row + 1] * (s[1] * o[1]) + r[3 * row + 2] * (s[2] * o[2]) + translation[row];
|
|
84
92
|
}
|
|
85
93
|
m[15] = 1;
|
|
86
94
|
return {
|
|
87
95
|
rotation,
|
|
88
96
|
translation,
|
|
97
|
+
scale,
|
|
89
98
|
matrix4: m
|
|
90
99
|
};
|
|
91
100
|
}
|
|
92
101
|
function samePose(a, b) {
|
|
93
|
-
return a.matrix4.every((v, k) => v === b.matrix4[k]) && a.translation.every((v, k) => v === b.translation[k]);
|
|
102
|
+
return a.matrix4.every((v, k) => v === b.matrix4[k]) && a.translation.every((v, k) => v === b.translation[k]) && a.scale.every((v, k) => v === b.scale[k]);
|
|
103
|
+
}
|
|
104
|
+
/** A placement input's scale as a `Vec3`: `[1, 1, 1]` when omitted, as the engine defaults it. */
|
|
105
|
+
function scaleOf(scale) {
|
|
106
|
+
if (scale === void 0) return [
|
|
107
|
+
1,
|
|
108
|
+
1,
|
|
109
|
+
1
|
|
110
|
+
];
|
|
111
|
+
if (scale.length !== 3) throw invalid("scale must be 3 numbers");
|
|
112
|
+
return [
|
|
113
|
+
scale[0],
|
|
114
|
+
scale[1],
|
|
115
|
+
scale[2]
|
|
116
|
+
];
|
|
94
117
|
}
|
|
95
118
|
/**
|
|
96
119
|
* The engine's default origin, the bounding-box centre, or `undefined` when
|
|
@@ -754,6 +777,7 @@ var WorkerScene = class WorkerScene {
|
|
|
754
777
|
if (st !== void 0) st.pose = {
|
|
755
778
|
rotation: p.rotation,
|
|
756
779
|
translation: p.translation,
|
|
780
|
+
scale: p.scale,
|
|
757
781
|
matrix4: Float64Array.from(p.matrix4)
|
|
758
782
|
};
|
|
759
783
|
}
|
|
@@ -997,7 +1021,11 @@ var WorkerScene = class WorkerScene {
|
|
|
997
1021
|
0,
|
|
998
1022
|
0,
|
|
999
1023
|
0
|
|
1000
|
-
], known
|
|
1024
|
+
], known, [
|
|
1025
|
+
1,
|
|
1026
|
+
1,
|
|
1027
|
+
1
|
|
1028
|
+
]),
|
|
1001
1029
|
local: void 0,
|
|
1002
1030
|
localUntil: 0,
|
|
1003
1031
|
requested: void 0,
|
|
@@ -1035,8 +1063,47 @@ var WorkerScene = class WorkerScene {
|
|
|
1035
1063
|
removeMesh(mesh) {
|
|
1036
1064
|
const st = this.#live(mesh);
|
|
1037
1065
|
if (this.#drag?.mesh === st) this.#drag.end();
|
|
1038
|
-
st.removed = true;
|
|
1039
1066
|
const rev = ++this.#rev;
|
|
1067
|
+
this.#noteRemoved(st, rev);
|
|
1068
|
+
this.#push({
|
|
1069
|
+
kind: "removeMesh",
|
|
1070
|
+
rev,
|
|
1071
|
+
id: st.id
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Joins `source` into `target`; see `Scene.join`. The source stays usable
|
|
1076
|
+
* until the join lands: only a successful result removes it (a failed join
|
|
1077
|
+
* changes nothing, engine-side or here).
|
|
1078
|
+
*/
|
|
1079
|
+
join(target, source, options) {
|
|
1080
|
+
const ta = this.#live(target);
|
|
1081
|
+
const st = this.#live(source);
|
|
1082
|
+
if (this.#drag?.mesh === st) this.#drag.end();
|
|
1083
|
+
const payload = copyInput(options, "options");
|
|
1084
|
+
let rev = 0;
|
|
1085
|
+
return this.#ask((r, qid) => {
|
|
1086
|
+
rev = r;
|
|
1087
|
+
return {
|
|
1088
|
+
kind: "join",
|
|
1089
|
+
rev: r,
|
|
1090
|
+
target: ta.id,
|
|
1091
|
+
source: st.id,
|
|
1092
|
+
payload,
|
|
1093
|
+
qid
|
|
1094
|
+
};
|
|
1095
|
+
}, (v) => v).then((report) => {
|
|
1096
|
+
this.#noteRemoved(st, rev);
|
|
1097
|
+
return report;
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* Notes a mesh as removed at `rev`: later calls on it give `UNKNOWN_MESH`,
|
|
1102
|
+
* fields on it (or only to it) are dropped and its section entries go. The
|
|
1103
|
+
* engine does the same when the removal lands.
|
|
1104
|
+
*/
|
|
1105
|
+
#noteRemoved(st, rev) {
|
|
1106
|
+
st.removed = true;
|
|
1040
1107
|
for (const f of this.#fields.values()) {
|
|
1041
1108
|
if (f.removed) continue;
|
|
1042
1109
|
if (f.desc.on === st.id || f.desc.to.length === 1 && f.desc.to[0] === st.id) this.#fieldRemoved(f, rev);
|
|
@@ -1046,13 +1113,11 @@ var WorkerScene = class WorkerScene {
|
|
|
1046
1113
|
};
|
|
1047
1114
|
}
|
|
1048
1115
|
for (const s of this.#sections.values()) if (!s.removed) s.meshes = s.meshes.filter((m) => m !== st);
|
|
1049
|
-
this.#push({
|
|
1050
|
-
kind: "removeMesh",
|
|
1051
|
-
rev,
|
|
1052
|
-
id: st.id
|
|
1053
|
-
});
|
|
1054
1116
|
}
|
|
1055
|
-
/**
|
|
1117
|
+
/**
|
|
1118
|
+
* Sets a mesh's placement (one undo step), scale included (`[1, 1, 1]`
|
|
1119
|
+
* when omitted); `placement()` follows when the result arrives.
|
|
1120
|
+
*/
|
|
1056
1121
|
setPlacement(mesh, placement) {
|
|
1057
1122
|
const st = this.#live(mesh);
|
|
1058
1123
|
const rotation = rotationMatrix(placement.rotation);
|
|
@@ -1063,22 +1128,25 @@ var WorkerScene = class WorkerScene {
|
|
|
1063
1128
|
t[1],
|
|
1064
1129
|
t[2]
|
|
1065
1130
|
];
|
|
1066
|
-
|
|
1131
|
+
const scale = scaleOf(placement.scale);
|
|
1132
|
+
st.requested = poseOf(rotation, translation, st.origin, scale);
|
|
1067
1133
|
st.requestedUntil = this.#push({
|
|
1068
1134
|
kind: "setPlacement",
|
|
1069
1135
|
rev: ++this.#rev,
|
|
1070
1136
|
id: st.id,
|
|
1071
1137
|
rotation,
|
|
1072
1138
|
translation,
|
|
1139
|
+
scale,
|
|
1073
1140
|
key: `placement:${st.id}`
|
|
1074
1141
|
});
|
|
1075
1142
|
}
|
|
1076
|
-
/** The mesh's placement as mirrored (a drag's pose while it is held). */
|
|
1143
|
+
/** The mesh's placement as mirrored, scale always present (a drag's pose while it is held). */
|
|
1077
1144
|
placement(mesh) {
|
|
1078
1145
|
const p = this.#shown(this.#mirrored(mesh));
|
|
1079
1146
|
return {
|
|
1080
1147
|
rotation: [...p.rotation],
|
|
1081
|
-
translation: [...p.translation]
|
|
1148
|
+
translation: [...p.translation],
|
|
1149
|
+
scale: [...p.scale]
|
|
1082
1150
|
};
|
|
1083
1151
|
}
|
|
1084
1152
|
/** The column-major world matrix of the mesh's local render coordinates, as mirrored. */
|
|
@@ -1185,7 +1253,8 @@ var WorkerScene = class WorkerScene {
|
|
|
1185
1253
|
t[1],
|
|
1186
1254
|
t[2]
|
|
1187
1255
|
];
|
|
1188
|
-
|
|
1256
|
+
const scale = scaleOf(placement.scale);
|
|
1257
|
+
st.local = poseOf(rotation, translation, st.origin, scale);
|
|
1189
1258
|
this.#optimistic.add(st);
|
|
1190
1259
|
this.#push({
|
|
1191
1260
|
kind: "drag",
|
|
@@ -1194,6 +1263,7 @@ var WorkerScene = class WorkerScene {
|
|
|
1194
1263
|
phase: "move",
|
|
1195
1264
|
rotation,
|
|
1196
1265
|
translation,
|
|
1266
|
+
scale,
|
|
1197
1267
|
key
|
|
1198
1268
|
});
|
|
1199
1269
|
},
|
|
@@ -1232,6 +1302,10 @@ var WorkerScene = class WorkerScene {
|
|
|
1232
1302
|
options
|
|
1233
1303
|
}), (v) => v);
|
|
1234
1304
|
}
|
|
1305
|
+
/** Scalar measurements of a mesh; see `Scene.measure`. */
|
|
1306
|
+
measure(mesh) {
|
|
1307
|
+
return this.#query("measure", () => ({ mesh: this.#live(mesh).id }), (v) => v);
|
|
1308
|
+
}
|
|
1235
1309
|
repair(mesh, op) {
|
|
1236
1310
|
return this.#ask((rev, qid) => ({
|
|
1237
1311
|
kind: "repair",
|
|
@@ -1961,7 +2035,11 @@ var WorkerScene = class WorkerScene {
|
|
|
1961
2035
|
0,
|
|
1962
2036
|
0,
|
|
1963
2037
|
0
|
|
1964
|
-
], st.origin
|
|
2038
|
+
], st.origin, [
|
|
2039
|
+
1,
|
|
2040
|
+
1,
|
|
2041
|
+
1
|
|
2042
|
+
]))) continue;
|
|
1965
2043
|
st.requested = pose;
|
|
1966
2044
|
st.requestedUntil = ++this.#rev;
|
|
1967
2045
|
if (!samePose(pose, st.pose)) {
|
|
@@ -1974,6 +2052,7 @@ var WorkerScene = class WorkerScene {
|
|
|
1974
2052
|
id: st.id,
|
|
1975
2053
|
rotation: pose.rotation,
|
|
1976
2054
|
translation: pose.translation,
|
|
2055
|
+
scale: pose.scale,
|
|
1977
2056
|
key: `placement:${st.id}`
|
|
1978
2057
|
});
|
|
1979
2058
|
}
|
|
@@ -2274,5 +2353,4 @@ function normalised(plane) {
|
|
|
2274
2353
|
]
|
|
2275
2354
|
};
|
|
2276
2355
|
}
|
|
2277
|
-
|
|
2278
|
-
export { watchStatusKeys as i, addFieldKeyed as n, createWorkerScene as r, WorkerScene as t };
|
|
2356
|
+
export { watchStatusKeys as a, createWorkerScene as i, WorkerScene as n, addFieldKeyed as r, MAX_THREADS as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { t as FastMeshError } from "./core-
|
|
3
|
-
import "./protocol-
|
|
4
|
-
//#region src/worker/client.d.ts
|
|
1
|
+
import { $ as SectionPlane, A as JoinReport, B as RaycastOptions, C as FieldStatus, Ct as Placement, E as FindContactsOptions, Et as Positions64, F as MeshDistance, K as RepairReportOf, M as MeasureResult, N as MeshChange, Q as SectionGap, S as EditResult, W as RepairOp, Z as SectionDesc, _ as DistanceFieldDesc, _t as MeshHandle, b as EditOp, bt as Indices, c as ClosestHit, et as SectionResult, f as Contact, gt as FieldHandle, ht as MeshViews, i as AnalyzeOptions, k as JoinOptions, kt as Vec3, l as ClosestPointOptions, n as AddMeshOptions, r as Analysis, t as SceneLike, u as ColorRule, vt as SectionHandle, wt as PlacementInput, y as DragSession, z as RayHit } from "./scene-like-BzkDNHCy.js";
|
|
2
|
+
import { t as FastMeshError } from "./core-CJ9D6U5A.js";
|
|
3
|
+
import "./protocol-BGQAB0op.js";
|
|
5
4
|
/** What {@link WorkerScene} needs of a Worker; a browser `Worker` fits. */
|
|
6
5
|
interface WorkerLike {
|
|
7
6
|
postMessage(msg: unknown, transfer?: Transferable[]): void;
|
|
@@ -71,6 +70,8 @@ interface KeyStatus {
|
|
|
71
70
|
* Rejects with `INSTANCE_POISONED` when the Worker could not load fast-mesh.
|
|
72
71
|
*/
|
|
73
72
|
declare function createWorkerScene(options?: WorkerSceneOptions): Promise<WorkerScene>;
|
|
73
|
+
/** The most threads {@link WorkerSceneOptions.threads} asks for; more are clamped. */
|
|
74
|
+
declare const MAX_THREADS = 64;
|
|
74
75
|
/**
|
|
75
76
|
* A scene whose engine runs in a Worker, from {@link createWorkerScene}. It
|
|
76
77
|
* mirrors `Scene` (always `"eager"`) with these differences:
|
|
@@ -120,9 +121,18 @@ declare class WorkerScene implements SceneLike {
|
|
|
120
121
|
* by `commitFrame()`.
|
|
121
122
|
*/
|
|
122
123
|
removeMesh(mesh: MeshHandle): void;
|
|
123
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* Joins `source` into `target`; see `Scene.join`. The source stays usable
|
|
126
|
+
* until the join lands: only a successful result removes it (a failed join
|
|
127
|
+
* changes nothing, engine-side or here).
|
|
128
|
+
*/
|
|
129
|
+
join(target: MeshHandle, source: MeshHandle, options: JoinOptions): Promise<JoinReport>;
|
|
130
|
+
/**
|
|
131
|
+
* Sets a mesh's placement (one undo step), scale included (`[1, 1, 1]`
|
|
132
|
+
* when omitted); `placement()` follows when the result arrives.
|
|
133
|
+
*/
|
|
124
134
|
setPlacement(mesh: MeshHandle, placement: PlacementInput): void;
|
|
125
|
-
/** The mesh's placement as mirrored (a drag's pose while it is held). */
|
|
135
|
+
/** The mesh's placement as mirrored, scale always present (a drag's pose while it is held). */
|
|
126
136
|
placement(mesh: MeshHandle): Placement;
|
|
127
137
|
/** The column-major world matrix of the mesh's local render coordinates, as mirrored. */
|
|
128
138
|
matrix4(mesh: MeshHandle): Float64Array;
|
|
@@ -152,6 +162,8 @@ declare class WorkerScene implements SceneLike {
|
|
|
152
162
|
compact(mesh: MeshHandle): void;
|
|
153
163
|
/** A report of the mesh's defects; see `Scene.analyze`. */
|
|
154
164
|
analyze(mesh: MeshHandle, options?: AnalyzeOptions): Promise<Analysis>;
|
|
165
|
+
/** Scalar measurements of a mesh; see `Scene.measure`. */
|
|
166
|
+
measure(mesh: MeshHandle): Promise<MeasureResult>;
|
|
155
167
|
/** Runs one repair operation, or a list as one transaction; see `Scene.repair`. */
|
|
156
168
|
repair<const O extends RepairOp>(mesh: MeshHandle, op: O): Promise<RepairReportOf<O>>;
|
|
157
169
|
repair<const O extends readonly RepairOp[]>(mesh: MeshHandle, ops: O): Promise<{ -readonly [K in keyof O]: RepairReportOf<O[K]>; }>;
|
|
@@ -301,5 +313,4 @@ declare class WorkerScene implements SceneLike {
|
|
|
301
313
|
*/
|
|
302
314
|
terminate(): void;
|
|
303
315
|
}
|
|
304
|
-
|
|
305
|
-
export { createWorkerScene as a, WorkerSceneOptions as i, WorkerLike as n, WorkerScene as r, KeyStatus as t };
|
|
316
|
+
export { WorkerSceneOptions as a, WorkerScene as i, MAX_THREADS as n, createWorkerScene as o, WorkerLike as r, KeyStatus as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/colormap.ts
|
|
2
2
|
/** The rule's `base` colour when it gives none. */
|
|
3
3
|
const DEFAULT_BASE = [
|
|
4
4
|
200,
|
|
@@ -299,5 +299,4 @@ vec4 fmShade(vec4 a) {
|
|
|
299
299
|
return fmLinear(fmFar(a.w));
|
|
300
300
|
}
|
|
301
301
|
`;
|
|
302
|
-
//#endregion
|
|
303
302
|
export { SRGB_TO_LINEAR16 as a, SHADING_VERTEX as i, DEFAULT_NAN as n, encodeValues as o, SHADING_FRAGMENT as r, shadingOf as s, DEFAULT_BASE as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/core.ts
|
|
2
2
|
const CODES = /* @__PURE__ */ new Set([
|
|
3
3
|
"UNKNOWN_MESH",
|
|
4
4
|
"UNKNOWN_FIELD",
|
|
@@ -10,6 +10,7 @@ const CODES = /* @__PURE__ */ new Set([
|
|
|
10
10
|
"CORRUPTED",
|
|
11
11
|
"OUT_OF_MEMORY",
|
|
12
12
|
"STALE_LOOPS",
|
|
13
|
+
"STALE_SELECTION",
|
|
13
14
|
"INSTANCE_POISONED"
|
|
14
15
|
]);
|
|
15
16
|
/** An error thrown by fast-mesh, with a machine-readable `code`. */
|
|
@@ -109,5 +110,4 @@ const finalizer = new FinalizationRegistry((obj) => {
|
|
|
109
110
|
release(obj);
|
|
110
111
|
} catch {}
|
|
111
112
|
});
|
|
112
|
-
//#endregion
|
|
113
113
|
export { release as a, wasmMemory as c, finalizer as i, call as n, reportListenerError as o, ensureInitialized as r, setMemory as s, FastMeshError as t };
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
//#region src/core.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Error codes of {@link FastMeshError}.
|
|
4
3
|
* `INSTANCE_POISONED` means an earlier call panicked: the WebAssembly instance
|
|
5
4
|
* is unusable and every later call throws it. Reload the module to recover.
|
|
6
5
|
*/
|
|
7
|
-
type FastMeshErrorCode = "UNKNOWN_MESH" | "UNKNOWN_FIELD" | "UNKNOWN_SECTION" | "INVALID_ARGUMENT" | "INVALID_INDEX" | "STALE_BVH" | "STEP_NOT_OPEN" | "CORRUPTED" | "OUT_OF_MEMORY" | "STALE_LOOPS" | "INSTANCE_POISONED";
|
|
6
|
+
type FastMeshErrorCode = "UNKNOWN_MESH" | "UNKNOWN_FIELD" | "UNKNOWN_SECTION" | "INVALID_ARGUMENT" | "INVALID_INDEX" | "STALE_BVH" | "STEP_NOT_OPEN" | "CORRUPTED" | "OUT_OF_MEMORY" | "STALE_LOOPS" | "STALE_SELECTION" | "INSTANCE_POISONED";
|
|
8
7
|
/** An error thrown by fast-mesh, with a machine-readable `code`. */
|
|
9
8
|
declare class FastMeshError extends Error {
|
|
10
9
|
/** What went wrong; see {@link FastMeshErrorCode}. */
|
|
11
10
|
readonly code: FastMeshErrorCode;
|
|
12
11
|
constructor(code: FastMeshErrorCode, message: string);
|
|
13
12
|
}
|
|
14
|
-
//#endregion
|
|
15
13
|
export { FastMeshErrorCode as n, FastMeshError as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as setMemory, t as FastMeshError } from "./core-
|
|
2
|
-
import { i as useWasmScene, n as fieldSteps, r as meshAdds, t as Scene } from "./scene-
|
|
3
|
-
import { a as supersedes, n as isLastWins, r as keyOf, t as isInit } from "./protocol-
|
|
1
|
+
import { s as setMemory, t as FastMeshError } from "./core-4OcWKu3r.js";
|
|
2
|
+
import { i as useWasmScene, n as fieldSteps, r as meshAdds, t as Scene } from "./scene-BnkCS0sv.js";
|
|
3
|
+
import { a as supersedes, n as isLastWins, r as keyOf, t as isInit } from "./protocol-Ci9LLiwO.js";
|
|
4
4
|
/**
|
|
5
5
|
* A module importing a shared memory `e.m` (1 page, at most 2), exporting
|
|
6
6
|
* `grow(pages)` (`memory.grow`: the old size in pages, or -1),
|
|
@@ -323,8 +323,7 @@ async function startEngine(init, loaders, isolated = globalThis.crossOriginIsola
|
|
|
323
323
|
...probeFailed === void 0 ? {} : { probeFailed }
|
|
324
324
|
};
|
|
325
325
|
}
|
|
326
|
-
|
|
327
|
-
//#region src/worker/engine.ts
|
|
326
|
+
// src/worker/engine.ts
|
|
328
327
|
/** The default {@link EngineOptions.yieldMs}. */
|
|
329
328
|
const YIELD_MS = 4;
|
|
330
329
|
/** The default {@link EngineOptions.staleGuardMs}. */
|
|
@@ -874,6 +873,7 @@ var Engine = class {
|
|
|
874
873
|
case "drag":
|
|
875
874
|
case "edit":
|
|
876
875
|
case "repair": return this.#pending(req.id);
|
|
876
|
+
case "join": return this.#pending(req.target, req.source);
|
|
877
877
|
case "coloring": return this.#pending(req.id) || req.rule !== null && this.#fieldPending(req.rule?.field);
|
|
878
878
|
case "fetchFieldValues": return this.#fieldPending(req.field);
|
|
879
879
|
case "field": return req.desc !== void 0 ? this.#pending(req.desc.on, ...req.desc.to) : this.#fieldPending(req.field);
|
|
@@ -940,8 +940,8 @@ var Engine = class {
|
|
|
940
940
|
}
|
|
941
941
|
/**
|
|
942
942
|
* Whether `req` may change the positions, normals or triangles of the
|
|
943
|
-
* mesh `id`: an edit, repair, compaction or removal of it, or any
|
|
944
|
-
* or redo.
|
|
943
|
+
* mesh `id`: an edit, repair, compaction, join or removal of it, or any
|
|
944
|
+
* undo or redo.
|
|
945
945
|
*/
|
|
946
946
|
#changesMesh(req, id) {
|
|
947
947
|
switch (req.kind) {
|
|
@@ -949,6 +949,7 @@ var Engine = class {
|
|
|
949
949
|
case "repair":
|
|
950
950
|
case "compact":
|
|
951
951
|
case "removeMesh": return req.id === id;
|
|
952
|
+
case "join": return req.target === id || req.source === id;
|
|
952
953
|
case "undo":
|
|
953
954
|
case "redo": return true;
|
|
954
955
|
default: return false;
|
|
@@ -1184,8 +1185,8 @@ var Engine = class {
|
|
|
1184
1185
|
* Whether the queued `req` makes a field step unit over `meshes` (the
|
|
1185
1186
|
* meshes its fields are on and measured to) stale (§6.1): a drag move
|
|
1186
1187
|
* (only with `moves`: within the starvation guard), a drag cancel or a
|
|
1187
|
-
* placement, an edit, repair, compaction or removal of one of them,
|
|
1188
|
-
* undo or redo, or the removal of a field between two of them.
|
|
1188
|
+
* placement, an edit, repair, compaction, join or removal of one of them,
|
|
1189
|
+
* an undo or redo, or the removal of a field between two of them.
|
|
1189
1190
|
*/
|
|
1190
1191
|
#makesStale(req, meshes, moves) {
|
|
1191
1192
|
switch (req.kind) {
|
|
@@ -1195,6 +1196,7 @@ var Engine = class {
|
|
|
1195
1196
|
case "repair":
|
|
1196
1197
|
case "compact":
|
|
1197
1198
|
case "removeMesh": return meshes.has(req.id);
|
|
1199
|
+
case "join": return meshes.has(req.target) || meshes.has(req.source);
|
|
1198
1200
|
case "undo":
|
|
1199
1201
|
case "redo": return true;
|
|
1200
1202
|
case "field": {
|
|
@@ -1506,6 +1508,28 @@ var Engine = class {
|
|
|
1506
1508
|
#meshId(h) {
|
|
1507
1509
|
return this.#meshIds.get(h);
|
|
1508
1510
|
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Drops engine-side references of a removed mesh: fields on it (or only
|
|
1513
|
+
* to it) and its section entries. The scene did the same with the mesh.
|
|
1514
|
+
*/
|
|
1515
|
+
#dropMeshRefs(id) {
|
|
1516
|
+
for (const [field, [on, ...to]] of this.#fieldMeshes) if (on === id || to.length === 1 && to[0] === id) this.#dropField(field);
|
|
1517
|
+
else if (to.includes(id)) {
|
|
1518
|
+
this.#fieldMeshes.set(field, [on, ...to.filter((m) => m !== id)]);
|
|
1519
|
+
const desc = this.#deferred.get(field);
|
|
1520
|
+
if (desc !== void 0) this.#deferred.set(field, {
|
|
1521
|
+
...desc,
|
|
1522
|
+
to: desc.to.filter((m) => m !== id)
|
|
1523
|
+
});
|
|
1524
|
+
}
|
|
1525
|
+
for (const [section, meshes] of this.#sectionMeshes) if (meshes.includes(id)) {
|
|
1526
|
+
this.#sectionMeshes.set(section, meshes.filter((m) => m !== id));
|
|
1527
|
+
this.#goneEntries.push({
|
|
1528
|
+
section,
|
|
1529
|
+
mesh: id
|
|
1530
|
+
});
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1509
1533
|
#run(req, b) {
|
|
1510
1534
|
const s = this.#scene;
|
|
1511
1535
|
switch (req.kind) {
|
|
@@ -1526,22 +1550,22 @@ var Engine = class {
|
|
|
1526
1550
|
this.#meshes.delete(req.id);
|
|
1527
1551
|
this.#removed.push(h);
|
|
1528
1552
|
if (this.#drag?.id === req.id) this.#drag = void 0;
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
}
|
|
1553
|
+
this.#dropMeshRefs(req.id);
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1556
|
+
case "join": {
|
|
1557
|
+
const target = this.#mesh(req.target);
|
|
1558
|
+
const source = this.#mesh(req.source);
|
|
1559
|
+
const value = s.join(target, source, req.payload);
|
|
1560
|
+
this.#meshes.delete(req.source);
|
|
1561
|
+
this.#removed.push(source);
|
|
1562
|
+
if (this.#drag?.id === req.source) this.#drag = void 0;
|
|
1563
|
+
this.#dropMeshRefs(req.source);
|
|
1564
|
+
if (req.qid !== void 0) b.replies.push({
|
|
1565
|
+
qid: req.qid,
|
|
1566
|
+
ok: true,
|
|
1567
|
+
value
|
|
1568
|
+
});
|
|
1545
1569
|
return;
|
|
1546
1570
|
}
|
|
1547
1571
|
case "compact":
|
|
@@ -1550,7 +1574,8 @@ var Engine = class {
|
|
|
1550
1574
|
case "setPlacement":
|
|
1551
1575
|
s.setPlacement(this.#mesh(req.id), {
|
|
1552
1576
|
rotation: req.rotation,
|
|
1553
|
-
translation: req.translation
|
|
1577
|
+
translation: req.translation,
|
|
1578
|
+
...req.scale === void 0 ? {} : { scale: req.scale }
|
|
1554
1579
|
});
|
|
1555
1580
|
return;
|
|
1556
1581
|
case "drag":
|
|
@@ -1631,7 +1656,8 @@ var Engine = class {
|
|
|
1631
1656
|
if (req.rotation === void 0 || req.translation === void 0) throw invalid("a drag move needs a rotation and a translation");
|
|
1632
1657
|
return {
|
|
1633
1658
|
rotation: req.rotation,
|
|
1634
|
-
translation: req.translation
|
|
1659
|
+
translation: req.translation,
|
|
1660
|
+
...req.scale === void 0 ? {} : { scale: req.scale }
|
|
1635
1661
|
};
|
|
1636
1662
|
};
|
|
1637
1663
|
if (req.phase === "begin") {
|
|
@@ -1774,6 +1800,10 @@ var Engine = class {
|
|
|
1774
1800
|
const a = args;
|
|
1775
1801
|
return s.analyze(this.#mesh(a.mesh), a.options);
|
|
1776
1802
|
}
|
|
1803
|
+
case "measure": {
|
|
1804
|
+
const a = args;
|
|
1805
|
+
return s.measure(this.#mesh(a.mesh));
|
|
1806
|
+
}
|
|
1777
1807
|
case "fieldTargetStatus": {
|
|
1778
1808
|
const a = args;
|
|
1779
1809
|
return s.fieldTargetStatus(this.#field(a.field));
|
|
@@ -1828,6 +1858,7 @@ var Engine = class {
|
|
|
1828
1858
|
id,
|
|
1829
1859
|
rotation: p.rotation,
|
|
1830
1860
|
translation: p.translation,
|
|
1861
|
+
scale: p.scale,
|
|
1831
1862
|
matrix4: Array.from(s.matrix4(c.mesh))
|
|
1832
1863
|
});
|
|
1833
1864
|
}
|
|
@@ -1949,5 +1980,4 @@ var Engine = class {
|
|
|
1949
1980
|
return wire;
|
|
1950
1981
|
}
|
|
1951
1982
|
};
|
|
1952
|
-
//#endregion
|
|
1953
1983
|
export { YIELD_MS as a, loadEngine as c, STEP_POINTS as i, startEngine as l, BACKGROUND_ADD_TRIANGLES as n, runEngine as o, STALE_GUARD_MS as r, serveEngine as s, ADD_STEP_WORK as t, probeSharedGrowth as u };
|