fast-mesh-wasm 0.5.1 → 0.5.3
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 +45 -3
- package/dist/{client-tP6R9foI.d.ts → client-D7yfPOyU.d.ts} +14 -5
- package/dist/{client-C61Kku4i.js → client-f895H_yB.js} +52 -7
- package/dist/{engine-X1Awlc5y.js → engine-BcJ5W6kS.js} +29 -4
- package/dist/io.d.ts +21 -9
- package/dist/io.js +102 -18
- package/dist/{mesh-D3fv56nF.d.ts → mesh-B3QP93wx.d.ts} +15 -4
- package/dist/{mesh-CWvrjO8S.js → mesh-hPWBQPaN.js} +28 -4
- package/dist/node.d.ts +2 -2
- package/dist/node.js +1 -1
- package/dist/{protocol-BGQAB0op.d.ts → protocol-Dt0zgang.d.ts} +20 -5
- package/dist/r3f.d.ts +3 -3
- package/dist/r3f.js +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/{scene-BnkCS0sv.js → scene-CXtM_bxV.js} +150 -6
- package/dist/{scene-like-BzkDNHCy.d.ts → scene-like-Dq9_SaUL.d.ts} +225 -6
- package/dist/{store-CEd2y2KS.js → store-C9h7GFFl.js} +4 -5
- package/dist/{store-BKFzSykN.d.ts → store-CIW19oCh.d.ts} +4 -3
- package/dist/store.d.ts +2 -2
- package/dist/store.js +1 -1
- package/dist/three.d.ts +2 -2
- package/dist/three.js +1 -1
- package/dist/{views-CUBMOK0U.js → views-mp7Mf8CQ.js} +24 -1
- package/dist/wasm/fast_mesh_wasm.d.ts +39 -2
- package/dist/wasm/fast_mesh_wasm.js +104 -2
- package/dist/wasm/fast_mesh_wasm_bg.wasm +0 -0
- package/dist/wasm/fast_mesh_wasm_bg.wasm.d.ts +5 -0
- package/dist/wasm-threads/fast_mesh_wasm.d.ts +39 -2
- package/dist/wasm-threads/fast_mesh_wasm.js +105 -3
- package/dist/wasm-threads/fast_mesh_wasm_bg.wasm +0 -0
- package/dist/wasm-threads/fast_mesh_wasm_bg.wasm.d.ts +5 -0
- package/dist/web.d.ts +2 -2
- package/dist/web.js +1 -1
- package/dist/worker-engine.d.ts +1 -1
- package/dist/worker-engine.js +1 -1
- package/dist/worker-entry.js +1 -1
- package/dist/worker.d.ts +1 -1
- package/dist/worker.js +1 -1
- package/package.json +1 -1
package/dist/three.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as bindMesh, n as BoundMesh, r as MeshBinding, t as BindMeshOptions } from "./mesh-
|
|
1
|
+
import { Et as SectionHandle, t as SceneLike } from "./scene-like-Dq9_SaUL.js";
|
|
2
|
+
import { i as bindMesh, n as BoundMesh, r as MeshBinding, t as BindMeshOptions } from "./mesh-B3QP93wx.js";
|
|
3
3
|
import * as THREE from "three";
|
|
4
4
|
/**
|
|
5
5
|
* What {@link attachTransformControls} needs of a TransformControls: its
|
package/dist/three.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as FastMeshError } from "./core-4OcWKu3r.js";
|
|
2
|
-
import { n as checkUntransformedParent, t as bindMesh } from "./mesh-
|
|
2
|
+
import { n as checkUntransformedParent, t as bindMesh } from "./mesh-hPWBQPaN.js";
|
|
3
3
|
import * as THREE from "three";
|
|
4
4
|
// src/three/controls.ts
|
|
5
5
|
const defaultSchedule = (callback) => {
|
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
import { c as wasmMemory, n as call, t as FastMeshError } from "./core-4OcWKu3r.js";
|
|
2
2
|
import { n as DEFAULT_NAN, t as DEFAULT_BASE } from "./colormap-Dr5V3bvs.js";
|
|
3
|
+
// src/register.ts
|
|
4
|
+
function invalid$1(message) {
|
|
5
|
+
return new FastMeshError("INVALID_ARGUMENT", message);
|
|
6
|
+
}
|
|
7
|
+
function isNumber(v) {
|
|
8
|
+
return typeof v === "number" && !Number.isNaN(v);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Throws `INVALID_ARGUMENT` for an option out of range or for one mesh twice.
|
|
12
|
+
* Unset options are valid: they take their defaults.
|
|
13
|
+
*/
|
|
14
|
+
function checkRegisterOptions(sameMesh, o) {
|
|
15
|
+
if (sameMesh) throw invalid$1("cannot register a mesh to itself");
|
|
16
|
+
const { maxIterations: it, tolerance: tol, overlap, maxDistance: far, maxSamples: cap, maxRmse: rmse } = o;
|
|
17
|
+
if (it !== void 0 && !(Number.isInteger(it) && it >= 0)) throw invalid$1("maxIterations must be a non-negative integer");
|
|
18
|
+
if (tol !== void 0 && !(isNumber(tol) && Number.isFinite(tol) && tol >= 0)) throw invalid$1("tolerance must be finite and zero or greater");
|
|
19
|
+
if (overlap !== void 0 && !(isNumber(overlap) && overlap > 0 && overlap <= 1)) throw invalid$1("overlap must be in (0, 1]");
|
|
20
|
+
if (far !== void 0 && !(isNumber(far) && far > 0)) throw invalid$1("maxDistance must be positive");
|
|
21
|
+
if (cap !== void 0 && !(Number.isInteger(cap) && cap >= 1)) throw invalid$1("maxSamples must be a positive integer");
|
|
22
|
+
if (rmse !== void 0 && !(isNumber(rmse) && rmse >= 0)) throw invalid$1("maxRmse must be zero or greater");
|
|
23
|
+
if (o.apply !== void 0 && typeof o.apply !== "boolean") throw invalid$1("apply must be a boolean");
|
|
24
|
+
}
|
|
3
25
|
// src/handles.ts
|
|
4
26
|
/**
|
|
5
27
|
* A mesh in a {@link Scene}. Opaque: pass it to the scene's methods. The same
|
|
@@ -180,7 +202,8 @@ function meshViews(scene, index, generation, guard) {
|
|
|
180
202
|
normals: () => build(f32, (s) => s.normals_ptr(index, generation), (s) => s.normals_len(index, generation)),
|
|
181
203
|
colors: () => build(u8, (s) => s.colors_ptr(index, generation), (s) => s.colors_len(index, generation)),
|
|
182
204
|
values: () => build(f32, (s) => s.values_ptr(index, generation), (s) => s.values_len(index, generation)),
|
|
205
|
+
uvs: () => build(f32, (s) => s.uvs_ptr(index, generation), (s) => s.uvs_len(index, generation)),
|
|
183
206
|
indices: () => build(u32, (s) => s.indices_ptr(index, generation), (s) => s.indices_len(index, generation))
|
|
184
207
|
};
|
|
185
208
|
}
|
|
186
|
-
export { FieldHandle as a, rotationMatrix as c, encodeRule as i, targetsOf as l, meshViews as n, MeshHandle as o, copyRule as r, SectionHandle as s, ViewGuard as t };
|
|
209
|
+
export { FieldHandle as a, rotationMatrix as c, encodeRule as i, targetsOf as l, meshViews as n, MeshHandle as o, copyRule as r, SectionHandle as s, ViewGuard as t, checkRegisterOptions as u };
|
|
@@ -67,6 +67,12 @@ export class WasmScene {
|
|
|
67
67
|
* being added; the chunks must add up to its declared vertices.
|
|
68
68
|
*/
|
|
69
69
|
add_mesh_push_positions(build: number, chunk: Float64Array): void;
|
|
70
|
+
/**
|
|
71
|
+
* Appends a chunk of flat `[u, v, ...]` UVs to a mesh being added. The
|
|
72
|
+
* chunks must add up to 2 per vertex; the build checks them when its
|
|
73
|
+
* store is done and fails like [`WasmScene::add_mesh_with_uvs`].
|
|
74
|
+
*/
|
|
75
|
+
add_mesh_push_uvs(build: number, chunk: Float32Array): void;
|
|
70
76
|
/**
|
|
71
77
|
* Builds about `budget` more units of a mesh being added: first its
|
|
72
78
|
* store (vertices or triangles a unit), then its BVH (see
|
|
@@ -74,6 +80,11 @@ export class WasmScene {
|
|
|
74
80
|
* complete first. A failed build is dropped.
|
|
75
81
|
*/
|
|
76
82
|
add_mesh_step(build: number, budget: number): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* [`WasmScene::add_mesh`] with UVs: 2 finite `f32`s per vertex
|
|
85
|
+
* (`Mesh::add_uvs`). Nothing is added on error.
|
|
86
|
+
*/
|
|
87
|
+
add_mesh_with_uvs(positions: Float64Array, indices: Uint32Array, uvs: Float32Array, origin: Float64Array | null | undefined, mode: number, normals: boolean): Uint32Array;
|
|
77
88
|
/**
|
|
78
89
|
* Adds a section cutting `meshes` (flat pairs) with the world plane
|
|
79
90
|
* `[origin xyz, normal xyz]`, and returns its raw id.
|
|
@@ -203,10 +214,10 @@ export class WasmScene {
|
|
|
203
214
|
* nothing changes when an op fails. `ops` and `values` are laid out as
|
|
204
215
|
* in [`crate::edit`]: `ops` is a `u32` sequence of op codes (0 set
|
|
205
216
|
* positions, 1 add vertices, 2 add triangles, 3 remove triangles, 4
|
|
206
|
-
* remove vertices) with their id lists, whose refs name ids added by
|
|
217
|
+
* remove vertices, 5 set UVs) with their id lists, whose refs name ids added by
|
|
207
218
|
* earlier ops of the list; `values` holds the world positions, mapped
|
|
208
219
|
* to local with the placement inverse and the origin in `f64`, then
|
|
209
|
-
* stored as `f32
|
|
220
|
+
* stored as `f32`, and the UVs of op 5. Returns `[n, id × n]` per op: the new vertex or
|
|
210
221
|
* triangle ids, none for the other ops. The list is decoded and every
|
|
211
222
|
* ref checked before the mesh is touched.
|
|
212
223
|
*/
|
|
@@ -376,6 +387,18 @@ export class WasmScene {
|
|
|
376
387
|
* Redoes the latest undone step; false when there is nothing to redo.
|
|
377
388
|
*/
|
|
378
389
|
redo(): boolean;
|
|
390
|
+
/**
|
|
391
|
+
* Aligns the moving mesh to the fixed one by ICP from their current
|
|
392
|
+
* placements; see [`Scene::register`]. The numeric options are NaN for
|
|
393
|
+
* their defaults. Returns `[rotation (9, row-major), translation (3),
|
|
394
|
+
* scale (3), rmse, iterations, status, applied, samples, inliers,
|
|
395
|
+
* conditioning, not applied, max rmse, then per undetermined motion
|
|
396
|
+
* translation (3), rotation (3), about (3) and its other rmse]`, with
|
|
397
|
+
* status 0 converged, 1 out of iterations, 2 underconstrained, 3 too few
|
|
398
|
+
* correspondences, 4 diverged; and not applied 0 applied, 1 not requested,
|
|
399
|
+
* 2 not converged, 3 rmse above the limit, 4 too few inliers.
|
|
400
|
+
*/
|
|
401
|
+
register(moving_index: number, moving_generation: number, fixed_index: number, fixed_generation: number, max_iterations: number, tolerance: number, overlap: number, max_distance: number, max_samples: number, apply: boolean, max_rmse: number): Float64Array;
|
|
379
402
|
/**
|
|
380
403
|
* Removes a field (and a colouring by it).
|
|
381
404
|
*/
|
|
@@ -473,6 +496,15 @@ export class WasmScene {
|
|
|
473
496
|
* Computes every stale section entry.
|
|
474
497
|
*/
|
|
475
498
|
update_sections(): void;
|
|
499
|
+
/**
|
|
500
|
+
* Length of the UVs in `f32`s, 0 for a mesh without them.
|
|
501
|
+
*/
|
|
502
|
+
uvs_len(index: number, generation: number): number;
|
|
503
|
+
/**
|
|
504
|
+
* Address of the UVs (`f32`, 2 per vertex slot), 0 for a mesh without
|
|
505
|
+
* them.
|
|
506
|
+
*/
|
|
507
|
+
uvs_ptr(index: number, generation: number): number;
|
|
476
508
|
/**
|
|
477
509
|
* Length of the colour values in `f32`s, 0 when the mesh has no
|
|
478
510
|
* colouring.
|
|
@@ -528,7 +560,9 @@ export interface InitOutput {
|
|
|
528
560
|
readonly wasmscene_add_mesh_buffers: (a: number, b: number) => [number, number, number, number];
|
|
529
561
|
readonly wasmscene_add_mesh_push_indices: (a: number, b: number, c: number, d: number) => [number, number];
|
|
530
562
|
readonly wasmscene_add_mesh_push_positions: (a: number, b: number, c: number, d: number) => [number, number];
|
|
563
|
+
readonly wasmscene_add_mesh_push_uvs: (a: number, b: number, c: number, d: number) => [number, number];
|
|
531
564
|
readonly wasmscene_add_mesh_step: (a: number, b: number, c: number) => [number, number, number];
|
|
565
|
+
readonly wasmscene_add_mesh_with_uvs: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number, number, number];
|
|
532
566
|
readonly wasmscene_add_section: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
533
567
|
readonly wasmscene_add_thickness_field: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
534
568
|
readonly wasmscene_add_thickness_field_deferred: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
@@ -580,6 +614,7 @@ export interface InitOutput {
|
|
|
580
614
|
readonly wasmscene_positions_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
581
615
|
readonly wasmscene_raycast: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
582
616
|
readonly wasmscene_redo: (a: number) => [number, number, number];
|
|
617
|
+
readonly wasmscene_register: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number, number, number];
|
|
583
618
|
readonly wasmscene_remove_field: (a: number, b: number) => [number, number];
|
|
584
619
|
readonly wasmscene_remove_mesh: (a: number, b: number, c: number) => [number, number];
|
|
585
620
|
readonly wasmscene_remove_section: (a: number, b: number) => [number, number];
|
|
@@ -600,6 +635,8 @@ export interface InitOutput {
|
|
|
600
635
|
readonly wasmscene_undo: (a: number) => [number, number, number];
|
|
601
636
|
readonly wasmscene_update: (a: number, b: number, c: number) => [number, number];
|
|
602
637
|
readonly wasmscene_update_sections: (a: number) => [number, number];
|
|
638
|
+
readonly wasmscene_uvs_len: (a: number, b: number, c: number) => [number, number, number];
|
|
639
|
+
readonly wasmscene_uvs_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
603
640
|
readonly wasmscene_values_len: (a: number, b: number, c: number) => [number, number, number];
|
|
604
641
|
readonly wasmscene_values_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
605
642
|
readonly wasmscene_vertex_count: (a: number, b: number, c: number) => [number, number, number];
|
|
@@ -180,6 +180,21 @@ export class WasmScene {
|
|
|
180
180
|
throw takeFromExternrefTable0(ret[0]);
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Appends a chunk of flat `[u, v, ...]` UVs to a mesh being added. The
|
|
185
|
+
* chunks must add up to 2 per vertex; the build checks them when its
|
|
186
|
+
* store is done and fails like [`WasmScene::add_mesh_with_uvs`].
|
|
187
|
+
* @param {number} build
|
|
188
|
+
* @param {Float32Array} chunk
|
|
189
|
+
*/
|
|
190
|
+
add_mesh_push_uvs(build, chunk) {
|
|
191
|
+
const ptr0 = passArrayF32ToWasm0(chunk, wasm.__wbindgen_malloc);
|
|
192
|
+
const len0 = WASM_VECTOR_LEN;
|
|
193
|
+
const ret = wasm.wasmscene_add_mesh_push_uvs(this.__wbg_ptr, build, ptr0, len0);
|
|
194
|
+
if (ret[1]) {
|
|
195
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
183
198
|
/**
|
|
184
199
|
* Builds about `budget` more units of a mesh being added: first its
|
|
185
200
|
* store (vertices or triangles a unit), then its BVH (see
|
|
@@ -196,6 +211,34 @@ export class WasmScene {
|
|
|
196
211
|
}
|
|
197
212
|
return ret[0] !== 0;
|
|
198
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* [`WasmScene::add_mesh`] with UVs: 2 finite `f32`s per vertex
|
|
216
|
+
* (`Mesh::add_uvs`). Nothing is added on error.
|
|
217
|
+
* @param {Float64Array} positions
|
|
218
|
+
* @param {Uint32Array} indices
|
|
219
|
+
* @param {Float32Array} uvs
|
|
220
|
+
* @param {Float64Array | null | undefined} origin
|
|
221
|
+
* @param {number} mode
|
|
222
|
+
* @param {boolean} normals
|
|
223
|
+
* @returns {Uint32Array}
|
|
224
|
+
*/
|
|
225
|
+
add_mesh_with_uvs(positions, indices, uvs, origin, mode, normals) {
|
|
226
|
+
const ptr0 = passArrayF64ToWasm0(positions, wasm.__wbindgen_malloc);
|
|
227
|
+
const len0 = WASM_VECTOR_LEN;
|
|
228
|
+
const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
229
|
+
const len1 = WASM_VECTOR_LEN;
|
|
230
|
+
const ptr2 = passArrayF32ToWasm0(uvs, wasm.__wbindgen_malloc);
|
|
231
|
+
const len2 = WASM_VECTOR_LEN;
|
|
232
|
+
var ptr3 = isLikeNone(origin) ? 0 : passArrayF64ToWasm0(origin, wasm.__wbindgen_malloc);
|
|
233
|
+
var len3 = WASM_VECTOR_LEN;
|
|
234
|
+
const ret = wasm.wasmscene_add_mesh_with_uvs(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, mode, normals);
|
|
235
|
+
if (ret[3]) {
|
|
236
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
237
|
+
}
|
|
238
|
+
var v5 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
239
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
240
|
+
return v5;
|
|
241
|
+
}
|
|
199
242
|
/**
|
|
200
243
|
* Adds a section cutting `meshes` (flat pairs) with the world plane
|
|
201
244
|
* `[origin xyz, normal xyz]`, and returns its raw id.
|
|
@@ -527,10 +570,10 @@ export class WasmScene {
|
|
|
527
570
|
* nothing changes when an op fails. `ops` and `values` are laid out as
|
|
528
571
|
* in [`crate::edit`]: `ops` is a `u32` sequence of op codes (0 set
|
|
529
572
|
* positions, 1 add vertices, 2 add triangles, 3 remove triangles, 4
|
|
530
|
-
* remove vertices) with their id lists, whose refs name ids added by
|
|
573
|
+
* remove vertices, 5 set UVs) with their id lists, whose refs name ids added by
|
|
531
574
|
* earlier ops of the list; `values` holds the world positions, mapped
|
|
532
575
|
* to local with the placement inverse and the origin in `f64`, then
|
|
533
|
-
* stored as `f32
|
|
576
|
+
* stored as `f32`, and the UVs of op 5. Returns `[n, id × n]` per op: the new vertex or
|
|
534
577
|
* triangle ids, none for the other ops. The list is decoded and every
|
|
535
578
|
* ref checked before the mesh is touched.
|
|
536
579
|
* @param {number} index
|
|
@@ -997,6 +1040,38 @@ export class WasmScene {
|
|
|
997
1040
|
}
|
|
998
1041
|
return ret[0] !== 0;
|
|
999
1042
|
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Aligns the moving mesh to the fixed one by ICP from their current
|
|
1045
|
+
* placements; see [`Scene::register`]. The numeric options are NaN for
|
|
1046
|
+
* their defaults. Returns `[rotation (9, row-major), translation (3),
|
|
1047
|
+
* scale (3), rmse, iterations, status, applied, samples, inliers,
|
|
1048
|
+
* conditioning, not applied, max rmse, then per undetermined motion
|
|
1049
|
+
* translation (3), rotation (3), about (3) and its other rmse]`, with
|
|
1050
|
+
* status 0 converged, 1 out of iterations, 2 underconstrained, 3 too few
|
|
1051
|
+
* correspondences, 4 diverged; and not applied 0 applied, 1 not requested,
|
|
1052
|
+
* 2 not converged, 3 rmse above the limit, 4 too few inliers.
|
|
1053
|
+
* @param {number} moving_index
|
|
1054
|
+
* @param {number} moving_generation
|
|
1055
|
+
* @param {number} fixed_index
|
|
1056
|
+
* @param {number} fixed_generation
|
|
1057
|
+
* @param {number} max_iterations
|
|
1058
|
+
* @param {number} tolerance
|
|
1059
|
+
* @param {number} overlap
|
|
1060
|
+
* @param {number} max_distance
|
|
1061
|
+
* @param {number} max_samples
|
|
1062
|
+
* @param {boolean} apply
|
|
1063
|
+
* @param {number} max_rmse
|
|
1064
|
+
* @returns {Float64Array}
|
|
1065
|
+
*/
|
|
1066
|
+
register(moving_index, moving_generation, fixed_index, fixed_generation, max_iterations, tolerance, overlap, max_distance, max_samples, apply, max_rmse) {
|
|
1067
|
+
const ret = wasm.wasmscene_register(this.__wbg_ptr, moving_index, moving_generation, fixed_index, fixed_generation, max_iterations, tolerance, overlap, max_distance, max_samples, apply, max_rmse);
|
|
1068
|
+
if (ret[3]) {
|
|
1069
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1070
|
+
}
|
|
1071
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
1072
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
1073
|
+
return v1;
|
|
1074
|
+
}
|
|
1000
1075
|
/**
|
|
1001
1076
|
* Removes a field (and a colouring by it).
|
|
1002
1077
|
* @param {number} field
|
|
@@ -1273,6 +1348,33 @@ export class WasmScene {
|
|
|
1273
1348
|
throw takeFromExternrefTable0(ret[0]);
|
|
1274
1349
|
}
|
|
1275
1350
|
}
|
|
1351
|
+
/**
|
|
1352
|
+
* Length of the UVs in `f32`s, 0 for a mesh without them.
|
|
1353
|
+
* @param {number} index
|
|
1354
|
+
* @param {number} generation
|
|
1355
|
+
* @returns {number}
|
|
1356
|
+
*/
|
|
1357
|
+
uvs_len(index, generation) {
|
|
1358
|
+
const ret = wasm.wasmscene_uvs_len(this.__wbg_ptr, index, generation);
|
|
1359
|
+
if (ret[2]) {
|
|
1360
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1361
|
+
}
|
|
1362
|
+
return ret[0] >>> 0;
|
|
1363
|
+
}
|
|
1364
|
+
/**
|
|
1365
|
+
* Address of the UVs (`f32`, 2 per vertex slot), 0 for a mesh without
|
|
1366
|
+
* them.
|
|
1367
|
+
* @param {number} index
|
|
1368
|
+
* @param {number} generation
|
|
1369
|
+
* @returns {number}
|
|
1370
|
+
*/
|
|
1371
|
+
uvs_ptr(index, generation) {
|
|
1372
|
+
const ret = wasm.wasmscene_uvs_ptr(this.__wbg_ptr, index, generation);
|
|
1373
|
+
if (ret[2]) {
|
|
1374
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1375
|
+
}
|
|
1376
|
+
return ret[0] >>> 0;
|
|
1377
|
+
}
|
|
1276
1378
|
/**
|
|
1277
1379
|
* Length of the colour values in `f32`s, 0 when the mesh has no
|
|
1278
1380
|
* colouring.
|
|
Binary file
|
|
@@ -13,7 +13,9 @@ export const wasmscene_add_mesh: (a: number, b: number, c: number, d: number, e:
|
|
|
13
13
|
export const wasmscene_add_mesh_buffers: (a: number, b: number) => [number, number, number, number];
|
|
14
14
|
export const wasmscene_add_mesh_push_indices: (a: number, b: number, c: number, d: number) => [number, number];
|
|
15
15
|
export const wasmscene_add_mesh_push_positions: (a: number, b: number, c: number, d: number) => [number, number];
|
|
16
|
+
export const wasmscene_add_mesh_push_uvs: (a: number, b: number, c: number, d: number) => [number, number];
|
|
16
17
|
export const wasmscene_add_mesh_step: (a: number, b: number, c: number) => [number, number, number];
|
|
18
|
+
export const wasmscene_add_mesh_with_uvs: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number, number, number];
|
|
17
19
|
export const wasmscene_add_section: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
18
20
|
export const wasmscene_add_thickness_field: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
19
21
|
export const wasmscene_add_thickness_field_deferred: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
@@ -65,6 +67,7 @@ export const wasmscene_positions_len: (a: number, b: number, c: number) => [numb
|
|
|
65
67
|
export const wasmscene_positions_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
66
68
|
export const wasmscene_raycast: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
67
69
|
export const wasmscene_redo: (a: number) => [number, number, number];
|
|
70
|
+
export const wasmscene_register: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number, number, number];
|
|
68
71
|
export const wasmscene_remove_field: (a: number, b: number) => [number, number];
|
|
69
72
|
export const wasmscene_remove_mesh: (a: number, b: number, c: number) => [number, number];
|
|
70
73
|
export const wasmscene_remove_section: (a: number, b: number) => [number, number];
|
|
@@ -85,6 +88,8 @@ export const wasmscene_triangle_slots: (a: number, b: number, c: number) => [num
|
|
|
85
88
|
export const wasmscene_undo: (a: number) => [number, number, number];
|
|
86
89
|
export const wasmscene_update: (a: number, b: number, c: number) => [number, number];
|
|
87
90
|
export const wasmscene_update_sections: (a: number) => [number, number];
|
|
91
|
+
export const wasmscene_uvs_len: (a: number, b: number, c: number) => [number, number, number];
|
|
92
|
+
export const wasmscene_uvs_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
88
93
|
export const wasmscene_values_len: (a: number, b: number, c: number) => [number, number, number];
|
|
89
94
|
export const wasmscene_values_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
90
95
|
export const wasmscene_vertex_count: (a: number, b: number, c: number) => [number, number, number];
|
|
@@ -67,6 +67,12 @@ export class WasmScene {
|
|
|
67
67
|
* being added; the chunks must add up to its declared vertices.
|
|
68
68
|
*/
|
|
69
69
|
add_mesh_push_positions(build: number, chunk: Float64Array): void;
|
|
70
|
+
/**
|
|
71
|
+
* Appends a chunk of flat `[u, v, ...]` UVs to a mesh being added. The
|
|
72
|
+
* chunks must add up to 2 per vertex; the build checks them when its
|
|
73
|
+
* store is done and fails like [`WasmScene::add_mesh_with_uvs`].
|
|
74
|
+
*/
|
|
75
|
+
add_mesh_push_uvs(build: number, chunk: Float32Array): void;
|
|
70
76
|
/**
|
|
71
77
|
* Builds about `budget` more units of a mesh being added: first its
|
|
72
78
|
* store (vertices or triangles a unit), then its BVH (see
|
|
@@ -74,6 +80,11 @@ export class WasmScene {
|
|
|
74
80
|
* complete first. A failed build is dropped.
|
|
75
81
|
*/
|
|
76
82
|
add_mesh_step(build: number, budget: number): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* [`WasmScene::add_mesh`] with UVs: 2 finite `f32`s per vertex
|
|
85
|
+
* (`Mesh::add_uvs`). Nothing is added on error.
|
|
86
|
+
*/
|
|
87
|
+
add_mesh_with_uvs(positions: Float64Array, indices: Uint32Array, uvs: Float32Array, origin: Float64Array | null | undefined, mode: number, normals: boolean): Uint32Array;
|
|
77
88
|
/**
|
|
78
89
|
* Adds a section cutting `meshes` (flat pairs) with the world plane
|
|
79
90
|
* `[origin xyz, normal xyz]`, and returns its raw id.
|
|
@@ -203,10 +214,10 @@ export class WasmScene {
|
|
|
203
214
|
* nothing changes when an op fails. `ops` and `values` are laid out as
|
|
204
215
|
* in [`crate::edit`]: `ops` is a `u32` sequence of op codes (0 set
|
|
205
216
|
* positions, 1 add vertices, 2 add triangles, 3 remove triangles, 4
|
|
206
|
-
* remove vertices) with their id lists, whose refs name ids added by
|
|
217
|
+
* remove vertices, 5 set UVs) with their id lists, whose refs name ids added by
|
|
207
218
|
* earlier ops of the list; `values` holds the world positions, mapped
|
|
208
219
|
* to local with the placement inverse and the origin in `f64`, then
|
|
209
|
-
* stored as `f32
|
|
220
|
+
* stored as `f32`, and the UVs of op 5. Returns `[n, id × n]` per op: the new vertex or
|
|
210
221
|
* triangle ids, none for the other ops. The list is decoded and every
|
|
211
222
|
* ref checked before the mesh is touched.
|
|
212
223
|
*/
|
|
@@ -376,6 +387,18 @@ export class WasmScene {
|
|
|
376
387
|
* Redoes the latest undone step; false when there is nothing to redo.
|
|
377
388
|
*/
|
|
378
389
|
redo(): boolean;
|
|
390
|
+
/**
|
|
391
|
+
* Aligns the moving mesh to the fixed one by ICP from their current
|
|
392
|
+
* placements; see [`Scene::register`]. The numeric options are NaN for
|
|
393
|
+
* their defaults. Returns `[rotation (9, row-major), translation (3),
|
|
394
|
+
* scale (3), rmse, iterations, status, applied, samples, inliers,
|
|
395
|
+
* conditioning, not applied, max rmse, then per undetermined motion
|
|
396
|
+
* translation (3), rotation (3), about (3) and its other rmse]`, with
|
|
397
|
+
* status 0 converged, 1 out of iterations, 2 underconstrained, 3 too few
|
|
398
|
+
* correspondences, 4 diverged; and not applied 0 applied, 1 not requested,
|
|
399
|
+
* 2 not converged, 3 rmse above the limit, 4 too few inliers.
|
|
400
|
+
*/
|
|
401
|
+
register(moving_index: number, moving_generation: number, fixed_index: number, fixed_generation: number, max_iterations: number, tolerance: number, overlap: number, max_distance: number, max_samples: number, apply: boolean, max_rmse: number): Float64Array;
|
|
379
402
|
/**
|
|
380
403
|
* Removes a field (and a colouring by it).
|
|
381
404
|
*/
|
|
@@ -473,6 +496,15 @@ export class WasmScene {
|
|
|
473
496
|
* Computes every stale section entry.
|
|
474
497
|
*/
|
|
475
498
|
update_sections(): void;
|
|
499
|
+
/**
|
|
500
|
+
* Length of the UVs in `f32`s, 0 for a mesh without them.
|
|
501
|
+
*/
|
|
502
|
+
uvs_len(index: number, generation: number): number;
|
|
503
|
+
/**
|
|
504
|
+
* Address of the UVs (`f32`, 2 per vertex slot), 0 for a mesh without
|
|
505
|
+
* them.
|
|
506
|
+
*/
|
|
507
|
+
uvs_ptr(index: number, generation: number): number;
|
|
476
508
|
/**
|
|
477
509
|
* Length of the colour values in `f32`s, 0 when the mesh has no
|
|
478
510
|
* colouring.
|
|
@@ -551,7 +583,9 @@ export interface InitOutput {
|
|
|
551
583
|
readonly wasmscene_add_mesh_buffers: (a: number, b: number) => [number, number, number, number];
|
|
552
584
|
readonly wasmscene_add_mesh_push_indices: (a: number, b: number, c: number, d: number) => [number, number];
|
|
553
585
|
readonly wasmscene_add_mesh_push_positions: (a: number, b: number, c: number, d: number) => [number, number];
|
|
586
|
+
readonly wasmscene_add_mesh_push_uvs: (a: number, b: number, c: number, d: number) => [number, number];
|
|
554
587
|
readonly wasmscene_add_mesh_step: (a: number, b: number, c: number) => [number, number, number];
|
|
588
|
+
readonly wasmscene_add_mesh_with_uvs: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number, number, number];
|
|
555
589
|
readonly wasmscene_add_section: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
556
590
|
readonly wasmscene_add_thickness_field: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
557
591
|
readonly wasmscene_add_thickness_field_deferred: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
@@ -603,6 +637,7 @@ export interface InitOutput {
|
|
|
603
637
|
readonly wasmscene_positions_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
604
638
|
readonly wasmscene_raycast: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
605
639
|
readonly wasmscene_redo: (a: number) => [number, number, number];
|
|
640
|
+
readonly wasmscene_register: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number, number, number];
|
|
606
641
|
readonly wasmscene_remove_field: (a: number, b: number) => [number, number];
|
|
607
642
|
readonly wasmscene_remove_mesh: (a: number, b: number, c: number) => [number, number];
|
|
608
643
|
readonly wasmscene_remove_section: (a: number, b: number) => [number, number];
|
|
@@ -623,6 +658,8 @@ export interface InitOutput {
|
|
|
623
658
|
readonly wasmscene_undo: (a: number) => [number, number, number];
|
|
624
659
|
readonly wasmscene_update: (a: number, b: number, c: number) => [number, number];
|
|
625
660
|
readonly wasmscene_update_sections: (a: number) => [number, number];
|
|
661
|
+
readonly wasmscene_uvs_len: (a: number, b: number, c: number) => [number, number, number];
|
|
662
|
+
readonly wasmscene_uvs_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
626
663
|
readonly wasmscene_values_len: (a: number, b: number, c: number) => [number, number, number];
|
|
627
664
|
readonly wasmscene_values_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
628
665
|
readonly wasmscene_vertex_count: (a: number, b: number, c: number) => [number, number, number];
|
|
@@ -183,6 +183,21 @@ export class WasmScene {
|
|
|
183
183
|
throw takeFromExternrefTable0(ret[0]);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Appends a chunk of flat `[u, v, ...]` UVs to a mesh being added. The
|
|
188
|
+
* chunks must add up to 2 per vertex; the build checks them when its
|
|
189
|
+
* store is done and fails like [`WasmScene::add_mesh_with_uvs`].
|
|
190
|
+
* @param {number} build
|
|
191
|
+
* @param {Float32Array} chunk
|
|
192
|
+
*/
|
|
193
|
+
add_mesh_push_uvs(build, chunk) {
|
|
194
|
+
const ptr0 = passArrayF32ToWasm0(chunk, wasm.__wbindgen_malloc);
|
|
195
|
+
const len0 = WASM_VECTOR_LEN;
|
|
196
|
+
const ret = wasm.wasmscene_add_mesh_push_uvs(this.__wbg_ptr, build, ptr0, len0);
|
|
197
|
+
if (ret[1]) {
|
|
198
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
186
201
|
/**
|
|
187
202
|
* Builds about `budget` more units of a mesh being added: first its
|
|
188
203
|
* store (vertices or triangles a unit), then its BVH (see
|
|
@@ -199,6 +214,34 @@ export class WasmScene {
|
|
|
199
214
|
}
|
|
200
215
|
return ret[0] !== 0;
|
|
201
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* [`WasmScene::add_mesh`] with UVs: 2 finite `f32`s per vertex
|
|
219
|
+
* (`Mesh::add_uvs`). Nothing is added on error.
|
|
220
|
+
* @param {Float64Array} positions
|
|
221
|
+
* @param {Uint32Array} indices
|
|
222
|
+
* @param {Float32Array} uvs
|
|
223
|
+
* @param {Float64Array | null | undefined} origin
|
|
224
|
+
* @param {number} mode
|
|
225
|
+
* @param {boolean} normals
|
|
226
|
+
* @returns {Uint32Array}
|
|
227
|
+
*/
|
|
228
|
+
add_mesh_with_uvs(positions, indices, uvs, origin, mode, normals) {
|
|
229
|
+
const ptr0 = passArrayF64ToWasm0(positions, wasm.__wbindgen_malloc);
|
|
230
|
+
const len0 = WASM_VECTOR_LEN;
|
|
231
|
+
const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
232
|
+
const len1 = WASM_VECTOR_LEN;
|
|
233
|
+
const ptr2 = passArrayF32ToWasm0(uvs, wasm.__wbindgen_malloc);
|
|
234
|
+
const len2 = WASM_VECTOR_LEN;
|
|
235
|
+
var ptr3 = isLikeNone(origin) ? 0 : passArrayF64ToWasm0(origin, wasm.__wbindgen_malloc);
|
|
236
|
+
var len3 = WASM_VECTOR_LEN;
|
|
237
|
+
const ret = wasm.wasmscene_add_mesh_with_uvs(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, mode, normals);
|
|
238
|
+
if (ret[3]) {
|
|
239
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
240
|
+
}
|
|
241
|
+
var v5 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
242
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
243
|
+
return v5;
|
|
244
|
+
}
|
|
202
245
|
/**
|
|
203
246
|
* Adds a section cutting `meshes` (flat pairs) with the world plane
|
|
204
247
|
* `[origin xyz, normal xyz]`, and returns its raw id.
|
|
@@ -530,10 +573,10 @@ export class WasmScene {
|
|
|
530
573
|
* nothing changes when an op fails. `ops` and `values` are laid out as
|
|
531
574
|
* in [`crate::edit`]: `ops` is a `u32` sequence of op codes (0 set
|
|
532
575
|
* positions, 1 add vertices, 2 add triangles, 3 remove triangles, 4
|
|
533
|
-
* remove vertices) with their id lists, whose refs name ids added by
|
|
576
|
+
* remove vertices, 5 set UVs) with their id lists, whose refs name ids added by
|
|
534
577
|
* earlier ops of the list; `values` holds the world positions, mapped
|
|
535
578
|
* to local with the placement inverse and the origin in `f64`, then
|
|
536
|
-
* stored as `f32
|
|
579
|
+
* stored as `f32`, and the UVs of op 5. Returns `[n, id × n]` per op: the new vertex or
|
|
537
580
|
* triangle ids, none for the other ops. The list is decoded and every
|
|
538
581
|
* ref checked before the mesh is touched.
|
|
539
582
|
* @param {number} index
|
|
@@ -1000,6 +1043,38 @@ export class WasmScene {
|
|
|
1000
1043
|
}
|
|
1001
1044
|
return ret[0] !== 0;
|
|
1002
1045
|
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Aligns the moving mesh to the fixed one by ICP from their current
|
|
1048
|
+
* placements; see [`Scene::register`]. The numeric options are NaN for
|
|
1049
|
+
* their defaults. Returns `[rotation (9, row-major), translation (3),
|
|
1050
|
+
* scale (3), rmse, iterations, status, applied, samples, inliers,
|
|
1051
|
+
* conditioning, not applied, max rmse, then per undetermined motion
|
|
1052
|
+
* translation (3), rotation (3), about (3) and its other rmse]`, with
|
|
1053
|
+
* status 0 converged, 1 out of iterations, 2 underconstrained, 3 too few
|
|
1054
|
+
* correspondences, 4 diverged; and not applied 0 applied, 1 not requested,
|
|
1055
|
+
* 2 not converged, 3 rmse above the limit, 4 too few inliers.
|
|
1056
|
+
* @param {number} moving_index
|
|
1057
|
+
* @param {number} moving_generation
|
|
1058
|
+
* @param {number} fixed_index
|
|
1059
|
+
* @param {number} fixed_generation
|
|
1060
|
+
* @param {number} max_iterations
|
|
1061
|
+
* @param {number} tolerance
|
|
1062
|
+
* @param {number} overlap
|
|
1063
|
+
* @param {number} max_distance
|
|
1064
|
+
* @param {number} max_samples
|
|
1065
|
+
* @param {boolean} apply
|
|
1066
|
+
* @param {number} max_rmse
|
|
1067
|
+
* @returns {Float64Array}
|
|
1068
|
+
*/
|
|
1069
|
+
register(moving_index, moving_generation, fixed_index, fixed_generation, max_iterations, tolerance, overlap, max_distance, max_samples, apply, max_rmse) {
|
|
1070
|
+
const ret = wasm.wasmscene_register(this.__wbg_ptr, moving_index, moving_generation, fixed_index, fixed_generation, max_iterations, tolerance, overlap, max_distance, max_samples, apply, max_rmse);
|
|
1071
|
+
if (ret[3]) {
|
|
1072
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1073
|
+
}
|
|
1074
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
1075
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
1076
|
+
return v1;
|
|
1077
|
+
}
|
|
1003
1078
|
/**
|
|
1004
1079
|
* Removes a field (and a colouring by it).
|
|
1005
1080
|
* @param {number} field
|
|
@@ -1276,6 +1351,33 @@ export class WasmScene {
|
|
|
1276
1351
|
throw takeFromExternrefTable0(ret[0]);
|
|
1277
1352
|
}
|
|
1278
1353
|
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Length of the UVs in `f32`s, 0 for a mesh without them.
|
|
1356
|
+
* @param {number} index
|
|
1357
|
+
* @param {number} generation
|
|
1358
|
+
* @returns {number}
|
|
1359
|
+
*/
|
|
1360
|
+
uvs_len(index, generation) {
|
|
1361
|
+
const ret = wasm.wasmscene_uvs_len(this.__wbg_ptr, index, generation);
|
|
1362
|
+
if (ret[2]) {
|
|
1363
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1364
|
+
}
|
|
1365
|
+
return ret[0] >>> 0;
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* Address of the UVs (`f32`, 2 per vertex slot), 0 for a mesh without
|
|
1369
|
+
* them.
|
|
1370
|
+
* @param {number} index
|
|
1371
|
+
* @param {number} generation
|
|
1372
|
+
* @returns {number}
|
|
1373
|
+
*/
|
|
1374
|
+
uvs_ptr(index, generation) {
|
|
1375
|
+
const ret = wasm.wasmscene_uvs_ptr(this.__wbg_ptr, index, generation);
|
|
1376
|
+
if (ret[2]) {
|
|
1377
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1378
|
+
}
|
|
1379
|
+
return ret[0] >>> 0;
|
|
1380
|
+
}
|
|
1279
1381
|
/**
|
|
1280
1382
|
* Length of the colour values in `f32`s, 0 when the mesh has no
|
|
1281
1383
|
* colouring.
|
|
@@ -1520,7 +1622,7 @@ function __wbg_get_imports(memory) {
|
|
|
1520
1622
|
table.set(offset + 2, true);
|
|
1521
1623
|
table.set(offset + 3, false);
|
|
1522
1624
|
},
|
|
1523
|
-
memory: memory || new WebAssembly.Memory({initial:
|
|
1625
|
+
memory: memory || new WebAssembly.Memory({initial:19,maximum:65536,shared:true}),
|
|
1524
1626
|
};
|
|
1525
1627
|
return {
|
|
1526
1628
|
__proto__: null,
|
|
Binary file
|
|
@@ -14,7 +14,9 @@ export const wasmscene_add_mesh: (a: number, b: number, c: number, d: number, e:
|
|
|
14
14
|
export const wasmscene_add_mesh_buffers: (a: number, b: number) => [number, number, number, number];
|
|
15
15
|
export const wasmscene_add_mesh_push_indices: (a: number, b: number, c: number, d: number) => [number, number];
|
|
16
16
|
export const wasmscene_add_mesh_push_positions: (a: number, b: number, c: number, d: number) => [number, number];
|
|
17
|
+
export const wasmscene_add_mesh_push_uvs: (a: number, b: number, c: number, d: number) => [number, number];
|
|
17
18
|
export const wasmscene_add_mesh_step: (a: number, b: number, c: number) => [number, number, number];
|
|
19
|
+
export const wasmscene_add_mesh_with_uvs: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number, number, number];
|
|
18
20
|
export const wasmscene_add_section: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
19
21
|
export const wasmscene_add_thickness_field: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
20
22
|
export const wasmscene_add_thickness_field_deferred: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
@@ -66,6 +68,7 @@ export const wasmscene_positions_len: (a: number, b: number, c: number) => [numb
|
|
|
66
68
|
export const wasmscene_positions_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
67
69
|
export const wasmscene_raycast: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
68
70
|
export const wasmscene_redo: (a: number) => [number, number, number];
|
|
71
|
+
export const wasmscene_register: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number, number, number];
|
|
69
72
|
export const wasmscene_remove_field: (a: number, b: number) => [number, number];
|
|
70
73
|
export const wasmscene_remove_mesh: (a: number, b: number, c: number) => [number, number];
|
|
71
74
|
export const wasmscene_remove_section: (a: number, b: number) => [number, number];
|
|
@@ -86,6 +89,8 @@ export const wasmscene_triangle_slots: (a: number, b: number, c: number) => [num
|
|
|
86
89
|
export const wasmscene_undo: (a: number) => [number, number, number];
|
|
87
90
|
export const wasmscene_update: (a: number, b: number, c: number) => [number, number];
|
|
88
91
|
export const wasmscene_update_sections: (a: number) => [number, number];
|
|
92
|
+
export const wasmscene_uvs_len: (a: number, b: number, c: number) => [number, number, number];
|
|
93
|
+
export const wasmscene_uvs_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
89
94
|
export const wasmscene_values_len: (a: number, b: number, c: number) => [number, number, number];
|
|
90
95
|
export const wasmscene_values_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
91
96
|
export const wasmscene_vertex_count: (a: number, b: number, c: number) => [number, number, number];
|
package/dist/web.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as RepairReportOf, A as InflateReport, At as Mat3, B as OutOfRange, C as EditRef, Ct as SceneMeshViews, D as FilledLoop, Dt as Bounds, E as FillReport, Et as SectionHandle, F as MeshChange, Ft as Quat, G as RegisterOptions, H as RaycastOptions, I as MeshComponent, It as UpdateMode, J as RelaxReport, K as RegisterResult, L as MeshDistance, Lt as Vec3, M as JoinReport, Mt as PlacementInput, N as LoopId, Nt as Positions, O as FindContactsOptions, Ot as Indices, P as MeasureResult, Pt as Positions64, Q as RepairReport, R as OffsetReport, Rt as computeBounds, S as EditOp, St as MeshViews, T as FieldStatus, Tt as MeshHandle, U as RegisterMotion, V as RayHit, W as RegisterNotApplied, X as RemoveReport, Y as RemeshReport, Z as RepairOp, _ as CutReport, _t as IsolateReport, a as AutoRepairReport, at as SectionGap, b as DragOptions, bt as VertexSelection, c as BoundaryLoop, ct as ShellReport, d as ClosestPointOptions, dt as SmoothReport, et as Rgba, f as ColorRule, ft as SubdivideReport, g as CutOptions, gt as ComponentSelect, h as CurvatureFieldDesc, ht as BrushSelect, i as AnalyzeOptions, it as SectionDesc, j as JoinOptions, jt as Placement, k as GrabReport, kt as InitInput, l as BridgeReport, lt as SignMode, m as Contact, mt as WeldReport, n as AddMeshOptions, nt as SceneOptions, o as AutoRepairRequest, ot as SectionPlane, p as Colormap, pt as ThicknessFieldDesc, q as RegisterStatus, r as Analysis, rt as SectionContour, s as BooleanOp, st as SectionResult, t as SceneLike, tt as Scene, u as ClosestHit, ut as SimplifyReport, v as DegenerateReport, vt as LassoSelect, w as EditResult, wt as FieldHandle, x as DragSession, xt as Range, y as DistanceFieldDesc, yt as SelectSpec, z as OrientReport, zt as computeVertexNormals } from "./scene-like-Dq9_SaUL.js";
|
|
2
2
|
import { n as FastMeshErrorCode, t as FastMeshError } from "./core-CJ9D6U5A.js";
|
|
3
3
|
/**
|
|
4
4
|
* Loads the WebAssembly module. Await this once before calling any other function.
|
|
@@ -8,4 +8,4 @@ import { n as FastMeshErrorCode, t as FastMeshError } from "./core-CJ9D6U5A.js";
|
|
|
8
8
|
* Leave empty to load the file shipped with this package.
|
|
9
9
|
*/
|
|
10
10
|
export declare function init(input?: InitInput | Promise<InitInput>): Promise<void>;
|
|
11
|
-
export { type AddMeshOptions, type Analysis, type AnalyzeOptions, type BooleanOp, type BoundaryLoop, type Bounds, type BridgeReport, type BrushSelect, type ClosestHit, type ClosestPointOptions, type ColorRule, type Colormap, type ComponentSelect, type Contact, type CurvatureFieldDesc, type CutOptions, type CutReport, type DegenerateReport, type DistanceFieldDesc, type DragOptions, type DragSession, type EditOp, type EditRef, type EditResult, FastMeshError, type FastMeshErrorCode, type FieldHandle, type FieldStatus, type FillReport, type FilledLoop, type FindContactsOptions, type GrabReport, type Indices, type InflateReport, type InitInput, type IsolateReport, type JoinOptions, type JoinReport, type LassoSelect, type LoopId, type Mat3, type MeasureResult, type MeshChange, type MeshComponent, type MeshDistance, type MeshHandle, type MeshViews, type OffsetReport, type OrientReport, type OutOfRange, type Placement, type PlacementInput, type Positions, type Positions64, type Quat, type Range, type RayHit, type RaycastOptions, type RelaxReport, type RemeshReport, type RemoveReport, type RepairOp, type RepairReport, type RepairReportOf, type Rgba, Scene, type SceneLike, type SceneOptions, type SectionContour, type SectionDesc, type SectionGap, type SectionHandle, type SectionPlane, type SectionResult, type SelectSpec, type ShellReport, type SignMode, type SimplifyReport, type SmoothReport, type SubdivideReport, type ThicknessFieldDesc, type UpdateMode, type Vec3, type VertexSelection, type WeldReport, computeBounds, computeVertexNormals };
|
|
11
|
+
export { type AddMeshOptions, type Analysis, type AnalyzeOptions, type AutoRepairReport, type AutoRepairRequest, type BooleanOp, type BoundaryLoop, type Bounds, type BridgeReport, type BrushSelect, type ClosestHit, type ClosestPointOptions, type ColorRule, type Colormap, type ComponentSelect, type Contact, type CurvatureFieldDesc, type CutOptions, type CutReport, type DegenerateReport, type DistanceFieldDesc, type DragOptions, type DragSession, type EditOp, type EditRef, type EditResult, FastMeshError, type FastMeshErrorCode, type FieldHandle, type FieldStatus, type FillReport, type FilledLoop, type FindContactsOptions, type GrabReport, type Indices, type InflateReport, type InitInput, type IsolateReport, type JoinOptions, type JoinReport, type LassoSelect, type LoopId, type Mat3, type MeasureResult, type MeshChange, type MeshComponent, type MeshDistance, type MeshHandle, type MeshViews, type OffsetReport, type OrientReport, type OutOfRange, type Placement, type PlacementInput, type Positions, type Positions64, type Quat, type Range, type RayHit, type RaycastOptions, type RegisterMotion, type RegisterNotApplied, type RegisterOptions, type RegisterResult, type RegisterStatus, type RelaxReport, type RemeshReport, type RemoveReport, type RepairOp, type RepairReport, type RepairReportOf, type Rgba, Scene, type SceneLike, type SceneMeshViews, type SceneOptions, type SectionContour, type SectionDesc, type SectionGap, type SectionHandle, type SectionPlane, type SectionResult, type SelectSpec, type ShellReport, type SignMode, type SimplifyReport, type SmoothReport, type SubdivideReport, type ThicknessFieldDesc, type UpdateMode, type Vec3, type VertexSelection, type WeldReport, computeBounds, computeVertexNormals };
|
package/dist/web.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as computeVertexNormals, r as markInitialized, t as computeBounds } from "./api-4kz45-Mq.js";
|
|
2
2
|
import { t as FastMeshError } from "./core-4OcWKu3r.js";
|
|
3
|
-
import { t as Scene } from "./scene-
|
|
3
|
+
import { t as Scene } from "./scene-CXtM_bxV.js";
|
|
4
4
|
import wasmInit from "./wasm/fast_mesh_wasm.js";
|
|
5
5
|
// src/web.ts
|
|
6
6
|
let ready;
|
package/dist/worker-engine.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as WorkerMessage, i as Result, n as InitMessage, r as Request, t as ClientId } from "./protocol-
|
|
1
|
+
import { a as WorkerMessage, i as Result, n as InitMessage, r as Request, t as ClientId } from "./protocol-Dt0zgang.js";
|
|
2
2
|
import { WasmScene } from "./wasm/fast_mesh_wasm.js";
|
|
3
3
|
/** What the engine needs of a wasm-bindgen glue module. */
|
|
4
4
|
interface Glue {
|