fast-mesh-wasm 0.5.3 → 0.7.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.
Files changed (40) hide show
  1. package/README.md +2 -1
  2. package/dist/{client-f895H_yB.js → client-DFgvktkT.js} +183 -10
  3. package/dist/{client-D7yfPOyU.d.ts → client-nvmbhtn-.d.ts} +87 -14
  4. package/dist/{engine-BcJ5W6kS.js → engine-BL5_sWAf.js} +21 -6
  5. package/dist/io.d.ts +218 -5
  6. package/dist/io.js +3121 -12
  7. package/dist/{mesh-B3QP93wx.d.ts → mesh-BHTFxsXc.d.ts} +5 -2
  8. package/dist/{mesh-hPWBQPaN.js → mesh-DIWD2F5-.js} +51 -2
  9. package/dist/node.d.ts +2 -2
  10. package/dist/node.js +3 -2
  11. package/dist/{protocol-Dt0zgang.d.ts → protocol-DFR0JDAS.d.ts} +9 -1
  12. package/dist/r3f.d.ts +3 -3
  13. package/dist/r3f.js +2 -2
  14. package/dist/react.d.ts +2 -2
  15. package/dist/{scene-CXtM_bxV.js → scene-DUsj6uJD.js} +421 -29
  16. package/dist/{scene-like-Dq9_SaUL.d.ts → scene-like-CR_Dpohm.d.ts} +999 -133
  17. package/dist/{store-CIW19oCh.d.ts → store-8HWG90Jg.d.ts} +14 -3
  18. package/dist/{store-C9h7GFFl.js → store-BAzHRRkt.js} +18 -2
  19. package/dist/store.d.ts +3 -3
  20. package/dist/store.js +1 -1
  21. package/dist/three.d.ts +2 -2
  22. package/dist/three.js +1 -1
  23. package/dist/views-BSy-Qeg8.js +584 -0
  24. package/dist/wasm/fast_mesh_wasm.d.ts +21 -1
  25. package/dist/wasm/fast_mesh_wasm.js +50 -1
  26. package/dist/wasm/fast_mesh_wasm_bg.wasm +0 -0
  27. package/dist/wasm/fast_mesh_wasm_bg.wasm.d.ts +3 -0
  28. package/dist/wasm-threads/fast_mesh_wasm.d.ts +21 -1
  29. package/dist/wasm-threads/fast_mesh_wasm.js +50 -1
  30. package/dist/wasm-threads/fast_mesh_wasm_bg.wasm +0 -0
  31. package/dist/wasm-threads/fast_mesh_wasm_bg.wasm.d.ts +3 -0
  32. package/dist/web.d.ts +2 -2
  33. package/dist/web.js +3 -2
  34. package/dist/worker-engine.d.ts +5 -3
  35. package/dist/worker-engine.js +1 -1
  36. package/dist/worker-entry.js +1 -1
  37. package/dist/worker.d.ts +1 -1
  38. package/dist/worker.js +1 -1
  39. package/package.json +1 -1
  40. package/dist/views-mp7Mf8CQ.js +0 -209
@@ -1,4 +1,4 @@
1
- import { Tt as MeshHandle, t as SceneLike } from "./scene-like-Dq9_SaUL.js";
1
+ import { n as SceneLike, vr as MeshHandle } from "./scene-like-CR_Dpohm.js";
2
2
  import * as THREE from "three";
3
3
  /** Options of {@link bindMesh}. */
4
4
  interface BindMeshOptions {
@@ -122,7 +122,10 @@ type MeshBinding = Pick<BoundMesh, "mesh" | "object">;
122
122
  * Dead vertex slots keep stale positions, so the geometry's bounding box and
123
123
  * sphere are computed from the vertices of live triangles only (a removed
124
124
  * triangle reads `0, 0, 0` in the index). They are recomputed when positions
125
- * or indices change, never on placement-only frames.
125
+ * or indices change, never on placement-only frames. On a mesh of 65,536 vertex
126
+ * slots or more, a change that only moves up to an eighth of them grows them
127
+ * instead, so they can be larger than the mesh until 250 ms after the last such
128
+ * change.
126
129
  *
127
130
  * With `shading: "fragment"` the colour attribute is replaced by the
128
131
  * colouring's values (`fmValue`), coloured per fragment by a shader chunk the
@@ -61,6 +61,14 @@ const BUFFERS = {
61
61
  }
62
62
  };
