fast-mesh-wasm 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +488 -1
- package/dist/{api-D0o2HjaU.js → api-BUy7FRx7.js} +11 -11
- package/dist/client-Bp9FRd70.js +2278 -0
- package/dist/client-m2zSdFlu.d.ts +305 -0
- package/dist/colormap-D_xH5hI5.js +303 -0
- package/dist/core-Cke_kZ2e.js +113 -0
- package/dist/core-D2X9GPfK.d.ts +15 -0
- package/dist/engine-B-ZEzR1c.js +1818 -0
- package/dist/mesh-B16gV3oX.d.ts +130 -0
- package/dist/mesh-B8pae8WA.js +428 -0
- package/dist/node.d.ts +3 -2
- package/dist/node.js +5 -4
- package/dist/protocol-CAUYm1gd.js +68 -0
- package/dist/protocol-W9R-iGl5.d.ts +293 -0
- package/dist/r3f.d.ts +59 -0
- package/dist/r3f.js +165 -0
- package/dist/react-CTADh3NN.js +124 -0
- package/dist/react.d.ts +65 -0
- package/dist/react.js +1 -0
- package/dist/scene-BG3EEyfw.js +1243 -0
- package/dist/scene-like-B_3qm0u6.d.ts +925 -0
- package/dist/snapshot-Cf6NgDl7.js +104 -0
- package/dist/store-D3ErV6o-.js +1379 -0
- package/dist/store-DNnHN33A.d.ts +285 -0
- package/dist/store.d.ts +61 -0
- package/dist/store.js +105 -0
- package/dist/three.d.ts +118 -0
- package/dist/three.js +390 -0
- package/dist/views-BaZqBxlX.js +189 -0
- package/dist/wasm/fast_mesh_wasm.d.ts +458 -0
- package/dist/wasm/fast_mesh_wasm.js +1150 -0
- package/dist/wasm/fast_mesh_wasm_bg.wasm +0 -0
- package/dist/wasm/fast_mesh_wasm_bg.wasm.d.ts +74 -0
- package/dist/wasm-threads/fast_mesh_wasm.d.ts +540 -0
- package/dist/wasm-threads/fast_mesh_wasm.js +1513 -0
- package/dist/wasm-threads/fast_mesh_wasm_bg.wasm +0 -0
- package/dist/wasm-threads/fast_mesh_wasm_bg.wasm.d.ts +93 -0
- package/dist/wasm-threads/package.json +7 -0
- package/dist/wasm-threads/snippets/fast-mesh-wasm-ae14781a92c2789e/inline0.js +16 -0
- package/dist/wasm-threads/snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.js +107 -0
- package/dist/web.d.ts +3 -2
- package/dist/web.js +4 -2
- package/dist/worker-engine.d.ts +248 -0
- package/dist/worker-engine.js +1 -0
- package/dist/worker-entry.d.ts +1 -0
- package/dist/worker-entry.js +11 -0
- package/dist/worker.d.ts +2 -0
- package/dist/worker.js +1 -0
- package/package.json +53 -4
- package/dist/api-HcskOwd7.d.ts +0 -43
|
@@ -1,5 +1,1068 @@
|
|
|
1
1
|
/* @ts-self-types="./fast_mesh_wasm.d.ts" */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* A scene of editable meshes with render buffers and change records.
|
|
5
|
+
*/
|
|
6
|
+
export class WasmScene {
|
|
7
|
+
__destroy_into_raw() {
|
|
8
|
+
const ptr = this.__wbg_ptr;
|
|
9
|
+
this.__wbg_ptr = 0;
|
|
10
|
+
WasmSceneFinalization.unregister(this);
|
|
11
|
+
return ptr;
|
|
12
|
+
}
|
|
13
|
+
free() {
|
|
14
|
+
const ptr = this.__destroy_into_raw();
|
|
15
|
+
wasm.__wbg_wasmscene_free(ptr, 0);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Drops the open step unit, if any; see [`Scene::abandon_field_step`].
|
|
19
|
+
*/
|
|
20
|
+
abandon_field_step() {
|
|
21
|
+
wasm.wasmscene_abandon_field_step(this.__wbg_ptr);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Adds a signed distance field on mesh `on` to one or more target
|
|
25
|
+
* meshes, given as flat pairs `[on index, on generation, to index, to
|
|
26
|
+
* generation, ...]`, and returns its raw id. `sign` is 0 (auto), 1
|
|
27
|
+
* (pseudonormal) or 2 (winding).
|
|
28
|
+
* @param {string} name
|
|
29
|
+
* @param {Uint32Array} on_to
|
|
30
|
+
* @param {number} max_distance
|
|
31
|
+
* @param {number} sign
|
|
32
|
+
* @returns {number}
|
|
33
|
+
*/
|
|
34
|
+
add_distance_field(name, on_to, max_distance, sign) {
|
|
35
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
36
|
+
const len0 = WASM_VECTOR_LEN;
|
|
37
|
+
const ptr1 = passArray32ToWasm0(on_to, wasm.__wbindgen_malloc);
|
|
38
|
+
const len1 = WASM_VECTOR_LEN;
|
|
39
|
+
const ret = wasm.wasmscene_add_distance_field(this.__wbg_ptr, ptr0, len0, ptr1, len1, max_distance, sign);
|
|
40
|
+
if (ret[2]) {
|
|
41
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
42
|
+
}
|
|
43
|
+
return ret[0] >>> 0;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* [`WasmScene::add_distance_field`] computing nothing yet: the field is
|
|
47
|
+
* due until stepped or updated; see
|
|
48
|
+
* [`Scene::add_distance_field_deferred`].
|
|
49
|
+
* @param {string} name
|
|
50
|
+
* @param {Uint32Array} on_to
|
|
51
|
+
* @param {number} max_distance
|
|
52
|
+
* @param {number} sign
|
|
53
|
+
* @returns {number}
|
|
54
|
+
*/
|
|
55
|
+
add_distance_field_deferred(name, on_to, max_distance, sign) {
|
|
56
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
57
|
+
const len0 = WASM_VECTOR_LEN;
|
|
58
|
+
const ptr1 = passArray32ToWasm0(on_to, wasm.__wbindgen_malloc);
|
|
59
|
+
const len1 = WASM_VECTOR_LEN;
|
|
60
|
+
const ret = wasm.wasmscene_add_distance_field_deferred(this.__wbg_ptr, ptr0, len0, ptr1, len1, max_distance, sign);
|
|
61
|
+
if (ret[2]) {
|
|
62
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
63
|
+
}
|
|
64
|
+
return ret[0] >>> 0;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Adds a mesh from world positions and returns `[index, generation]`.
|
|
68
|
+
* Positions are stored as `p - origin` in `f32`; without `origin` it
|
|
69
|
+
* is the bounding-box centre. `mode` is 0 (Eager), 1 (Lazy) or 2
|
|
70
|
+
* (Manual); `normals` turns vertex normals on. The placement starts as
|
|
71
|
+
* the identity. Nothing is added on error.
|
|
72
|
+
* @param {Float64Array} positions
|
|
73
|
+
* @param {Uint32Array} indices
|
|
74
|
+
* @param {Float64Array | null | undefined} origin
|
|
75
|
+
* @param {number} mode
|
|
76
|
+
* @param {boolean} normals
|
|
77
|
+
* @returns {Uint32Array}
|
|
78
|
+
*/
|
|
79
|
+
add_mesh(positions, indices, origin, mode, normals) {
|
|
80
|
+
const ptr0 = passArrayF64ToWasm0(positions, wasm.__wbindgen_malloc);
|
|
81
|
+
const len0 = WASM_VECTOR_LEN;
|
|
82
|
+
const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
83
|
+
const len1 = WASM_VECTOR_LEN;
|
|
84
|
+
var ptr2 = isLikeNone(origin) ? 0 : passArrayF64ToWasm0(origin, wasm.__wbindgen_malloc);
|
|
85
|
+
var len2 = WASM_VECTOR_LEN;
|
|
86
|
+
const ret = wasm.wasmscene_add_mesh(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, mode, normals);
|
|
87
|
+
if (ret[3]) {
|
|
88
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
89
|
+
}
|
|
90
|
+
var v4 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
91
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
92
|
+
return v4;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Builds about `budget` more units of a mesh being added (see
|
|
96
|
+
* `MeshBuild::step`); `true` once its BVH is built. A failed build is
|
|
97
|
+
* dropped.
|
|
98
|
+
* @param {number} build
|
|
99
|
+
* @param {number} budget
|
|
100
|
+
* @returns {boolean}
|
|
101
|
+
*/
|
|
102
|
+
add_mesh_step(build, budget) {
|
|
103
|
+
const ret = wasm.wasmscene_add_mesh_step(this.__wbg_ptr, build, budget);
|
|
104
|
+
if (ret[2]) {
|
|
105
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
106
|
+
}
|
|
107
|
+
return ret[0] !== 0;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Adds a section cutting `meshes` (flat pairs) with the world plane
|
|
111
|
+
* `[origin xyz, normal xyz]`, and returns its raw id.
|
|
112
|
+
* @param {Float64Array} plane
|
|
113
|
+
* @param {Uint32Array} meshes
|
|
114
|
+
* @param {boolean} fill
|
|
115
|
+
* @returns {number}
|
|
116
|
+
*/
|
|
117
|
+
add_section(plane, meshes, fill) {
|
|
118
|
+
const ptr0 = passArrayF64ToWasm0(plane, wasm.__wbindgen_malloc);
|
|
119
|
+
const len0 = WASM_VECTOR_LEN;
|
|
120
|
+
const ptr1 = passArray32ToWasm0(meshes, wasm.__wbindgen_malloc);
|
|
121
|
+
const len1 = WASM_VECTOR_LEN;
|
|
122
|
+
const ret = wasm.wasmscene_add_section(this.__wbg_ptr, ptr0, len0, ptr1, len1, fill);
|
|
123
|
+
if (ret[2]) {
|
|
124
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
125
|
+
}
|
|
126
|
+
return ret[0] >>> 0;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* A read-only report of the mesh's defects, laid out as in
|
|
130
|
+
* [`crate::edit::encode_analysis`]. `weld_tolerance` (local units,
|
|
131
|
+
* equal to world units) groups coincident vertices; lists with a count
|
|
132
|
+
* keep their first `max_listed` entries. `self_intersection` checks
|
|
133
|
+
* for self-intersection with the mesh's BVH, which is brought up to
|
|
134
|
+
* date first unless the mesh is Manual (then `STALE_BVH` when stale).
|
|
135
|
+
* @param {number} index
|
|
136
|
+
* @param {number} generation
|
|
137
|
+
* @param {number} weld_tolerance
|
|
138
|
+
* @param {boolean} self_intersection
|
|
139
|
+
* @param {number} max_listed
|
|
140
|
+
* @returns {Float64Array}
|
|
141
|
+
*/
|
|
142
|
+
analyze(index, generation, weld_tolerance, self_intersection, max_listed) {
|
|
143
|
+
const ret = wasm.wasmscene_analyze(this.__wbg_ptr, index, generation, weld_tolerance, self_intersection, max_listed);
|
|
144
|
+
if (ret[3]) {
|
|
145
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
146
|
+
}
|
|
147
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
148
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
149
|
+
return v1;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* [`WasmScene::add_mesh`] in steps: starts building the mesh and its
|
|
153
|
+
* BVH outside the scene ([`MeshBuild`]) and returns the build's id, for
|
|
154
|
+
* [`WasmScene::add_mesh_step`] and [`WasmScene::finish_add_mesh`]. The
|
|
155
|
+
* scene is unchanged until the mesh is added.
|
|
156
|
+
* @param {Float64Array} positions
|
|
157
|
+
* @param {Uint32Array} indices
|
|
158
|
+
* @param {Float64Array | null | undefined} origin
|
|
159
|
+
* @param {number} mode
|
|
160
|
+
* @param {boolean} normals
|
|
161
|
+
* @returns {number}
|
|
162
|
+
*/
|
|
163
|
+
begin_add_mesh(positions, indices, origin, mode, normals) {
|
|
164
|
+
const ptr0 = passArrayF64ToWasm0(positions, wasm.__wbindgen_malloc);
|
|
165
|
+
const len0 = WASM_VECTOR_LEN;
|
|
166
|
+
const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
167
|
+
const len1 = WASM_VECTOR_LEN;
|
|
168
|
+
var ptr2 = isLikeNone(origin) ? 0 : passArrayF64ToWasm0(origin, wasm.__wbindgen_malloc);
|
|
169
|
+
var len2 = WASM_VECTOR_LEN;
|
|
170
|
+
const ret = wasm.wasmscene_begin_add_mesh(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, mode, normals);
|
|
171
|
+
if (ret[2]) {
|
|
172
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
173
|
+
}
|
|
174
|
+
return ret[0] >>> 0;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Opens a history step, or one more nesting level of the open one.
|
|
178
|
+
*/
|
|
179
|
+
begin_step() {
|
|
180
|
+
wasm.wasmscene_begin_step(this.__wbg_ptr);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* True if `redo` would redo something.
|
|
184
|
+
* @returns {boolean}
|
|
185
|
+
*/
|
|
186
|
+
can_redo() {
|
|
187
|
+
const ret = wasm.wasmscene_can_redo(this.__wbg_ptr);
|
|
188
|
+
return ret !== 0;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* True if `undo` would undo something.
|
|
192
|
+
* @returns {boolean}
|
|
193
|
+
*/
|
|
194
|
+
can_undo() {
|
|
195
|
+
const ret = wasm.wasmscene_can_undo(this.__wbg_ptr);
|
|
196
|
+
return ret !== 0;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Reverts and discards the open step.
|
|
200
|
+
*/
|
|
201
|
+
cancel_step() {
|
|
202
|
+
const ret = wasm.wasmscene_cancel_step(this.__wbg_ptr);
|
|
203
|
+
if (ret[1]) {
|
|
204
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Stops colouring a mesh. Not recorded in history.
|
|
209
|
+
* @param {number} index
|
|
210
|
+
* @param {number} generation
|
|
211
|
+
*/
|
|
212
|
+
clear_coloring(index, generation) {
|
|
213
|
+
const ret = wasm.wasmscene_clear_coloring(this.__wbg_ptr, index, generation);
|
|
214
|
+
if (ret[1]) {
|
|
215
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Drops every undo and redo step.
|
|
220
|
+
*/
|
|
221
|
+
clear_history() {
|
|
222
|
+
const ret = wasm.wasmscene_clear_history(this.__wbg_ptr);
|
|
223
|
+
if (ret[1]) {
|
|
224
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* The point of the scene nearest to world point `p` within
|
|
229
|
+
* `max_distance`. Empty when none, else `[index, generation, triangle,
|
|
230
|
+
* point xyz, distance]`.
|
|
231
|
+
* @param {Float64Array} p
|
|
232
|
+
* @param {number} max_distance
|
|
233
|
+
* @returns {Float64Array}
|
|
234
|
+
*/
|
|
235
|
+
closest_point(p, max_distance) {
|
|
236
|
+
const ptr0 = passArrayF64ToWasm0(p, wasm.__wbindgen_malloc);
|
|
237
|
+
const len0 = WASM_VECTOR_LEN;
|
|
238
|
+
const ret = wasm.wasmscene_closest_point(this.__wbg_ptr, ptr0, len0, max_distance);
|
|
239
|
+
if (ret[3]) {
|
|
240
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
241
|
+
}
|
|
242
|
+
var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
243
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
244
|
+
return v2;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* [`WasmScene::closest_point`] on one mesh.
|
|
248
|
+
* @param {number} index
|
|
249
|
+
* @param {number} generation
|
|
250
|
+
* @param {Float64Array} p
|
|
251
|
+
* @param {number} max_distance
|
|
252
|
+
* @returns {Float64Array}
|
|
253
|
+
*/
|
|
254
|
+
closest_point_on(index, generation, p, max_distance) {
|
|
255
|
+
const ptr0 = passArrayF64ToWasm0(p, wasm.__wbindgen_malloc);
|
|
256
|
+
const len0 = WASM_VECTOR_LEN;
|
|
257
|
+
const ret = wasm.wasmscene_closest_point_on(this.__wbg_ptr, index, generation, ptr0, len0, max_distance);
|
|
258
|
+
if (ret[3]) {
|
|
259
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
260
|
+
}
|
|
261
|
+
var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
262
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
263
|
+
return v2;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Length of the colours in bytes, 0 when the mesh has no colouring.
|
|
267
|
+
* @param {number} index
|
|
268
|
+
* @param {number} generation
|
|
269
|
+
* @returns {number}
|
|
270
|
+
*/
|
|
271
|
+
colors_len(index, generation) {
|
|
272
|
+
const ret = wasm.wasmscene_colors_len(this.__wbg_ptr, index, generation);
|
|
273
|
+
if (ret[2]) {
|
|
274
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
275
|
+
}
|
|
276
|
+
return ret[0] >>> 0;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Address of the colours (RGBA8, 4 bytes per vertex slot), 0 when the
|
|
280
|
+
* mesh has no colouring.
|
|
281
|
+
* @param {number} index
|
|
282
|
+
* @param {number} generation
|
|
283
|
+
* @returns {number}
|
|
284
|
+
*/
|
|
285
|
+
colors_ptr(index, generation) {
|
|
286
|
+
const ret = wasm.wasmscene_colors_ptr(this.__wbg_ptr, index, generation);
|
|
287
|
+
if (ret[2]) {
|
|
288
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
289
|
+
}
|
|
290
|
+
return ret[0] >>> 0;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Removes the mesh's dead slots and renumbers the rest. Its next change
|
|
294
|
+
* record reports every buffer as "all", with the capacity change; its
|
|
295
|
+
* edits leave the history (placements stay).
|
|
296
|
+
* @param {number} index
|
|
297
|
+
* @param {number} generation
|
|
298
|
+
*/
|
|
299
|
+
compact(index, generation) {
|
|
300
|
+
const ret = wasm.wasmscene_compact(this.__wbg_ptr, index, generation);
|
|
301
|
+
if (ret[1]) {
|
|
302
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Drops a mesh being added in steps (nothing was added).
|
|
307
|
+
* @param {number} build
|
|
308
|
+
*/
|
|
309
|
+
drop_add_mesh(build) {
|
|
310
|
+
wasm.wasmscene_drop_add_mesh(this.__wbg_ptr, build);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Runs an edit op list on a mesh as one transaction: one undo step, and
|
|
314
|
+
* nothing changes when an op fails. `ops` and `values` are laid out as
|
|
315
|
+
* in [`crate::edit`]: `ops` is a `u32` sequence of op codes (0 set
|
|
316
|
+
* positions, 1 add vertices, 2 add triangles, 3 remove triangles, 4
|
|
317
|
+
* remove vertices) with their id lists, whose refs name ids added by
|
|
318
|
+
* earlier ops of the list; `values` holds the world positions, mapped
|
|
319
|
+
* to local with the placement inverse and the origin in `f64`, then
|
|
320
|
+
* stored as `f32`. Returns `[n, id × n]` per op: the new vertex or
|
|
321
|
+
* triangle ids, none for the other ops. The list is decoded and every
|
|
322
|
+
* ref checked before the mesh is touched.
|
|
323
|
+
* @param {number} index
|
|
324
|
+
* @param {number} generation
|
|
325
|
+
* @param {Uint32Array} ops
|
|
326
|
+
* @param {Float64Array} values
|
|
327
|
+
* @returns {Uint32Array}
|
|
328
|
+
*/
|
|
329
|
+
edit(index, generation, ops, values) {
|
|
330
|
+
const ptr0 = passArray32ToWasm0(ops, wasm.__wbindgen_malloc);
|
|
331
|
+
const len0 = WASM_VECTOR_LEN;
|
|
332
|
+
const ptr1 = passArrayF64ToWasm0(values, wasm.__wbindgen_malloc);
|
|
333
|
+
const len1 = WASM_VECTOR_LEN;
|
|
334
|
+
const ret = wasm.wasmscene_edit(this.__wbg_ptr, index, generation, ptr0, len0, ptr1, len1);
|
|
335
|
+
if (ret[3]) {
|
|
336
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
337
|
+
}
|
|
338
|
+
var v3 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
339
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
340
|
+
return v3;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Ends one nesting level of the open step.
|
|
344
|
+
*/
|
|
345
|
+
end_step() {
|
|
346
|
+
const ret = wasm.wasmscene_end_step(this.__wbg_ptr);
|
|
347
|
+
if (ret[1]) {
|
|
348
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* A copy of the field's nearest-target indices, one per value (see
|
|
353
|
+
* [`Scene::field_nearest`]): `u32::MAX` for none, including slots
|
|
354
|
+
* added since the field's last update.
|
|
355
|
+
* @param {number} field
|
|
356
|
+
* @returns {Uint32Array}
|
|
357
|
+
*/
|
|
358
|
+
field_nearest(field) {
|
|
359
|
+
const ret = wasm.wasmscene_field_nearest(this.__wbg_ptr, field);
|
|
360
|
+
if (ret[3]) {
|
|
361
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
362
|
+
}
|
|
363
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
364
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
365
|
+
return v1;
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* `[current (0/1), sign mode (1 pseudonormal, 2 winding), closed,
|
|
369
|
+
* consistent orientation, non-manifold vertices, degenerate
|
|
370
|
+
* triangles]`, the sign part over every target together (see
|
|
371
|
+
* [`fast_mesh_scene::FieldStatus::sign`]).
|
|
372
|
+
* @param {number} field
|
|
373
|
+
* @returns {Uint32Array}
|
|
374
|
+
*/
|
|
375
|
+
field_status(field) {
|
|
376
|
+
const ret = wasm.wasmscene_field_status(this.__wbg_ptr, field);
|
|
377
|
+
if (ret[3]) {
|
|
378
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
379
|
+
}
|
|
380
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
381
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
382
|
+
return v1;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Computes up to `points` candidate vertices of the due Eager fields,
|
|
386
|
+
* opening a unit first if none is open; see [`Scene::field_step`].
|
|
387
|
+
* Returns 0 (idle: nothing was due), 1 (pending) or 2 (done: the unit
|
|
388
|
+
* was applied). An error also ends the unit: the fields that could be
|
|
389
|
+
* applied were.
|
|
390
|
+
* @param {number} points
|
|
391
|
+
* @returns {number}
|
|
392
|
+
*/
|
|
393
|
+
field_step(points) {
|
|
394
|
+
const ret = wasm.wasmscene_field_step(this.__wbg_ptr, points);
|
|
395
|
+
if (ret[2]) {
|
|
396
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
397
|
+
}
|
|
398
|
+
return ret[0];
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* [`WasmScene::field_step`] for one field alone; see
|
|
402
|
+
* [`Scene::field_step_field`]. Returns 0 (idle: the field is current),
|
|
403
|
+
* 1 (pending) or 2 (done).
|
|
404
|
+
* @param {number} field
|
|
405
|
+
* @param {number} points
|
|
406
|
+
* @returns {number}
|
|
407
|
+
*/
|
|
408
|
+
field_step_field(field, points) {
|
|
409
|
+
const ret = wasm.wasmscene_field_step_field(this.__wbg_ptr, field, points);
|
|
410
|
+
if (ret[2]) {
|
|
411
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
412
|
+
}
|
|
413
|
+
return ret[0];
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* The meshes of the open step unit's fields as flat `[index,
|
|
417
|
+
* generation, ...]` pairs, each once; empty when no unit is open.
|
|
418
|
+
* @returns {Uint32Array}
|
|
419
|
+
*/
|
|
420
|
+
field_step_meshes() {
|
|
421
|
+
const ret = wasm.wasmscene_field_step_meshes(this.__wbg_ptr);
|
|
422
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
423
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
424
|
+
return v1;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* What the sign data found out about each target, in index order: five
|
|
428
|
+
* numbers per target, `[mode, closed, consistent orientation,
|
|
429
|
+
* non-manifold vertices, degenerate triangles]` as in
|
|
430
|
+
* [`WasmScene::field_status`].
|
|
431
|
+
* @param {number} field
|
|
432
|
+
* @returns {Uint32Array}
|
|
433
|
+
*/
|
|
434
|
+
field_target_status(field) {
|
|
435
|
+
const ret = wasm.wasmscene_field_target_status(this.__wbg_ptr, field);
|
|
436
|
+
if (ret[3]) {
|
|
437
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
438
|
+
}
|
|
439
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
440
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
441
|
+
return v1;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* The field's target meshes as flat `[index, generation, ...]` pairs,
|
|
445
|
+
* in target index order (see [`Scene::field_targets`]).
|
|
446
|
+
* @param {number} field
|
|
447
|
+
* @returns {Uint32Array}
|
|
448
|
+
*/
|
|
449
|
+
field_targets(field) {
|
|
450
|
+
const ret = wasm.wasmscene_field_targets(this.__wbg_ptr, field);
|
|
451
|
+
if (ret[3]) {
|
|
452
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
453
|
+
}
|
|
454
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
455
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
456
|
+
return v1;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Length of the field's values in `f32`s.
|
|
460
|
+
* @param {number} field
|
|
461
|
+
* @returns {number}
|
|
462
|
+
*/
|
|
463
|
+
field_values_len(field) {
|
|
464
|
+
const ret = wasm.wasmscene_field_values_len(this.__wbg_ptr, field);
|
|
465
|
+
if (ret[2]) {
|
|
466
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
467
|
+
}
|
|
468
|
+
return ret[0] >>> 0;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Address of the field's values (`f32`, one per vertex slot of its
|
|
472
|
+
* mesh).
|
|
473
|
+
* @param {number} field
|
|
474
|
+
* @returns {number}
|
|
475
|
+
*/
|
|
476
|
+
field_values_ptr(field) {
|
|
477
|
+
const ret = wasm.wasmscene_field_values_ptr(this.__wbg_ptr, field);
|
|
478
|
+
if (ret[2]) {
|
|
479
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
480
|
+
}
|
|
481
|
+
return ret[0] >>> 0;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* The mesh pairs within `margin` of each other, of `pairs` (flat
|
|
485
|
+
* `[a index, a generation, b index, b generation, ...]`) or of the
|
|
486
|
+
* whole scene. `[count, contact...]`, each contact `[a index, a
|
|
487
|
+
* generation, b index, b generation, intersecting (0/1), distance,
|
|
488
|
+
* triangle count of a, of b, triangles of a..., triangles of b...]`.
|
|
489
|
+
* @param {number} margin
|
|
490
|
+
* @param {Uint32Array | null} [pairs]
|
|
491
|
+
* @returns {Float64Array}
|
|
492
|
+
*/
|
|
493
|
+
find_contacts(margin, pairs) {
|
|
494
|
+
var ptr0 = isLikeNone(pairs) ? 0 : passArray32ToWasm0(pairs, wasm.__wbindgen_malloc);
|
|
495
|
+
var len0 = WASM_VECTOR_LEN;
|
|
496
|
+
const ret = wasm.wasmscene_find_contacts(this.__wbg_ptr, margin, ptr0, len0);
|
|
497
|
+
if (ret[3]) {
|
|
498
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
499
|
+
}
|
|
500
|
+
var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
501
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
502
|
+
return v2;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Adds a mesh built in steps, finishing what is left of its BVH, and
|
|
506
|
+
* returns `[index, generation]`, as [`WasmScene::add_mesh`] would.
|
|
507
|
+
* @param {number} build
|
|
508
|
+
* @returns {Uint32Array}
|
|
509
|
+
*/
|
|
510
|
+
finish_add_mesh(build) {
|
|
511
|
+
const ret = wasm.wasmscene_finish_add_mesh(this.__wbg_ptr, build);
|
|
512
|
+
if (ret[3]) {
|
|
513
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
514
|
+
}
|
|
515
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
516
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
517
|
+
return v1;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Brings every non-Manual mesh up to date.
|
|
521
|
+
*/
|
|
522
|
+
flush() {
|
|
523
|
+
const ret = wasm.wasmscene_flush(this.__wbg_ptr);
|
|
524
|
+
if (ret[1]) {
|
|
525
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Length of the index buffer in `u32`s.
|
|
530
|
+
* @param {number} index
|
|
531
|
+
* @param {number} generation
|
|
532
|
+
* @returns {number}
|
|
533
|
+
*/
|
|
534
|
+
indices_len(index, generation) {
|
|
535
|
+
const ret = wasm.wasmscene_indices_len(this.__wbg_ptr, index, generation);
|
|
536
|
+
if (ret[2]) {
|
|
537
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
538
|
+
}
|
|
539
|
+
return ret[0] >>> 0;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Address of the index buffer (`u32`, 3 per triangle slot; a removed
|
|
543
|
+
* triangle reads `0, 0, 0`).
|
|
544
|
+
* @param {number} index
|
|
545
|
+
* @param {number} generation
|
|
546
|
+
* @returns {number}
|
|
547
|
+
*/
|
|
548
|
+
indices_ptr(index, generation) {
|
|
549
|
+
const ret = wasm.wasmscene_indices_ptr(this.__wbg_ptr, index, generation);
|
|
550
|
+
if (ret[2]) {
|
|
551
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
552
|
+
}
|
|
553
|
+
return ret[0] >>> 0;
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Whether two meshes intersect or touch as placed.
|
|
557
|
+
* @param {number} a_index
|
|
558
|
+
* @param {number} a_generation
|
|
559
|
+
* @param {number} b_index
|
|
560
|
+
* @param {number} b_generation
|
|
561
|
+
* @returns {boolean}
|
|
562
|
+
*/
|
|
563
|
+
intersects(a_index, a_generation, b_index, b_generation) {
|
|
564
|
+
const ret = wasm.wasmscene_intersects(this.__wbg_ptr, a_index, a_generation, b_index, b_generation);
|
|
565
|
+
if (ret[2]) {
|
|
566
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
567
|
+
}
|
|
568
|
+
return ret[0] !== 0;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* The world matrix of the local render coordinates,
|
|
572
|
+
* `placement · translate(origin)`, column-major (16 values).
|
|
573
|
+
* @param {number} index
|
|
574
|
+
* @param {number} generation
|
|
575
|
+
* @returns {Float64Array}
|
|
576
|
+
*/
|
|
577
|
+
matrix4(index, generation) {
|
|
578
|
+
const ret = wasm.wasmscene_matrix4(this.__wbg_ptr, index, generation);
|
|
579
|
+
if (ret[3]) {
|
|
580
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
581
|
+
}
|
|
582
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
583
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
584
|
+
return v1;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* The distance between two meshes' surfaces as placed. Empty when it
|
|
588
|
+
* exceeds `max_distance` or a mesh has no triangle, else `[distance,
|
|
589
|
+
* point on a xyz, point on b xyz, triangle of a, triangle of b]`.
|
|
590
|
+
* @param {number} a_index
|
|
591
|
+
* @param {number} a_generation
|
|
592
|
+
* @param {number} b_index
|
|
593
|
+
* @param {number} b_generation
|
|
594
|
+
* @param {number} max_distance
|
|
595
|
+
* @returns {Float64Array}
|
|
596
|
+
*/
|
|
597
|
+
mesh_distance(a_index, a_generation, b_index, b_generation, max_distance) {
|
|
598
|
+
const ret = wasm.wasmscene_mesh_distance(this.__wbg_ptr, a_index, a_generation, b_index, b_generation, max_distance);
|
|
599
|
+
if (ret[3]) {
|
|
600
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
601
|
+
}
|
|
602
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
603
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
604
|
+
return v1;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* An empty scene with the default history budget.
|
|
608
|
+
*/
|
|
609
|
+
constructor() {
|
|
610
|
+
const ret = wasm.wasmscene_new();
|
|
611
|
+
this.__wbg_ptr = ret;
|
|
612
|
+
WasmSceneFinalization.register(this, this.__wbg_ptr, this);
|
|
613
|
+
return this;
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Length of the normals in `f32`s, 0 when they are off. After the
|
|
617
|
+
* scene ran out of memory it may differ from 3 · vertex slots until
|
|
618
|
+
* the next successful update.
|
|
619
|
+
* @param {number} index
|
|
620
|
+
* @param {number} generation
|
|
621
|
+
* @returns {number}
|
|
622
|
+
*/
|
|
623
|
+
normals_len(index, generation) {
|
|
624
|
+
const ret = wasm.wasmscene_normals_len(this.__wbg_ptr, index, generation);
|
|
625
|
+
if (ret[2]) {
|
|
626
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
627
|
+
}
|
|
628
|
+
return ret[0] >>> 0;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Address of the normals (`f32`, 3 per vertex slot), 0 when they are
|
|
632
|
+
* off.
|
|
633
|
+
* @param {number} index
|
|
634
|
+
* @param {number} generation
|
|
635
|
+
* @returns {number}
|
|
636
|
+
*/
|
|
637
|
+
normals_ptr(index, generation) {
|
|
638
|
+
const ret = wasm.wasmscene_normals_ptr(this.__wbg_ptr, index, generation);
|
|
639
|
+
if (ret[2]) {
|
|
640
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
641
|
+
}
|
|
642
|
+
return ret[0] >>> 0;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* The placement: the row-major rotation (9 values), then the
|
|
646
|
+
* translation (3 values).
|
|
647
|
+
* @param {number} index
|
|
648
|
+
* @param {number} generation
|
|
649
|
+
* @returns {Float64Array}
|
|
650
|
+
*/
|
|
651
|
+
placement(index, generation) {
|
|
652
|
+
const ret = wasm.wasmscene_placement(this.__wbg_ptr, index, generation);
|
|
653
|
+
if (ret[3]) {
|
|
654
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
655
|
+
}
|
|
656
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
657
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
658
|
+
return v1;
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Length of the positions in `f32`s.
|
|
662
|
+
* @param {number} index
|
|
663
|
+
* @param {number} generation
|
|
664
|
+
* @returns {number}
|
|
665
|
+
*/
|
|
666
|
+
positions_len(index, generation) {
|
|
667
|
+
const ret = wasm.wasmscene_positions_len(this.__wbg_ptr, index, generation);
|
|
668
|
+
if (ret[2]) {
|
|
669
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
670
|
+
}
|
|
671
|
+
return ret[0] >>> 0;
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Address of the local positions (`f32`, 3 per vertex slot).
|
|
675
|
+
* @param {number} index
|
|
676
|
+
* @param {number} generation
|
|
677
|
+
* @returns {number}
|
|
678
|
+
*/
|
|
679
|
+
positions_ptr(index, generation) {
|
|
680
|
+
const ret = wasm.wasmscene_positions_ptr(this.__wbg_ptr, index, generation);
|
|
681
|
+
if (ret[2]) {
|
|
682
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
683
|
+
}
|
|
684
|
+
return ret[0] >>> 0;
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* The nearest hit of a world ray over every mesh with
|
|
688
|
+
* `min_distance <= t <= max_distance`; `cull` is 0 (none), 1 (back
|
|
689
|
+
* faces) or 2 (front faces). Empty on a miss, else `[index,
|
|
690
|
+
* generation, triangle, point xyz, distance, barycentric uvw]`.
|
|
691
|
+
* @param {Float64Array} origin
|
|
692
|
+
* @param {Float64Array} direction
|
|
693
|
+
* @param {number} min_distance
|
|
694
|
+
* @param {number} max_distance
|
|
695
|
+
* @param {number} cull
|
|
696
|
+
* @returns {Float64Array}
|
|
697
|
+
*/
|
|
698
|
+
raycast(origin, direction, min_distance, max_distance, cull) {
|
|
699
|
+
const ptr0 = passArrayF64ToWasm0(origin, wasm.__wbindgen_malloc);
|
|
700
|
+
const len0 = WASM_VECTOR_LEN;
|
|
701
|
+
const ptr1 = passArrayF64ToWasm0(direction, wasm.__wbindgen_malloc);
|
|
702
|
+
const len1 = WASM_VECTOR_LEN;
|
|
703
|
+
const ret = wasm.wasmscene_raycast(this.__wbg_ptr, ptr0, len0, ptr1, len1, min_distance, max_distance, cull);
|
|
704
|
+
if (ret[3]) {
|
|
705
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
706
|
+
}
|
|
707
|
+
var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
708
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
709
|
+
return v3;
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Redoes the latest undone step; false when there is nothing to redo.
|
|
713
|
+
* @returns {boolean}
|
|
714
|
+
*/
|
|
715
|
+
redo() {
|
|
716
|
+
const ret = wasm.wasmscene_redo(this.__wbg_ptr);
|
|
717
|
+
if (ret[2]) {
|
|
718
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
719
|
+
}
|
|
720
|
+
return ret[0] !== 0;
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* Removes a field (and a colouring by it).
|
|
724
|
+
* @param {number} field
|
|
725
|
+
*/
|
|
726
|
+
remove_field(field) {
|
|
727
|
+
const ret = wasm.wasmscene_remove_field(this.__wbg_ptr, field);
|
|
728
|
+
if (ret[1]) {
|
|
729
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* Removes a mesh; its id never matches again.
|
|
734
|
+
* @param {number} index
|
|
735
|
+
* @param {number} generation
|
|
736
|
+
*/
|
|
737
|
+
remove_mesh(index, generation) {
|
|
738
|
+
const ret = wasm.wasmscene_remove_mesh(this.__wbg_ptr, index, generation);
|
|
739
|
+
if (ret[1]) {
|
|
740
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Removes a section.
|
|
745
|
+
* @param {number} section
|
|
746
|
+
*/
|
|
747
|
+
remove_section(section) {
|
|
748
|
+
const ret = wasm.wasmscene_remove_section(this.__wbg_ptr, section);
|
|
749
|
+
if (ret[1]) {
|
|
750
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Runs repair operations on a mesh, in order, in one transaction: one
|
|
755
|
+
* undo step, and nothing changes when an operation fails. `ops` (`f64`)
|
|
756
|
+
* and `loops` (`u32`, loop ids for fill holes) are laid out as in
|
|
757
|
+
* [`crate::edit`]; returns the reports concatenated in op order.
|
|
758
|
+
* Lengths and areas in the options are in local units, equal to world
|
|
759
|
+
* units.
|
|
760
|
+
* @param {number} index
|
|
761
|
+
* @param {number} generation
|
|
762
|
+
* @param {Float64Array} ops
|
|
763
|
+
* @param {Uint32Array} loops
|
|
764
|
+
* @returns {Float64Array}
|
|
765
|
+
*/
|
|
766
|
+
repair(index, generation, ops, loops) {
|
|
767
|
+
const ptr0 = passArrayF64ToWasm0(ops, wasm.__wbindgen_malloc);
|
|
768
|
+
const len0 = WASM_VECTOR_LEN;
|
|
769
|
+
const ptr1 = passArray32ToWasm0(loops, wasm.__wbindgen_malloc);
|
|
770
|
+
const len1 = WASM_VECTOR_LEN;
|
|
771
|
+
const ret = wasm.wasmscene_repair(this.__wbg_ptr, index, generation, ptr0, len0, ptr1, len1);
|
|
772
|
+
if (ret[3]) {
|
|
773
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
774
|
+
}
|
|
775
|
+
var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
776
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
777
|
+
return v3;
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* A section's result for a mesh, in world coordinates: `[status (0
|
|
781
|
+
* current, 1 stale), length, area, contour count, contour..., has fill
|
|
782
|
+
* (0/1), fill]`. Each contour is `[closed (0/1), point count, xyz...]`;
|
|
783
|
+
* the fill is `[point count, xyz..., triangle count, abc...]`.
|
|
784
|
+
* @param {number} section
|
|
785
|
+
* @param {number} index
|
|
786
|
+
* @param {number} generation
|
|
787
|
+
* @returns {Float64Array}
|
|
788
|
+
*/
|
|
789
|
+
section(section, index, generation) {
|
|
790
|
+
const ret = wasm.wasmscene_section(this.__wbg_ptr, section, index, generation);
|
|
791
|
+
if (ret[3]) {
|
|
792
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
793
|
+
}
|
|
794
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
795
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
796
|
+
return v1;
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* A section's plane as last set, `[origin xyz, normal xyz]`, the normal
|
|
800
|
+
* normalised.
|
|
801
|
+
* @param {number} section
|
|
802
|
+
* @returns {Float64Array}
|
|
803
|
+
*/
|
|
804
|
+
section_desc_plane(section) {
|
|
805
|
+
const ret = wasm.wasmscene_section_desc_plane(this.__wbg_ptr, section);
|
|
806
|
+
if (ret[3]) {
|
|
807
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
808
|
+
}
|
|
809
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
810
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
811
|
+
return v1;
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* The closest pair between two meshes' contours in a section. Empty
|
|
815
|
+
* when there is none, else `[distance, point on a xyz, point on b
|
|
816
|
+
* xyz]`.
|
|
817
|
+
* @param {number} section
|
|
818
|
+
* @param {number} a_index
|
|
819
|
+
* @param {number} a_generation
|
|
820
|
+
* @param {number} b_index
|
|
821
|
+
* @param {number} b_generation
|
|
822
|
+
* @returns {Float64Array}
|
|
823
|
+
*/
|
|
824
|
+
section_gap(section, a_index, a_generation, b_index, b_generation) {
|
|
825
|
+
const ret = wasm.wasmscene_section_gap(this.__wbg_ptr, section, a_index, a_generation, b_index, b_generation);
|
|
826
|
+
if (ret[3]) {
|
|
827
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
828
|
+
}
|
|
829
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
830
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
831
|
+
return v1;
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Colours a mesh from one of its fields; see [`parse_rule`] for `map`
|
|
835
|
+
* and `rule`. A display setting: not recorded in history.
|
|
836
|
+
* @param {number} index
|
|
837
|
+
* @param {number} generation
|
|
838
|
+
* @param {number} field
|
|
839
|
+
* @param {number} map
|
|
840
|
+
* @param {Float32Array} rule
|
|
841
|
+
*/
|
|
842
|
+
set_coloring(index, generation, field, map, rule) {
|
|
843
|
+
const ptr0 = passArrayF32ToWasm0(rule, wasm.__wbindgen_malloc);
|
|
844
|
+
const len0 = WASM_VECTOR_LEN;
|
|
845
|
+
const ret = wasm.wasmscene_set_coloring(this.__wbg_ptr, index, generation, field, map, ptr0, len0);
|
|
846
|
+
if (ret[1]) {
|
|
847
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* Defers Eager field updates to [`WasmScene::field_step`]; see
|
|
852
|
+
* [`Scene::set_defer_fields`].
|
|
853
|
+
* @param {boolean} on
|
|
854
|
+
*/
|
|
855
|
+
set_defer_fields(on) {
|
|
856
|
+
wasm.wasmscene_set_defer_fields(this.__wbg_ptr, on);
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Sets when the mesh's BVH, normals, fields and sections follow its
|
|
860
|
+
* edits: 0 (Eager), 1 (Lazy) or 2 (Manual).
|
|
861
|
+
* @param {number} index
|
|
862
|
+
* @param {number} generation
|
|
863
|
+
* @param {number} mode
|
|
864
|
+
*/
|
|
865
|
+
set_mode(index, generation, mode) {
|
|
866
|
+
const ret = wasm.wasmscene_set_mode(this.__wbg_ptr, index, generation, mode);
|
|
867
|
+
if (ret[1]) {
|
|
868
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Sets the placement from a row-major rotation (9 values) and a
|
|
873
|
+
* translation (3 values). The rotation must be a proper rotation.
|
|
874
|
+
* @param {number} index
|
|
875
|
+
* @param {number} generation
|
|
876
|
+
* @param {Float64Array} rotation
|
|
877
|
+
* @param {Float64Array} translation
|
|
878
|
+
*/
|
|
879
|
+
set_placement(index, generation, rotation, translation) {
|
|
880
|
+
const ptr0 = passArrayF64ToWasm0(rotation, wasm.__wbindgen_malloc);
|
|
881
|
+
const len0 = WASM_VECTOR_LEN;
|
|
882
|
+
const ptr1 = passArrayF64ToWasm0(translation, wasm.__wbindgen_malloc);
|
|
883
|
+
const len1 = WASM_VECTOR_LEN;
|
|
884
|
+
const ret = wasm.wasmscene_set_placement(this.__wbg_ptr, index, generation, ptr0, len0, ptr1, len1);
|
|
885
|
+
if (ret[1]) {
|
|
886
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Turns a section's fill on or off.
|
|
891
|
+
* @param {number} section
|
|
892
|
+
* @param {boolean} fill
|
|
893
|
+
*/
|
|
894
|
+
set_section_fill(section, fill) {
|
|
895
|
+
const ret = wasm.wasmscene_set_section_fill(this.__wbg_ptr, section, fill);
|
|
896
|
+
if (ret[1]) {
|
|
897
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* Changes the meshes a section cuts (flat pairs).
|
|
902
|
+
* @param {number} section
|
|
903
|
+
* @param {Uint32Array} meshes
|
|
904
|
+
*/
|
|
905
|
+
set_section_meshes(section, meshes) {
|
|
906
|
+
const ptr0 = passArray32ToWasm0(meshes, wasm.__wbindgen_malloc);
|
|
907
|
+
const len0 = WASM_VECTOR_LEN;
|
|
908
|
+
const ret = wasm.wasmscene_set_section_meshes(this.__wbg_ptr, section, ptr0, len0);
|
|
909
|
+
if (ret[1]) {
|
|
910
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* Moves a section's plane, `[origin xyz, normal xyz]`.
|
|
915
|
+
* @param {number} section
|
|
916
|
+
* @param {Float64Array} plane
|
|
917
|
+
*/
|
|
918
|
+
set_section_plane(section, plane) {
|
|
919
|
+
const ptr0 = passArrayF64ToWasm0(plane, wasm.__wbindgen_malloc);
|
|
920
|
+
const len0 = WASM_VECTOR_LEN;
|
|
921
|
+
const ret = wasm.wasmscene_set_section_plane(this.__wbg_ptr, section, ptr0, len0);
|
|
922
|
+
if (ret[1]) {
|
|
923
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* Everything that changed since the last call, as one message in the
|
|
928
|
+
* format of [`crate::render`]: `[record_count, record...]`.
|
|
929
|
+
* @returns {Uint32Array}
|
|
930
|
+
*/
|
|
931
|
+
take_changes() {
|
|
932
|
+
const ret = wasm.wasmscene_take_changes(this.__wbg_ptr);
|
|
933
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
934
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
935
|
+
return v1;
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* Alive triangles.
|
|
939
|
+
* @param {number} index
|
|
940
|
+
* @param {number} generation
|
|
941
|
+
* @returns {number}
|
|
942
|
+
*/
|
|
943
|
+
triangle_count(index, generation) {
|
|
944
|
+
const ret = wasm.wasmscene_triangle_count(this.__wbg_ptr, index, generation);
|
|
945
|
+
if (ret[2]) {
|
|
946
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
947
|
+
}
|
|
948
|
+
return ret[0] >>> 0;
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* Triangle slots, alive or dead: the length of the index buffer.
|
|
952
|
+
* @param {number} index
|
|
953
|
+
* @param {number} generation
|
|
954
|
+
* @returns {number}
|
|
955
|
+
*/
|
|
956
|
+
triangle_slots(index, generation) {
|
|
957
|
+
const ret = wasm.wasmscene_triangle_slots(this.__wbg_ptr, index, generation);
|
|
958
|
+
if (ret[2]) {
|
|
959
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
960
|
+
}
|
|
961
|
+
return ret[0] >>> 0;
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* Undoes the latest step; false when there is nothing to undo.
|
|
965
|
+
* @returns {boolean}
|
|
966
|
+
*/
|
|
967
|
+
undo() {
|
|
968
|
+
const ret = wasm.wasmscene_undo(this.__wbg_ptr);
|
|
969
|
+
if (ret[2]) {
|
|
970
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
971
|
+
}
|
|
972
|
+
return ret[0] !== 0;
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Brings the mesh's BVH, normals, fields and sections up to date now.
|
|
976
|
+
* @param {number} index
|
|
977
|
+
* @param {number} generation
|
|
978
|
+
*/
|
|
979
|
+
update(index, generation) {
|
|
980
|
+
const ret = wasm.wasmscene_update(this.__wbg_ptr, index, generation);
|
|
981
|
+
if (ret[1]) {
|
|
982
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Computes every stale section entry.
|
|
987
|
+
*/
|
|
988
|
+
update_sections() {
|
|
989
|
+
const ret = wasm.wasmscene_update_sections(this.__wbg_ptr);
|
|
990
|
+
if (ret[1]) {
|
|
991
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* Length of the colour values in `f32`s, 0 when the mesh has no
|
|
996
|
+
* colouring.
|
|
997
|
+
* @param {number} index
|
|
998
|
+
* @param {number} generation
|
|
999
|
+
* @returns {number}
|
|
1000
|
+
*/
|
|
1001
|
+
values_len(index, generation) {
|
|
1002
|
+
const ret = wasm.wasmscene_values_len(this.__wbg_ptr, index, generation);
|
|
1003
|
+
if (ret[2]) {
|
|
1004
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1005
|
+
}
|
|
1006
|
+
return ret[0] >>> 0;
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Address of the values the colours are made from (`f32`, 1 per vertex
|
|
1010
|
+
* slot: the colouring field's channel), 0 when the mesh has no
|
|
1011
|
+
* colouring. They change only at the colours' dirty slots.
|
|
1012
|
+
* @param {number} index
|
|
1013
|
+
* @param {number} generation
|
|
1014
|
+
* @returns {number}
|
|
1015
|
+
*/
|
|
1016
|
+
values_ptr(index, generation) {
|
|
1017
|
+
const ret = wasm.wasmscene_values_ptr(this.__wbg_ptr, index, generation);
|
|
1018
|
+
if (ret[2]) {
|
|
1019
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1020
|
+
}
|
|
1021
|
+
return ret[0] >>> 0;
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
* Alive vertices.
|
|
1025
|
+
* @param {number} index
|
|
1026
|
+
* @param {number} generation
|
|
1027
|
+
* @returns {number}
|
|
1028
|
+
*/
|
|
1029
|
+
vertex_count(index, generation) {
|
|
1030
|
+
const ret = wasm.wasmscene_vertex_count(this.__wbg_ptr, index, generation);
|
|
1031
|
+
if (ret[2]) {
|
|
1032
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1033
|
+
}
|
|
1034
|
+
return ret[0] >>> 0;
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Vertex slots, alive or dead: the length of the vertex buffers.
|
|
1038
|
+
* @param {number} index
|
|
1039
|
+
* @param {number} generation
|
|
1040
|
+
* @returns {number}
|
|
1041
|
+
*/
|
|
1042
|
+
vertex_slots(index, generation) {
|
|
1043
|
+
const ret = wasm.wasmscene_vertex_slots(this.__wbg_ptr, index, generation);
|
|
1044
|
+
if (ret[2]) {
|
|
1045
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1046
|
+
}
|
|
1047
|
+
return ret[0] >>> 0;
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Removes a field never computed, reporting nothing; `false` (nothing
|
|
1051
|
+
* done) when it was computed or colours its mesh. See
|
|
1052
|
+
* [`Scene::withdraw_field`].
|
|
1053
|
+
* @param {number} field
|
|
1054
|
+
* @returns {boolean}
|
|
1055
|
+
*/
|
|
1056
|
+
withdraw_field(field) {
|
|
1057
|
+
const ret = wasm.wasmscene_withdraw_field(this.__wbg_ptr, field);
|
|
1058
|
+
if (ret[2]) {
|
|
1059
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1060
|
+
}
|
|
1061
|
+
return ret[0] !== 0;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
if (Symbol.dispose) WasmScene.prototype[Symbol.dispose] = WasmScene.prototype.free;
|
|
1065
|
+
|
|
3
1066
|
/**
|
|
4
1067
|
* Axis-aligned bounding box as six floats: `[minX, minY, minZ, maxX, maxY, maxZ]`.
|
|
5
1068
|
*
|
|
@@ -45,6 +1108,9 @@ function __wbg_get_imports() {
|
|
|
45
1108
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
46
1109
|
return ret;
|
|
47
1110
|
},
|
|
1111
|
+
__wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
|
|
1112
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1113
|
+
},
|
|
48
1114
|
__wbindgen_init_externref_table: function() {
|
|
49
1115
|
const table = wasm.__wbindgen_externrefs;
|
|
50
1116
|
const offset = table.grow(4);
|
|
@@ -61,11 +1127,25 @@ function __wbg_get_imports() {
|
|
|
61
1127
|
};
|
|
62
1128
|
}
|
|
63
1129
|
|
|
1130
|
+
const WasmSceneFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1131
|
+
? { register: () => {}, unregister: () => {} }
|
|
1132
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmscene_free(ptr, 1));
|
|
1133
|
+
|
|
64
1134
|
function getArrayF32FromWasm0(ptr, len) {
|
|
65
1135
|
ptr = ptr >>> 0;
|
|
66
1136
|
return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
67
1137
|
}
|
|
68
1138
|
|
|
1139
|
+
function getArrayF64FromWasm0(ptr, len) {
|
|
1140
|
+
ptr = ptr >>> 0;
|
|
1141
|
+
return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
1145
|
+
ptr = ptr >>> 0;
|
|
1146
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
1147
|
+
}
|
|
1148
|
+
|
|
69
1149
|
let cachedFloat32ArrayMemory0 = null;
|
|
70
1150
|
function getFloat32ArrayMemory0() {
|
|
71
1151
|
if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
|
|
@@ -74,6 +1154,14 @@ function getFloat32ArrayMemory0() {
|
|
|
74
1154
|
return cachedFloat32ArrayMemory0;
|
|
75
1155
|
}
|
|
76
1156
|
|
|
1157
|
+
let cachedFloat64ArrayMemory0 = null;
|
|
1158
|
+
function getFloat64ArrayMemory0() {
|
|
1159
|
+
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
1160
|
+
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
1161
|
+
}
|
|
1162
|
+
return cachedFloat64ArrayMemory0;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
77
1165
|
function getStringFromWasm0(ptr, len) {
|
|
78
1166
|
return decodeText(ptr >>> 0, len);
|
|
79
1167
|
}
|
|
@@ -94,6 +1182,10 @@ function getUint8ArrayMemory0() {
|
|
|
94
1182
|
return cachedUint8ArrayMemory0;
|
|
95
1183
|
}
|
|
96
1184
|
|
|
1185
|
+
function isLikeNone(x) {
|
|
1186
|
+
return x === undefined || x === null;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
97
1189
|
function passArray32ToWasm0(arg, malloc) {
|
|
98
1190
|
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
99
1191
|
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
@@ -108,6 +1200,50 @@ function passArrayF32ToWasm0(arg, malloc) {
|
|
|
108
1200
|
return ptr;
|
|
109
1201
|
}
|
|
110
1202
|
|
|
1203
|
+
function passArrayF64ToWasm0(arg, malloc) {
|
|
1204
|
+
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
1205
|
+
getFloat64ArrayMemory0().set(arg, ptr / 8);
|
|
1206
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1207
|
+
return ptr;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1211
|
+
if (realloc === undefined) {
|
|
1212
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1213
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1214
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1215
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1216
|
+
return ptr;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
let len = arg.length;
|
|
1220
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1221
|
+
|
|
1222
|
+
const mem = getUint8ArrayMemory0();
|
|
1223
|
+
|
|
1224
|
+
let offset = 0;
|
|
1225
|
+
|
|
1226
|
+
for (; offset < len; offset++) {
|
|
1227
|
+
const code = arg.charCodeAt(offset);
|
|
1228
|
+
if (code > 0x7F) break;
|
|
1229
|
+
mem[ptr + offset] = code;
|
|
1230
|
+
}
|
|
1231
|
+
if (offset !== len) {
|
|
1232
|
+
if (offset !== 0) {
|
|
1233
|
+
arg = arg.slice(offset);
|
|
1234
|
+
}
|
|
1235
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1236
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1237
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1238
|
+
|
|
1239
|
+
offset += ret.written;
|
|
1240
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
WASM_VECTOR_LEN = offset;
|
|
1244
|
+
return ptr;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
111
1247
|
function takeFromExternrefTable0(idx) {
|
|
112
1248
|
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
113
1249
|
wasm.__externref_table_dealloc(idx);
|
|
@@ -128,6 +1264,19 @@ function decodeText(ptr, len) {
|
|
|
128
1264
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
129
1265
|
}
|
|
130
1266
|
|
|
1267
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1268
|
+
|
|
1269
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1270
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1271
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1272
|
+
view.set(buf);
|
|
1273
|
+
return {
|
|
1274
|
+
read: arg.length,
|
|
1275
|
+
written: buf.length
|
|
1276
|
+
};
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
|
|
131
1280
|
let WASM_VECTOR_LEN = 0;
|
|
132
1281
|
|
|
133
1282
|
let wasmModule, wasmInstance, wasm;
|
|
@@ -136,6 +1285,7 @@ function __wbg_finalize_init(instance, module) {
|
|
|
136
1285
|
wasm = instance.exports;
|
|
137
1286
|
wasmModule = module;
|
|
138
1287
|
cachedFloat32ArrayMemory0 = null;
|
|
1288
|
+
cachedFloat64ArrayMemory0 = null;
|
|
139
1289
|
cachedUint32ArrayMemory0 = null;
|
|
140
1290
|
cachedUint8ArrayMemory0 = null;
|
|
141
1291
|
wasm.__wbindgen_start();
|