fast-mesh-wasm 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/{client-f895H_yB.js → client-BrTp2eMp.js} +20 -1
- package/dist/{client-D7yfPOyU.d.ts → client-Ds09vLkN.d.ts} +13 -2
- package/dist/{engine-BcJ5W6kS.js → engine-DjdY3GxK.js} +7 -3
- package/dist/io.d.ts +19 -4
- package/dist/io.js +64 -9
- package/dist/{mesh-B3QP93wx.d.ts → mesh-BsqIofgT.d.ts} +5 -2
- package/dist/{mesh-hPWBQPaN.js → mesh-DIWD2F5-.js} +51 -2
- package/dist/node.d.ts +2 -2
- package/dist/node.js +1 -1
- package/dist/{protocol-Dt0zgang.d.ts → protocol-Cb23HelE.d.ts} +7 -1
- package/dist/r3f.d.ts +3 -3
- package/dist/r3f.js +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/{scene-CXtM_bxV.js → scene-D0HNTwoo.js} +82 -6
- package/dist/{scene-like-Dq9_SaUL.d.ts → scene-like-CADk1vfb.d.ts} +118 -8
- package/dist/{store-CIW19oCh.d.ts → store-BfC6kkf5.d.ts} +2 -2
- package/dist/{store-C9h7GFFl.js → store-DIQmxF_s.js} +2 -2
- 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-mp7Mf8CQ.js → views-B00kdV0R.js} +6 -1
- package/dist/wasm/fast_mesh_wasm.d.ts +14 -1
- package/dist/wasm/fast_mesh_wasm.js +29 -1
- package/dist/wasm/fast_mesh_wasm_bg.wasm +0 -0
- package/dist/wasm/fast_mesh_wasm_bg.wasm.d.ts +2 -0
- package/dist/wasm-threads/fast_mesh_wasm.d.ts +14 -1
- package/dist/wasm-threads/fast_mesh_wasm.js +29 -1
- package/dist/wasm-threads/fast_mesh_wasm_bg.wasm +0 -0
- package/dist/wasm-threads/fast_mesh_wasm_bg.wasm.d.ts +2 -0
- package/dist/web.d.ts +2 -2
- package/dist/web.js +1 -1
- package/dist/worker-engine.d.ts +5 -3
- 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
|
@@ -541,7 +541,8 @@ export class WasmScene {
|
|
|
541
541
|
* the same placement. Returns `[kept index, kept generation, added
|
|
542
542
|
* index, added generation, kept triangles, removed triangles, cap
|
|
543
543
|
* triangles]`. With `cap` (the usual case) both openings are closed
|
|
544
|
-
* with flat, unfaired patches
|
|
544
|
+
* with flat, unfaired patches, across UV seams on a mesh with UVs;
|
|
545
|
+
* without it both parts keep the open rim.
|
|
545
546
|
* The cut undoes in one step; the added mesh stays, like the removed
|
|
546
547
|
* source of [`WasmScene::join`].
|
|
547
548
|
* @param {number} index
|
|
@@ -965,6 +966,22 @@ export class WasmScene {
|
|
|
965
966
|
}
|
|
966
967
|
return ret[0] >>> 0;
|
|
967
968
|
}
|
|
969
|
+
/**
|
|
970
|
+
* The mesh's origin: its stored positions are relative to it, and
|
|
971
|
+
* `setPositions` takes positions with it added back.
|
|
972
|
+
* @param {number} index
|
|
973
|
+
* @param {number} generation
|
|
974
|
+
* @returns {Float64Array}
|
|
975
|
+
*/
|
|
976
|
+
origin(index, generation) {
|
|
977
|
+
const ret = wasm.wasmscene_origin(this.__wbg_ptr, index, generation);
|
|
978
|
+
if (ret[3]) {
|
|
979
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
980
|
+
}
|
|
981
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
982
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
983
|
+
return v1;
|
|
984
|
+
}
|
|
968
985
|
/**
|
|
969
986
|
* The placement: the row-major rotation (9 values), then the
|
|
970
987
|
* translation (3 values), then the scale (3 values).
|
|
@@ -1211,6 +1228,17 @@ export class WasmScene {
|
|
|
1211
1228
|
set_defer_fields(on) {
|
|
1212
1229
|
wasm.wasmscene_set_defer_fields(this.__wbg_ptr, on);
|
|
1213
1230
|
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Starts (a budget of `points`) or ends (`undefined`) an interaction; see
|
|
1233
|
+
* [`Scene::set_field_interaction`].
|
|
1234
|
+
* @param {number | null} [points]
|
|
1235
|
+
*/
|
|
1236
|
+
set_field_interaction(points) {
|
|
1237
|
+
const ret = wasm.wasmscene_set_field_interaction(this.__wbg_ptr, isLikeNone(points) ? Number.MAX_SAFE_INTEGER : (points) >>> 0);
|
|
1238
|
+
if (ret[1]) {
|
|
1239
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1214
1242
|
/**
|
|
1215
1243
|
* Sets when the mesh's BVH, normals, fields and sections follow its
|
|
1216
1244
|
* edits: 0 (Eager), 1 (Lazy) or 2 (Manual).
|
|
Binary file
|
|
@@ -63,6 +63,7 @@ export const wasmscene_mode: (a: number, b: number, c: number) => [number, numbe
|
|
|
63
63
|
export const wasmscene_new: () => number;
|
|
64
64
|
export const wasmscene_normals_len: (a: number, b: number, c: number) => [number, number, number];
|
|
65
65
|
export const wasmscene_normals_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
66
|
+
export const wasmscene_origin: (a: number, b: number, c: number) => [number, number, number, number];
|
|
66
67
|
export const wasmscene_placement: (a: number, b: number, c: number) => [number, number, number, number];
|
|
67
68
|
export const wasmscene_positions_len: (a: number, b: number, c: number) => [number, number, number];
|
|
68
69
|
export const wasmscene_positions_ptr: (a: number, b: number, c: number) => [number, number, number];
|
|
@@ -78,6 +79,7 @@ export const wasmscene_section_desc_plane: (a: number, b: number) => [number, nu
|
|
|
78
79
|
export const wasmscene_section_gap: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
79
80
|
export const wasmscene_set_coloring: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
|
|
80
81
|
export const wasmscene_set_defer_fields: (a: number, b: number) => void;
|
|
82
|
+
export const wasmscene_set_field_interaction: (a: number, b: number) => [number, number];
|
|
81
83
|
export const wasmscene_set_mode: (a: number, b: number, c: number, d: number) => [number, number];
|
|
82
84
|
export const wasmscene_set_placement: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number];
|
|
83
85
|
export const wasmscene_set_section_fill: (a: number, b: number, c: number) => [number, number];
|
package/dist/web.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as RepairReport, A as GrabReport, At as Bounds, B as OrientReport, Bt as Vec3, C as EditOp, Ct as VertexSelection, D as FillReport, Dt as FieldHandle, E as FieldStatus, Et as SceneMeshViews, F as MeasureResult, Ft as PlacementInput, G as RegisterNotApplied, H as RayHit, Ht as computeVertexNormals, I as MeshChange, It as Positions, J as RegisterStatus, K as RegisterOptions, L as MeshComponent, Lt as Positions64, M as JoinOptions, Mt as InitInput, N as JoinReport, Nt as Mat3, O as FilledLoop, Ot as MeshHandle, P as LoopId, Pt as Placement, Q as RepairOp, R as MeshDistance, Rt as Quat, S as DragSession, St as SelectSpec, T as EditResult, Tt as MeshViews, U as RaycastOptions, V as OutOfRange, Vt as computeBounds, W as RegisterMotion, X as RemeshReport, Y as RelaxReport, Z as RemoveReport, _ as CutOptions, _t as WeldReport, a as AutoRepairReport, at as SectionDesc, b as DistanceFieldDesc, bt as IsolateReport, c as BoundaryLoop, ct as SectionResult, d as ClosestHit, dt as SimplifyReport, et as RepairReportOf, f as ClosestPointOptions, ft as SmoothReport, g as CurvatureFieldDesc, gt as VertexProtection, h as Contact, ht as ThicknessFieldDesc, i as AnalyzeOptions, it as SectionContour, j as InflateReport, jt as Indices, k as FindContactsOptions, kt as SectionHandle, l as BridgeReport, lt as ShellReport, m as Colormap, mt as SubdivideReport, n as AddMeshOptions, nt as Scene, o as AutoRepairRequest, ot as SectionGap, p as ColorRule, pt as StretchReport, q as RegisterResult, r as Analysis, rt as SceneOptions, s as BooleanOp, st as SectionPlane, t as SceneLike, tt as Rgba, u as CaptureRestReport, ut as SignMode, v as CutReport, vt as BrushSelect, w as EditRef, wt as Range, x as DragOptions, xt as LassoSelect, y as DegenerateReport, yt as ComponentSelect, z as OffsetReport, zt as UpdateMode } from "./scene-like-CADk1vfb.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 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 };
|
|
11
|
+
export { type AddMeshOptions, type Analysis, type AnalyzeOptions, type AutoRepairReport, type AutoRepairRequest, type BooleanOp, type BoundaryLoop, type Bounds, type BridgeReport, type BrushSelect, type CaptureRestReport, 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 StretchReport, type SubdivideReport, type ThicknessFieldDesc, type UpdateMode, type Vec3, type VertexProtection, 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-D0HNTwoo.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-Cb23HelE.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 {
|
|
@@ -158,7 +158,9 @@ export interface EngineOptions {
|
|
|
158
158
|
* completed, a queued drag move no longer abandons the unit: it completes
|
|
159
159
|
* and is published, and the newest pose follows. So a sustained drag whose
|
|
160
160
|
* recompute outlasts the gaps between moves still updates its colours
|
|
161
|
-
* about every guard plus one recompute, each update exactly one pose.
|
|
161
|
+
* about every guard plus one recompute, each update exactly one pose. At
|
|
162
|
+
* the default of 0 a move never abandons a unit: every recompute that
|
|
163
|
+
* starts is shown, so its time alone sets the update rate.
|
|
162
164
|
* Edits, repairs, compactions, removals, placements, undo, redo and drag
|
|
163
165
|
* cancels always abandon, and so do drag moves once the drag's `end` is
|
|
164
166
|
* queued (the final pose then follows within one recompute; a pointer
|
|
@@ -203,7 +205,7 @@ export interface EngineOptions {
|
|
|
203
205
|
/** The default {@link EngineOptions.yieldMs}. */
|
|
204
206
|
export declare const YIELD_MS = 4;
|
|
205
207
|
/** The default {@link EngineOptions.staleGuardMs}. */
|
|
206
|
-
export declare const STALE_GUARD_MS =
|
|
208
|
+
export declare const STALE_GUARD_MS = 0;
|
|
207
209
|
/** The default {@link EngineOptions.stepPoints}. */
|
|
208
210
|
export declare const STEP_POINTS = 4096;
|
|
209
211
|
/**
|
package/dist/worker-engine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as ADD_STEP_WORK, n as BACKGROUND_ADD_TRIANGLES, r as STALE_GUARD_MS, i as STEP_POINTS, a as YIELD_MS, c as loadEngine, u as probeSharedGrowth, o as runEngine, s as serveEngine, l as startEngine } from "./engine-
|
|
1
|
+
export { t as ADD_STEP_WORK, n as BACKGROUND_ADD_TRIANGLES, r as STALE_GUARD_MS, i as STEP_POINTS, a as YIELD_MS, c as loadEngine, u as probeSharedGrowth, o as runEngine, s as serveEngine, l as startEngine } from "./engine-DjdY3GxK.js";
|
package/dist/worker-entry.js
CHANGED
package/dist/worker.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as WorkerSceneOptions, i as WorkerScene, n as MAX_THREADS, o as createWorkerScene, r as WorkerLike, t as KeyStatus } from "./client-
|
|
1
|
+
import { a as WorkerSceneOptions, i as WorkerScene, n as MAX_THREADS, o as createWorkerScene, r as WorkerLike, t as KeyStatus } from "./client-Ds09vLkN.js";
|
|
2
2
|
export { type KeyStatus, MAX_THREADS, type WorkerLike, WorkerScene, type WorkerSceneOptions, createWorkerScene };
|
package/dist/worker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as MAX_THREADS, n as WorkerScene, i as createWorkerScene } from "./client-
|
|
1
|
+
export { t as MAX_THREADS, n as WorkerScene, i as createWorkerScene } from "./client-BrTp2eMp.js";
|