63
63
  /**
64
+ * From this many vertex slots, a change that moves few of them grows the bounds
65
+ * over what moved and leaves the exact ones for when the edits pause: walking
66
+ * every slot on every frame of a sculpt stroke was its largest single cost.
67
+ */
68
+ const GROW_BOUNDS_MIN_SLOTS = 65536;
69
+ /** The bounds are made exact again this long after the last change that grew them. */
70
+ const SETTLE_BOUNDS_MS = 250;
71
+ /**
64
72
  * Binds a scene mesh to a new THREE.Mesh and keeps it in sync on every
65
73
  * {@link SceneLike.commitFrame}: dirty ranges are copied into the attributes'
66
74
  * mirrors and marked with `addUpdateRange`, attributes are recreated when the
@@ -71,7 +79,10 @@ const BUFFERS = {
71
79
  * Dead vertex slots keep stale positions, so the geometry's bounding box and
72
80
  * sphere are computed from the vertices of live triangles only (a removed
73
81
  * triangle reads `0, 0, 0` in the index). They are recomputed when positions
74
- * or indices change, never on placement-only frames.
82
+ * or indices change, never on placement-only frames. On a mesh of 65,536 vertex
83
+ * slots or more, a change that only moves up to an eighth of them grows them
84
+ * instead, so they can be larger than the mesh until 250 ms after the last such
85
+ * change.
75
86
  *
76
87
  * With `shading: "fragment"` the colour attribute is replaced by the
77
88
  * colouring's values (`fmValue`), coloured per fragment by a shader chunk the
@@ -238,6 +249,40 @@ function bindMesh(scene, mesh, options = {}) {
238
249
  for (let k = 0; k < t.length; k += 3) if (live(k)) for (let c = 0; c < 3; c++) r2 = Math.max(r2, sphere.center.distanceToSquared(point.fromArray(p, 3 * t[k + c])));
239
250
  sphere.radius = Math.sqrt(r2);
240
251
  };
252
+ let settleBounds;
253
+ /**
254
+ * Grows the bounds over the positions `change` moved, when that is all it did
255
+ * and it moved few of a large mesh's slots; they stay conservative until the
256
+ * edits pause. Returns whether it did: if not, the caller computes them.
257
+ */
258
+ const growBounds = (change) => {
259
+ const position = attributeOf("positions");
260
+ const box = geometry.boundingBox;
261
+ const sphere = geometry.boundingSphere;
262
+ const moved = change.positions;
263
+ if (position === void 0 || box === null || sphere === null || box.isEmpty() || moved === "all" || change.capacityChanged || change.indices === "all" || change.indices.length > 0 || vertexSlots < GROW_BOUNDS_MIN_SLOTS) return false;
264
+ let count = 0;
265
+ for (const [, n] of moved) count += n;
266
+ if (count * 8 > vertexSlots) return false;
267
+ const p = position.array;
268
+ for (const [start, n] of moved) for (let k = 3 * start; k < 3 * (start + n); k += 3) {
269
+ box.min.x = Math.min(box.min.x, p[k]);
270
+ box.min.y = Math.min(box.min.y, p[k + 1]);
271
+ box.min.z = Math.min(box.min.z, p[k + 2]);
272
+ box.max.x = Math.max(box.max.x, p[k]);
273
+ box.max.y = Math.max(box.max.y, p[k + 1]);
274
+ box.max.z = Math.max(box.max.z, p[k + 2]);
275
+ }
276
+ box.getCenter(sphere.center);
277
+ sphere.radius = box.min.distanceTo(box.max) / 2;
278
+ clearTimeout(settleBounds);
279
+ settleBounds = setTimeout(() => {
280
+ try {
281
+ computeBounds();
282
+ } catch {}
283
+ }, SETTLE_BOUNDS_MS);
284
+ return true;
285
+ };
241
286
  const updateMatrix = () => {
242
287
  object.matrix.fromArray(scene.matrix4(mesh));
243
288
  object.matrixWorldNeedsUpdate = true;
@@ -311,6 +356,7 @@ function bindMesh(scene, mesh, options = {}) {
311
356
  const detach = () => {
312
357
  unsubscribe?.();
313
358
  unsubscribe = void 0;
359
+ clearTimeout(settleBounds);
314
360
  };
315
361
  unsubscribe = scene.onChanges((changes) => {
316
362
  checkUntransformedParent(object);
@@ -320,7 +366,10 @@ function bindMesh(scene, mesh, options = {}) {
320
366
  detach();
321
367
  return;
322
368
  }
323
- if (apply(c)) computeBounds();
369
+ if (apply(c) && !growBounds(c)) {
370
+ clearTimeout(settleBounds);
371
+ computeBounds();
372
+ }
324
373
  if (c.placementChanged) updateMatrix();
325
374
  }
326
375
  });
package/dist/node.d.ts CHANGED
@@ -1,4 +1,4 @@
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";
1
+ import { $ as SculptDomain, $n as StretchReport, $t as FindContactsOptions, A as InspectDomain, An as RepairReport, Ar as Vec3, At as CaptureRestReport, B as WorkerDeformDomain, Bn as SectionGap, Bt as CurvatureFieldDesc, C as SimplifyOptions, Cn as RegisterOptions, Cr as Mat3, Ct as AnalyzeOptions, D as WorkerRemeshDomain, Dn as RemeshReport, Dr as Positions64, Dt as BooleanOp, E as VoxelRemeshOptions, En as RelaxReport, Er as Positions, Et as AutoRepairRequest, F as DeformBackend, Fn as SculptOp, Ft as ClosestPointOptions, G as ClayOp, Gn as SelfIntersectionMode, Gt as DragOptions, H as BeginStrokeOptions, Hn as SectionResult, Ht as CutReport, I as DeformDomain, In as SculptReport, It as ColorRule, J as FlattenOp, Jn as SimplifyReport, Jt as EditRef, K as CreaseOp, Kn as ShellReport, Kt as DragSession, L as DeformReturn, Ln as SculptReportOf, Lt as Colormap, M as SyncInspectDomain, Mn as Rgba, Mr as computeVertexNormals, Mt as ClayProfile, N as WorkerInspectDomain, Nn as Scene, Nt as ClayReport, O as createRemeshDomain, On as RemoveReport, Or as Quat, Ot as BoundaryLoop, P as createInspectDomain, Pn as SceneOptions, Pt as ClosestHit, Q as SculptBackend, Qn as SmoothReport, Qt as FilledLoop, R as ProtectedSculptOp, Rn as SectionContour, Rt as Contact, S as RemeshReturn, Sn as RegisterNotApplied, Sr as InitInput, St as Analysis, T as SyncRemeshDomain, Tn as RegisterStatus, Tr as PlacementInput, Tt as AutoRepairReport, U as CaptureRestOptions, Un as SelfIntersectOptions, Ut as DegenerateReport, V as createDeformDomain, Vn as SectionPlane, Vt as CutOptions, W as CaptureStrokeOptions, Wn as SelfIntersectReport, Wt as DistanceFieldDesc, X as InflateOp, Xn as SliverReport, Xt as FieldStatus, Y as GrabOp, Yn as SliverOptions, Yt as EditResult, Z as RelaxOp, Zn as SmoothMethod, Zt as FillReport, _ as WorkerRepairDomain, _n as OrientReport, _r as FieldHandle, _t as AlignReturn, a as WorkerSceneDomains, an as InflateReport, ar as TwistReport, at as WorkerSculptDomain, b as RemeshBackend, bn as RaycastOptions, br as Bounds, bt as createAlignDomain, c as CleanOptions, cn as LoopId, cr as MeshViews, ct as BooleanDomain, d as FillHolesOptions, dn as MeasureResult, dr as ComponentSelect, dt as ShellOptions, en as FlattenMode, er as SubdivideReport, et as SculptReturn, f as RepairBackend, fn as MeshChange, fr as IsolateReport, ft as SyncBooleanDomain, g as SyncRepairDomain, gn as OffsetReport, gr as Range, gt as AlignDomain, h as SmallComponentOptions, hn as OffsetAlgorithm, hr as VertexSelection, ht as AlignBackend, i as SyncSceneDomains, in as InflateMethod, ir as TwistMethod, it as TwistOp, j as InspectReturn, jn as RepairReportOf, jr as computeBounds, jt as CaptureStrokeReport, k as InspectBackend, kn as RepairOp, kr as UpdateMode, kt as BridgeReport, l as CleanReport, ln as ManifoldOptions, lr as SceneMeshViews, lt as BooleanReturn, m as RepairReturn, mn as MeshDistance, mr as SelectSpec, mt as createBooleanDomain, n as SceneLike, nn as GrabMethod, nr as Symmetry, nt as SplitStretchedOptions, o as AutoRepairOptions, on as JoinOptions, or as VertexProtection, ot as createSculptDomain, p as RepairDomain, pn as MeshComponent, pr as LassoSelect, pt as WorkerBooleanDomain, q as FilteredSculptOp, qn as SignMode, qt as EditOp, r as SceneDomains, rn as GrabReport, rr as ThicknessFieldDesc, rt as SyncSculptDomain, s as BridgeLoopsOptions, sn as JoinReport, sr as WeldReport, st as BooleanBackend, t as SceneDomainsLike, tn as FlattenReport, tr as SurfaceFilter, tt as SmoothOp, u as DegenerateOptions, un as ManifoldReport, ur as BrushSelect, ut as OffsetOptions, v as createRepairDomain, vn as OutOfRange, vr as MeshHandle, vt as SyncAlignDomain, w as SubdivideOptions, wn as RegisterResult, wr as Placement, wt as AutoRepairPreset, x as RemeshDomain, xn as RegisterMotion, xr as Indices, xt as AddMeshOptions, y as RegionRemeshOptions, yn as RayHit, yr as SectionHandle, yt as WorkerAlignDomain, z as SyncDeformDomain, zn as SectionDesc, zt as CreaseReport } from "./scene-like-CR_Dpohm.js";
2
2
  import { n as FastMeshErrorCode, t as FastMeshError } from "./core-CJ9D6U5A.js";
3
3
  /**
4
4
  * Resolves immediately: in Node.js and Bun the module is ready as soon as it is imported.
@@ -6,4 +6,4 @@ import { n as FastMeshErrorCode, t as FastMeshError } from "./core-CJ9D6U5A.js";
6
6
  * the argument is ignored.
7
7
  */
8
8
  export declare function init(_input?: InitInput | Promise<InitInput>): Promise<void>;
9
- 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 };
9
+ export { type AddMeshOptions, type AlignBackend, type AlignDomain, type AlignReturn, type Analysis, type AnalyzeOptions, type AutoRepairOptions, type AutoRepairPreset, type AutoRepairReport, type AutoRepairRequest, type BeginStrokeOptions, type BooleanBackend, type BooleanDomain, type BooleanOp, type BooleanReturn, type BoundaryLoop, type Bounds, type BridgeLoopsOptions, type BridgeReport, type BrushSelect, type CaptureRestOptions, type CaptureRestReport, type CaptureStrokeOptions, type CaptureStrokeReport, type ClayOp, type ClayProfile, type ClayReport, type CleanOptions, type CleanReport, type ClosestHit, type ClosestPointOptions, type ColorRule, type Colormap, type ComponentSelect, type Contact, type CreaseOp, type CreaseReport, type CurvatureFieldDesc, type CutOptions, type CutReport, type DeformBackend, type DeformDomain, type DeformReturn, type DegenerateOptions, type DegenerateReport, type DistanceFieldDesc, type DragOptions, type DragSession, type EditOp, type EditRef, type EditResult, FastMeshError, type FastMeshErrorCode, type FieldHandle, type FieldStatus, type FillHolesOptions, type FillReport, type FilledLoop, type FilteredSculptOp, type FindContactsOptions, type FlattenMode, type FlattenOp, type FlattenReport, type GrabMethod, type GrabOp, type GrabReport, type Indices, type InflateMethod, type InflateOp, type InflateReport, type InitInput, type InspectBackend, type InspectDomain, type InspectReturn, type IsolateReport, type JoinOptions, type JoinReport, type LassoSelect, type LoopId, type ManifoldOptions, type ManifoldReport, type Mat3, type MeasureResult, type MeshChange, type MeshComponent, type MeshDistance, type MeshHandle, type MeshViews, type OffsetAlgorithm, type OffsetOptions, type OffsetReport, type OrientReport, type OutOfRange, type Placement, type PlacementInput, type Positions, type Positions64, type ProtectedSculptOp, type Quat, type Range, type RayHit, type RaycastOptions, type RegionRemeshOptions, type RegisterMotion, type RegisterNotApplied, type RegisterOptions, type RegisterResult, type RegisterStatus, type RelaxOp, type RelaxReport, type RemeshBackend, type RemeshDomain, type RemeshReport, type RemeshReturn, type RemoveReport, type RepairBackend, type RepairDomain, type RepairOp, type RepairReport, type RepairReportOf, type RepairReturn, type Rgba, Scene, type SceneDomains, type SceneDomainsLike, type SceneLike, type SceneMeshViews, type SceneOptions, type SculptBackend, type SculptDomain, type SculptOp, type SculptReport, type SculptReportOf, type SculptReturn, type SectionContour, type SectionDesc, type SectionGap, type SectionHandle, type SectionPlane, type SectionResult, type SelectSpec, type SelfIntersectOptions, type SelfIntersectReport, type SelfIntersectionMode, type ShellOptions, type ShellReport, type SignMode, type SimplifyOptions, type SimplifyReport, type SliverOptions, type SliverReport, type SmallComponentOptions, type SmoothMethod, type SmoothOp, type SmoothReport, type SplitStretchedOptions, type StretchReport, type SubdivideOptions, type SubdivideReport, type SurfaceFilter, type Symmetry, type SyncAlignDomain, type SyncBooleanDomain, type SyncDeformDomain, type SyncInspectDomain, type SyncRemeshDomain, type SyncRepairDomain, type SyncSceneDomains, type SyncSculptDomain, type ThicknessFieldDesc, type TwistMethod, type TwistOp, type TwistReport, type UpdateMode, type Vec3, type VertexProtection, type VertexSelection, type VoxelRemeshOptions, type WeldReport, type WorkerAlignDomain, type WorkerBooleanDomain, type WorkerDeformDomain, type WorkerInspectDomain, type WorkerRemeshDomain, type WorkerRepairDomain, type WorkerSceneDomains, type WorkerSculptDomain, computeBounds, computeVertexNormals, createAlignDomain, createBooleanDomain, createDeformDomain, createInspectDomain, createRemeshDomain, createRepairDomain, createSculptDomain };
package/dist/node.js CHANGED
@@ -1,6 +1,7 @@
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-CXtM_bxV.js";
3
+ import { _ as createBooleanDomain, f as createSculptDomain, g as createDeformDomain, h as createInspectDomain, m as createRemeshDomain, p as createRepairDomain, v as createAlignDomain } from "./views-BSy-Qeg8.js";
4
+ import { t as Scene } from "./scene-DUsj6uJD.js";
4
5
  import { initSync } from "./wasm/fast_mesh_wasm.js";
5
6
  import { readFileSync } from "node:fs";
6
7
  // src/node.ts
@@ -13,4 +14,4 @@ markInitialized(initSync({ module: readFileSync(new URL("./wasm/fast_mesh_wasm_b
13
14
  function init(_input) {
14
15
  return Promise.resolve();
15
16
  }
16
- export { FastMeshError, Scene, computeBounds, computeVertexNormals, init };
17
+ export { FastMeshError, Scene, computeBounds, computeVertexNormals, createAlignDomain, createBooleanDomain, createDeformDomain, createInspectDomain, createRemeshDomain, createRepairDomain, createSculptDomain, init };
@@ -1,4 +1,4 @@
1
- import { f as ColorRule, n as AddMeshOptions, ot as SectionPlane, st as SectionResult, xt as Range, y as DistanceFieldDesc } from "./scene-like-Dq9_SaUL.js";
1
+ import { Hn as SectionResult, It as ColorRule, Vn as SectionPlane, Wt as DistanceFieldDesc, br as Bounds, gr as Range, xt as AddMeshOptions } from "./scene-like-CR_Dpohm.js";
2
2
  /** A mesh, field or section id allocated on the main side. Unique per kind. */
3
3
  type ClientId = number;
4
4
  /** A {@link ColorRule} naming its field by client id. */
@@ -149,6 +149,12 @@ type Request = {
149
149
  op: "add" | "set" | "remove";
150
150
  desc?: SectionDescWire;
151
151
  key?: string;
152
+ } |
153
+ /** `Scene.setFieldInteraction`. */
154
+ {
155
+ kind: "fieldInteraction";
156
+ rev: number;
157
+ points: number | null;
152
158
  } | {
153
159
  kind: "query";
154
160
  rev: number;
@@ -189,6 +195,8 @@ interface MeshChangeWire {
189
195
  /** Slot counts after the change; 0 for a removed mesh. */
190
196
  vertexSlots: number;
191
197
  triangleSlots: number;
198
+ /** Local-render bounds after a geometry change; omitted when geometry is unchanged. */
199
+ bounds?: Bounds | null;
192
200
  bytes: {
193
201
  positions: ArrayBuffer | null;
194
202
  normals: ArrayBuffer | null;
package/dist/r3f.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { Tt as MeshHandle } from "./scene-like-Dq9_SaUL.js";
2
- import { t as SceneStore } from "./store-CIW19oCh.js";
3
- import { n as BoundMesh, t as BindMeshOptions } from "./mesh-B3QP93wx.js";
1
+ import { vr as MeshHandle } from "./scene-like-CR_Dpohm.js";
2
+ import { t as SceneStore } from "./store-8HWG90Jg.js";
3
+ import { n as BoundMesh, t as BindMeshOptions } from "./mesh-BHTFxsXc.js";
4
4
  import * as THREE from "three";
5
5
  import { JSX } from "react";
6
6
  import { EventHandlers } from "@react-three/fiber";
package/dist/r3f.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { t as FastMeshError } from "./core-4OcWKu3r.js";
2
2
  import { c as useStoreSelector, i as useScene, l as StoreContext, t as SceneProvider } from "./react-DzrtrzZy.js";
3
3
  import { s as meshState } from "./snapshot-BkbGPspK.js";
4
- import { r as setFrameLoop } from "./store-C9h7GFFl.js";
5
- import { t as bindMesh } from "./mesh-hPWBQPaN.js";
4
+ import { r as setFrameLoop } from "./store-BAzHRRkt.js";
5
+ import { t as bindMesh } from "./mesh-DIWD2F5-.js";
6
6
  import * as THREE from "three";
7
7
  import { createElement, useCallback, useContext, useLayoutEffect, useRef, useState } from "react";
8
8
  import { useFrame, useThree } from "@react-three/fiber";
package/dist/react.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as FastMeshError } from "./core-CJ9D6U5A.js";
2
- import { Et as SectionHandle, Tt as MeshHandle } from "./scene-like-Dq9_SaUL.js";
3
- import { a as DisplayState, c as MeshState, d as SceneSnapshot, n as SectionPatch, p as SectionState, t as SceneStore } from "./store-CIW19oCh.js";
2
+ import { vr as MeshHandle, yr as SectionHandle } from "./scene-like-CR_Dpohm.js";
3
+ import { a as DisplayState, c as MeshState, d as SceneSnapshot, n as SectionPatch, p as SectionState, t as SceneStore } from "./store-8HWG90Jg.js";
4
4
  import { ReactElement, ReactNode } from "react";
5
5
  /** Provides `store` to the hooks below it. */
6
6
  export declare function SceneProvider(props: {