fast-mesh-wasm 0.6.0 → 0.8.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 +43 -3
- package/dist/client-CJWOKQMM.d.ts +664 -0
- package/dist/{client-BrTp2eMp.js → client-DQADH6KL.js} +1893 -109
- package/dist/{engine-DjdY3GxK.js → engine-D2124Vml.js} +995 -52
- package/dist/io.d.ts +205 -2
- package/dist/io.js +3063 -9
- package/dist/{mesh-DIWD2F5-.js → mesh-BtWBMRMO.js} +2 -1
- package/dist/{mesh-BsqIofgT.d.ts → mesh-DTm2Fnqa.d.ts} +3 -2
- package/dist/node.d.ts +4 -2
- package/dist/node.js +4 -3
- package/dist/primitives-6T0eQiSm.d.ts +157 -0
- package/dist/primitives-wasm-C30Bk4ut.js +3827 -0
- package/dist/primitives-wasm-d9m2vikb.d.ts +43 -0
- package/dist/{protocol-Ci9LLiwO.js → protocol-Bvjmvlb3.js} +38 -3
- package/dist/protocol-Da0kmXuF.d.ts +743 -0
- package/dist/r3f.d.ts +3 -3
- package/dist/r3f.js +3 -3
- package/dist/{react-DzrtrzZy.js → react-DIuy5dyR.js} +12 -3
- package/dist/react.d.ts +6 -3
- package/dist/react.js +1 -1
- package/dist/scene-like-Bx7lZKif.d.ts +4808 -0
- package/dist/{store-DIQmxF_s.js → store-BxzcXy9y.js} +431 -65
- package/dist/{store-BfC6kkf5.d.ts → store-LM3iU8E4.d.ts} +110 -11
- package/dist/store.d.ts +3 -3
- package/dist/store.js +1 -1
- package/dist/three.d.ts +13 -11
- package/dist/three.js +63 -18
- package/dist/views-DPMbo0Sl.js +3147 -0
- package/dist/wasm/fast_mesh_wasm.d.ts +548 -8
- package/dist/wasm/fast_mesh_wasm.js +2100 -89
- package/dist/wasm/fast_mesh_wasm_bg.wasm +0 -0
- package/dist/wasm/fast_mesh_wasm_bg.wasm.d.ts +95 -0
- package/dist/wasm-threads/fast_mesh_wasm.d.ts +548 -8
- package/dist/wasm-threads/fast_mesh_wasm.js +2101 -90
- package/dist/wasm-threads/fast_mesh_wasm_bg.wasm +0 -0
- package/dist/wasm-threads/fast_mesh_wasm_bg.wasm.d.ts +95 -0
- package/dist/wave6-wasm-Bt4vTlKz.js +146 -0
- package/dist/web.d.ts +4 -2
- package/dist/web.js +4 -3
- package/dist/worker-engine.d.ts +20 -2
- 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/api-4kz45-Mq.js +0 -63
- package/dist/client-Ds09vLkN.d.ts +0 -336
- package/dist/protocol-Cb23HelE.d.ts +0 -327
- package/dist/scene-D0HNTwoo.js +0 -2216
- package/dist/scene-like-CADk1vfb.d.ts +0 -1755
- package/dist/views-B00kdV0R.js +0 -214
|
@@ -90,7 +90,8 @@ const SETTLE_BOUNDS_MS = 250;
|
|
|
90
90
|
*
|
|
91
91
|
* When the scene mesh is removed, the binding detaches: it stops following
|
|
92
92
|
* the scene and leaves the object as it was (remove it from your THREE.Scene
|
|
93
|
-
* and call {@link BoundMesh.dispose}).
|
|
93
|
+
* and call {@link BoundMesh.dispose}). A mesh that undo or redo brings back
|
|
94
|
+
* needs a new binding.
|
|
94
95
|
*
|
|
95
96
|
* The object must sit under an untransformed parent (its `matrix` is a world
|
|
96
97
|
* matrix); a transformed ancestor is detected and warned about once.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as SceneLike, uo as MeshHandle } from "./scene-like-Bx7lZKif.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
/** Options of {@link bindMesh}. */
|
|
4
4
|
interface BindMeshOptions {
|
|
@@ -133,7 +133,8 @@ type MeshBinding = Pick<BoundMesh, "mesh" | "object">;
|
|
|
133
133
|
*
|
|
134
134
|
* When the scene mesh is removed, the binding detaches: it stops following
|
|
135
135
|
* the scene and leaves the object as it was (remove it from your THREE.Scene
|
|
136
|
-
* and call {@link BoundMesh.dispose}).
|
|
136
|
+
* and call {@link BoundMesh.dispose}). A mesh that undo or redo brings back
|
|
137
|
+
* needs a new binding.
|
|
137
138
|
*
|
|
138
139
|
* The object must sit under an untransformed parent (its `matrix` is a world
|
|
139
140
|
* matrix); a transformed ancestor is detected and warned about once.
|
package/dist/node.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as InflateOp, $a as ExtrudeBaseOptions, $i as FaceSelectionNormalCone, $n as RegisterStatus, $r as pointCloudVoxelDownsample, $t as DeviationOptions, A as WorkerRemeshDomain, Aa as PrimitiveKind, Ai as ConvexHullPoints, An as LandmarkPair, Ar as SmoothReport, At as AutoRepairRequest, B as DeformReturn, Ba as XpbdPinInput, Bi as CollisionPairOutcome, Bn as OrientReport, Br as ThicknessFieldDesc, Bt as ClayReport, C as RemeshDomain, Ca as PlaceMeshOptions, Ci as LatticeKind, Cn as GrabReport, Co as computeBounds, Cr as SelfIntersectionMode, Ct as WorkerAlignDomain, D as SurfaceRemeshOptions, Da as PlaceUpAxis, Di as LatticeRegion, Dn as JoinOptions, Dr as SliverOptions, Dt as AnalyzeOptions, E as SubdivideOptions, Ea as PlaceTransform, Ei as LatticePreview, En as InflateReport, Er as SimplifyReport, Et as Analysis, F as SyncInspectDomain, Fa as SplitFacesReport, Fi as ArapOptions, Fn as MeshChange, Fr as SurfacePathPoint, Ft as BridgeReport, G as BeginStrokeOptions, Gi as ContourExportFormat, Gn as QualityMetric, Gr as TwistReport, Gt as Colormap, H as SyncDeformDomain, Ha as unpackPointCloud, Hi as CollisionRule, Hn as OverhangOptions, Hr as TrimCurveOptions, Ht as ClosestPointOptions, I as WorkerInspectDomain, Ia as SurfaceReconstructMethod, Ii as ArapSolver, In as MeshComponent, Ir as SurfaceRemeshMode, It as BridgeStats, J as ClayOp, Ja as HeightMapOptions, Ji as CutTrigger, Jn as RaycastOptions, Jr as parsePointCloudBytes, Jt as CsgNode, K as CaptureRestOptions, Ka as HeightMap, Ki as ContourLoop, Kn as QualityReport, Kr as VertexProtection, Kt as Contact, L as createInspectDomain, La as SurfaceReconstructOptions, Li as ArapWeights, Ln as MeshDistance, Lr as SurfaceRemeshReport, Lt as CaptureRestReport, M as InspectBackend, Ma as ScreenSelectOptions, Mi as AdjacencyKind, Mn as ManifoldOptions, Mr as SubdivideReport, Mt as BooleanOp, N as InspectDomain, Na as ScreenSelectionShape, Ni as ArapAnchorInput, Nn as ManifoldReport, Nr as SurfaceFilter, Nt as BooleanOptions, O as SyncRemeshDomain, Oa as PointCloudFilterResult, Oi as LatticeReport, On as JoinReport, Or as SliverReport, Ot as AutoRepairPreset, P as InspectReturn, Pa as SoftDeformSolver, Pi as ArapHandleInput, Pn as MeasureResult, Pr as SurfacePathOptions, Pt as BoundaryLoop, Q as GrabOp, Qa as heightMapPlacement, Qi as FaceEditReport, Qn as RegisterResult, Qr as pointCloudSor, Qt as DegenerateReport, R as DeformBackend, Ra as XpbdHandleInput, Ri as CollisionDistanceBackend, Rn as OffsetAlgorithm, Rr as Symmetry, Rt as CaptureStrokeReport, S as RemeshBackend, Sa as ParsePointCloudOptions, Si as DEFAULT_LATTICE_PREVIEW_VOXELS, Sn as GrabMethod, So as Vec3, Sr as SelfIntersectReport, St as SyncAlignDomain, T as SimplifyOptions, Ta as PlaceMode, Ti as LatticePlan, Tn as InflateMethod, Tr as SignMode, Tt as AddMeshOptions, U as WorkerDeformDomain, Ua as AddHeightfieldOptions, Ui as CollisionRuleInput, Un as OverhangReport, Ur as TrimReport, Ut as CoarseAlignMethod, V as ProtectedSculptOp, Va as packPointCloud, Vi as CollisionRole, Vn as OutOfRange, Vr as TriangleQualityOptions, Vt as ClosestHit, W as createDeformDomain, Wi as CollisionStepReport, Wn as PartialBridgeOptions, Wr as TwistMethod, Wt as ColorRule, X as FilteredSculptOp, Xa as HeightfieldResult, Xi as DrainHoleOptions, Xn as RegisterNotApplied, Xr as pointCloudEstimateNormals, Xt as CutOptions, Y as CreaseOp, Ya as Heightfield, Yi as DEFAULT_COLLISION_RULE, Yn as RegisterMotion, Yr as parsePointCloudText, Yt as CurvatureFieldDesc, Z as FlattenOp, Za as MAX_HEIGHT_MAP_PIXELS, Zi as DrainHoleReport, Zn as RegisterOptions, Zr as pointCloudRor, Zt as CutReport, _ as WorkerRepairDomain, _a as KelvinletOptions, _i as WrapGridOptions, _n as FindContactsOptions, _o as PlacementInput, _r as SectionDesc, _t as WorkerBooleanDomain, a as WorkerSceneDomains, aa as FfdOptions, ai as IsolateReport, an as DyntopoMode, ao as DelaunayFlipReport, ar as RemoveReport, at as SmoothOp, b as IsotropicRemeshOptions, ba as OutlierReport, bi as WrapResult, bn as GeodesicMethod, bo as Quat, br as SectionResult, bt as AlignDomain, c as CleanOptions, ca as FittedPrimitive, ci as VertexSelection, cn as EditOp, co as SurfaceStats, cr as RepairReportOf, ct as TwistOp, d as FillHolesOptions, da as FreeformReport, di as HistoryEntry, dn as FieldStatus, do as SectionHandle, dr as SceneOptions, dt as BooleanBackend, ea as FfdBasis, ei as sliceContoursExport, en as DeviationStats, eo as ExtrudeBaseResult, er as RegistrationOptions, et as RelaxOp, f as RepairBackend, fa as FreeformScope, fi as PermanentListener, fn as FillContinuity, fo as Bounds, fr as SculptBrushOp, ft as BooleanDomain, g as SyncRepairDomain, ga as KelvinletLoad, gi as DEFAULT_WRAP_MAX_VOXELS, gn as FilledLoop, go as Placement, gr as SectionContour, gt as SyncBooleanDomain, h as SmallComponentOptions, ha as HollowReport, hi as DEFAULT_WRAP_DETAIL, hn as FillReport, ho as Mat3, hr as SculptReportOf, ht as ShellOptions, i as SyncSceneDomains, ia as FfdLatticeData, ii as ComponentSelect, in as DyntopoDabReport, io as DelaunayFlipOptions, ir as RemoveMeshOptions, it as SculptReturn, j as createRemeshDomain, ja as PrimitiveKindInput, ji as ConvexHullResult, jn as LoopId, jr as StretchReport, jt as BooleanMethod, k as VoxelRemeshOptions, ka as PointCloudFormat, ki as ConvexHullOptions, kn as LandmarkAlignment, kr as SmoothMethod, kt as AutoRepairReport, l as CleanReport, la as FittedPrimitiveReport, li as DEFAULT_HISTORY_BUDGET, ln as EditRef, lo as FieldHandle, lr as Rgba, lt as WorkerSculptDomain, m as RepairReturn, ma as HollowOptions, mi as Range, mn as FillHolesContinuityOptions, mo as InitInput, mr as SculptReport, mt as OffsetOptions, n as SceneLike, na as FfdFrameData, ni as SceneMeshViews, nn as DragOptions, no as ExtrudeFacesOptions, nr as RelaxReport, nt as SculptDabOptions, o as AutoRepairOptions, oa as FfdOutsideMode, oi as LassoSelect, on as DyntopoOptions, oo as DenoiseOptions, or as RepairOp, ot as SplitStretchedOptions, p as RepairDomain, pa as HollowBackend, pi as PermanentStep, pn as FillContinuityStats, po as Indices, pr as SculptOp, pt as BooleanReturn, q as CaptureStrokeOptions, qa as HeightMapFrame, qi as ContourSlice, qn as RayHit, qr as WeldReport, qt as CreaseReport, r as SceneDomains, ra as FfdLattice, ri as BrushSelect, rn as DragSession, ro as ExtrudeFacesResult, rr as RemeshReport, rt as SculptDomain, s as BridgeLoopsOptions, sa as FitPrimitiveOptions, si as SelectSpec, sn as DyntopoReport, so as DenoiseReport, sr as RepairReport, st as SyncSculptDomain, t as SceneDomainsLike, ta as FfdBasisInput, ti as MeshViews, tn as DistanceFieldDesc, to as ExtrudeDirection, tr as RegistrationReport, tt as SculptBackend, u as DegenerateOptions, ua as FreeformProtection, un as EditResult, uo as MeshHandle, ur as Scene, ut as createSculptDomain, v as createRepairDomain, va as KelvinletScale, vi as WrapOptions, vn as FlattenMode, vo as Positions, vr as SectionGap, vt as createBooleanDomain, w as RemeshReturn, wa as PlaceMeshReport, wi as LatticeOptions, wn as IcpObjective, wo as computeVertexNormals, wr as ShellReport, wt as createAlignDomain, x as RegionRemeshOptions, xa as PackedPointCloud, xi as DEFAULT_LATTICE_MAX_VOXELS, xn as GeodesicOptions, xo as UpdateMode, xr as SelfIntersectOptions, xt as AlignReturn, y as AdaptiveRemeshOptions, ya as MaterialMemory, yi as WrapPlan, yn as FlattenReport, yo as Positions64, yr as SectionPlane, yt as AlignBackend, z as DeformDomain, za as XpbdOptions, zi as CollisionMode, zn as OffsetReport, zr as SymmetryPlaneReport, zt as ClayProfile } from "./scene-like-Bx7lZKif.js";
|
|
2
2
|
import { n as FastMeshErrorCode, t as FastMeshError } from "./core-CJ9D6U5A.js";
|
|
3
|
+
import { n as generateHeightfield, t as generatePrimitive } from "./primitives-wasm-d9m2vikb.js";
|
|
4
|
+
import { a as IcosphereShape, c as PrimitiveAxis, d as PrimitiveShapeKind, f as PrismShape, i as CylinderShape, l as PrimitiveMesh, m as UvSphereShape, n as BoxShape, o as PRIMITIVE_SHAPE_KINDS, p as TorusShape, r as ConeShape, s as PlaneShape, t as ArrowShape, u as PrimitiveShape } from "./primitives-6T0eQiSm.js";
|
|
3
5
|
/**
|
|
4
6
|
* Resolves immediately: in Node.js and Bun the module is ready as soon as it is imported.
|
|
5
7
|
* Accepts the same argument as the browser `init()` so the same code runs everywhere;
|
|
6
8
|
* the argument is ignored.
|
|
7
9
|
*/
|
|
8
10
|
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 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 };
|
|
11
|
+
export { type AdaptiveRemeshOptions, type AddHeightfieldOptions, type AddMeshOptions, type AdjacencyKind, type AlignBackend, type AlignDomain, type AlignReturn, type Analysis, type AnalyzeOptions, type ArapAnchorInput, type ArapHandleInput, type ArapOptions, type ArapSolver, type ArapWeights, type ArrowShape, type AutoRepairOptions, type AutoRepairPreset, type AutoRepairReport, type AutoRepairRequest, type BeginStrokeOptions, type BooleanBackend, type BooleanDomain, type BooleanMethod, type BooleanOp, type BooleanOptions, type BooleanReturn, type BoundaryLoop, type Bounds, type BoxShape, type BridgeLoopsOptions, type BridgeReport, type BridgeStats, 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 CoarseAlignMethod, type CollisionDistanceBackend, type CollisionMode, type CollisionPairOutcome, type CollisionRole, type CollisionRule, type CollisionRuleInput, type CollisionStepReport, type ColorRule, type Colormap, type ComponentSelect, type ConeShape, type Contact, type ContourExportFormat, type ContourLoop, type ContourSlice, type ConvexHullOptions, type ConvexHullPoints, type ConvexHullResult, type CreaseOp, type CreaseReport, type CsgNode, type CurvatureFieldDesc, type CutOptions, type CutReport, type CutTrigger, type CylinderShape, DEFAULT_COLLISION_RULE, DEFAULT_HISTORY_BUDGET, DEFAULT_LATTICE_MAX_VOXELS, DEFAULT_LATTICE_PREVIEW_VOXELS, DEFAULT_WRAP_DETAIL, DEFAULT_WRAP_MAX_VOXELS, type DeformBackend, type DeformDomain, type DeformReturn, type DegenerateOptions, type DegenerateReport, type DelaunayFlipOptions, type DelaunayFlipReport, type DenoiseOptions, type DenoiseReport, type DeviationOptions, type DeviationStats, type DistanceFieldDesc, type DragOptions, type DragSession, type DrainHoleOptions, type DrainHoleReport, type DyntopoDabReport, type DyntopoMode, type DyntopoOptions, type DyntopoReport, type EditOp, type EditRef, type EditResult, type ExtrudeBaseOptions, type ExtrudeBaseResult, type ExtrudeDirection, type ExtrudeFacesOptions, type ExtrudeFacesResult, type FaceEditReport, type FaceSelectionNormalCone, FastMeshError, type FastMeshErrorCode, type FfdBasis, type FfdBasisInput, type FfdFrameData, type FfdLattice, type FfdLatticeData, type FfdOptions, type FfdOutsideMode, type FieldHandle, type FieldStatus, type FillContinuity, type FillContinuityStats, type FillHolesContinuityOptions, type FillHolesOptions, type FillReport, type FilledLoop, type FilteredSculptOp, type FindContactsOptions, type FitPrimitiveOptions, type FittedPrimitive, type FittedPrimitiveReport, type FlattenMode, type FlattenOp, type FlattenReport, type FreeformProtection, type FreeformReport, type FreeformScope, type GeodesicMethod, type GeodesicOptions, type GrabMethod, type GrabOp, type GrabReport, type HeightMap, type HeightMapFrame, type HeightMapOptions, type Heightfield, type HeightfieldResult, type HistoryEntry, type HollowBackend, type HollowOptions, type HollowReport, type IcosphereShape, type IcpObjective, type Indices, type InflateMethod, type InflateOp, type InflateReport, type InitInput, type InspectBackend, type InspectDomain, type InspectReturn, type IsolateReport, type IsotropicRemeshOptions, type JoinOptions, type JoinReport, type KelvinletLoad, type KelvinletOptions, type KelvinletScale, type LandmarkAlignment, type LandmarkPair, type LassoSelect, type LatticeKind, type LatticeOptions, type LatticePlan, type LatticePreview, type LatticeRegion, type LatticeReport, type LoopId, MAX_HEIGHT_MAP_PIXELS, type ManifoldOptions, type ManifoldReport, type Mat3, type MaterialMemory, type MeasureResult, type MeshChange, type MeshComponent, type MeshDistance, type MeshHandle, type MeshViews, type OffsetAlgorithm, type OffsetOptions, type OffsetReport, type OrientReport, type OutOfRange, type OutlierReport, type OverhangOptions, type OverhangReport, PRIMITIVE_SHAPE_KINDS, type PackedPointCloud, type ParsePointCloudOptions, type PartialBridgeOptions, type PermanentListener, type PermanentStep, type PlaceMeshOptions, type PlaceMeshReport, type PlaceMode, type PlaceTransform, type PlaceUpAxis, type Placement, type PlacementInput, type PlaneShape, type PointCloudFilterResult, type PointCloudFormat, type Positions, type Positions64, type PrimitiveAxis, type PrimitiveKind, type PrimitiveKindInput, type PrimitiveMesh, type PrimitiveShape, type PrimitiveShapeKind, type PrismShape, type ProtectedSculptOp, type QualityMetric, type QualityReport, type Quat, type Range, type RayHit, type RaycastOptions, type RegionRemeshOptions, type RegisterMotion, type RegisterNotApplied, type RegisterOptions, type RegisterResult, type RegisterStatus, type RegistrationOptions, type RegistrationReport, type RelaxOp, type RelaxReport, type RemeshBackend, type RemeshDomain, type RemeshReport, type RemeshReturn, type RemoveMeshOptions, 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 ScreenSelectOptions, type ScreenSelectionShape, type SculptBackend, type SculptBrushOp, type SculptDabOptions, 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 SoftDeformSolver, type SplitFacesReport, type SplitStretchedOptions, type StretchReport, type SubdivideOptions, type SubdivideReport, type SurfaceFilter, type SurfacePathOptions, type SurfacePathPoint, type SurfaceReconstructMethod, type SurfaceReconstructOptions, type SurfaceRemeshMode, type SurfaceRemeshOptions, type SurfaceRemeshReport, type SurfaceStats, type Symmetry, type SymmetryPlaneReport, type SyncAlignDomain, type SyncBooleanDomain, type SyncDeformDomain, type SyncInspectDomain, type SyncRemeshDomain, type SyncRepairDomain, type SyncSceneDomains, type SyncSculptDomain, type ThicknessFieldDesc, type TorusShape, type TriangleQualityOptions, type TrimCurveOptions, type TrimReport, type TwistMethod, type TwistOp, type TwistReport, type UpdateMode, type UvSphereShape, 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, type WrapGridOptions, type WrapOptions, type WrapPlan, type WrapResult, type XpbdHandleInput, type XpbdOptions, type XpbdPinInput, computeBounds, computeVertexNormals, createAlignDomain, createBooleanDomain, createDeformDomain, createInspectDomain, createRemeshDomain, createRepairDomain, createSculptDomain, generateHeightfield, generatePrimitive, heightMapPlacement, packPointCloud, parsePointCloudBytes, parsePointCloudText, pointCloudEstimateNormals, pointCloudRor, pointCloudSor, pointCloudVoxelDownsample, sliceContoursExport, unpackPointCloud };
|
package/dist/node.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as pointCloudSor, c as computeBounds, i as pointCloudRor, l as computeVertexNormals, n as parsePointCloudText, o as pointCloudVoxelDownsample, r as pointCloudEstimateNormals, s as sliceContoursExport, t as parsePointCloudBytes, u as markInitialized } from "./wave6-wasm-Bt4vTlKz.js";
|
|
2
2
|
import { t as FastMeshError } from "./core-4OcWKu3r.js";
|
|
3
|
-
import {
|
|
3
|
+
import { An as heightMapPlacement, It as packPointCloud, J as DEFAULT_COLLISION_RULE, Lt as unpackPointCloud, O as DEFAULT_LATTICE_MAX_VOXELS, _ as createDeformDomain, _n as PRIMITIVE_SHAPE_KINDS, b as DEFAULT_WRAP_DETAIL, bn as MAX_HEIGHT_MAP_PIXELS, g as createInspectDomain, h as createRemeshDomain, k as DEFAULT_LATTICE_PREVIEW_VOXELS, m as createRepairDomain, o as DEFAULT_HISTORY_BUDGET, p as createSculptDomain, v as createBooleanDomain, x as DEFAULT_WRAP_MAX_VOXELS, y as createAlignDomain } from "./views-DPMbo0Sl.js";
|
|
4
|
+
import { a as Scene, i as generateHeightfield, n as generatePrimitive } from "./primitives-wasm-C30Bk4ut.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 { DEFAULT_COLLISION_RULE, DEFAULT_HISTORY_BUDGET, DEFAULT_LATTICE_MAX_VOXELS, DEFAULT_LATTICE_PREVIEW_VOXELS, DEFAULT_WRAP_DETAIL, DEFAULT_WRAP_MAX_VOXELS, FastMeshError, MAX_HEIGHT_MAP_PIXELS, PRIMITIVE_SHAPE_KINDS, Scene, computeBounds, computeVertexNormals, createAlignDomain, createBooleanDomain, createDeformDomain, createInspectDomain, createRemeshDomain, createRepairDomain, createSculptDomain, generateHeightfield, generatePrimitive, heightMapPlacement, init, packPointCloud, parsePointCloudBytes, parsePointCloudText, pointCloudEstimateNormals, pointCloudRor, pointCloudSor, pointCloudVoxelDownsample, sliceContoursExport, unpackPointCloud };
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { So as Vec3 } from "./scene-like-Bx7lZKif.js";
|
|
2
|
+
/** The axis a shape of revolution turns around, or a plane's normal. */
|
|
3
|
+
type PrimitiveAxis = "x" | "y" | "z";
|
|
4
|
+
/**
|
|
5
|
+
* A box with a size per axis, its faces split into grids. Exact: its volume
|
|
6
|
+
* is the product of its sizes.
|
|
7
|
+
*/
|
|
8
|
+
interface BoxShape {
|
|
9
|
+
kind: "box";
|
|
10
|
+
/** Extent along X, Y and Z, or one number for a cube. Default `1`. */
|
|
11
|
+
size?: number | Readonly<Vec3>;
|
|
12
|
+
/** Grid cells along X, Y and Z (whole numbers, at least 1), or one number for all three. Default `1`. */
|
|
13
|
+
segments?: number | Readonly<Vec3>;
|
|
14
|
+
}
|
|
15
|
+
/** A capped cylinder around `axis`. */
|
|
16
|
+
interface CylinderShape {
|
|
17
|
+
kind: "cylinder";
|
|
18
|
+
/** Default `0.5`. */
|
|
19
|
+
radius?: number;
|
|
20
|
+
/** Extent along the axis. Default `1`. */
|
|
21
|
+
height?: number;
|
|
22
|
+
/** Sides around the axis, at least 3. Default `32`. */
|
|
23
|
+
segments?: number;
|
|
24
|
+
/** Bands along the axis, at least 1. Default `1`. */
|
|
25
|
+
rings?: number;
|
|
26
|
+
/** Concentric bands of each cap, at least 1. Default `1` (a fan). */
|
|
27
|
+
capRings?: number;
|
|
28
|
+
/** Default `"y"`. */
|
|
29
|
+
axis?: PrimitiveAxis;
|
|
30
|
+
}
|
|
31
|
+
/** A cone around `axis`, or a frustum when both radii are positive. */
|
|
32
|
+
interface ConeShape {
|
|
33
|
+
kind: "cone";
|
|
34
|
+
/** Radius at `-axis`; `0` puts the apex there. Default `0.5`. */
|
|
35
|
+
radius?: number;
|
|
36
|
+
/** Radius at `+axis`; `0` (the default) puts the apex there. */
|
|
37
|
+
topRadius?: number;
|
|
38
|
+
/** Extent along the axis. Default `1`. */
|
|
39
|
+
height?: number;
|
|
40
|
+
/** Sides around the axis, at least 3. Default `32`. */
|
|
41
|
+
segments?: number;
|
|
42
|
+
/** Bands along the axis, at least 1. Default `1`. */
|
|
43
|
+
rings?: number;
|
|
44
|
+
/** Concentric bands of each cap, at least 1. Default `1` (a fan). */
|
|
45
|
+
capRings?: number;
|
|
46
|
+
/** Default `"y"`. */
|
|
47
|
+
axis?: PrimitiveAxis;
|
|
48
|
+
}
|
|
49
|
+
/** A latitude-longitude sphere with a vertex at each pole, on `axis`. */
|
|
50
|
+
interface UvSphereShape {
|
|
51
|
+
kind: "uvSphere";
|
|
52
|
+
/** Default `0.5`. */
|
|
53
|
+
radius?: number;
|
|
54
|
+
/** Meridians, at least 3. Default `32`. */
|
|
55
|
+
segments?: number;
|
|
56
|
+
/** Latitude bands from pole to pole, at least 2. Default `16`. */
|
|
57
|
+
rings?: number;
|
|
58
|
+
/** The pole axis. Default `"y"`. */
|
|
59
|
+
axis?: PrimitiveAxis;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A geodesic sphere: an icosahedron whose faces are split into triangular
|
|
63
|
+
* grids and pushed onto the sphere. Its triangles are near equal in size.
|
|
64
|
+
*/
|
|
65
|
+
interface IcosphereShape {
|
|
66
|
+
kind: "icosphere";
|
|
67
|
+
/** Default `0.5`. */
|
|
68
|
+
radius?: number;
|
|
69
|
+
/** Each level splits every triangle into four: `20 · 4^subdivisions` triangles. At most 16. Default `3`. */
|
|
70
|
+
subdivisions?: number;
|
|
71
|
+
}
|
|
72
|
+
/** A ring torus around `axis`. */
|
|
73
|
+
interface TorusShape {
|
|
74
|
+
kind: "torus";
|
|
75
|
+
/** From the axis to the tube's centre. Default `0.4`. */
|
|
76
|
+
majorRadius?: number;
|
|
77
|
+
/** The tube's radius, below `majorRadius`. Default `0.1`. */
|
|
78
|
+
minorRadius?: number;
|
|
79
|
+
/** Sides around the axis, at least 3. Default `48`. */
|
|
80
|
+
segments?: number;
|
|
81
|
+
/** Sides around the tube, at least 3. Default `24`. */
|
|
82
|
+
tubeSegments?: number;
|
|
83
|
+
/** Default `"y"`. */
|
|
84
|
+
axis?: PrimitiveAxis;
|
|
85
|
+
}
|
|
86
|
+
/** An arrow, a capped shaft and a cone head, pointing to `+axis`. */
|
|
87
|
+
interface ArrowShape {
|
|
88
|
+
kind: "arrow";
|
|
89
|
+
/** From the tail to the tip. Default `1`. */
|
|
90
|
+
length?: number;
|
|
91
|
+
/** Default `0.05`. */
|
|
92
|
+
shaftRadius?: number;
|
|
93
|
+
/** The head's base radius, above `shaftRadius`. Default `0.1`. */
|
|
94
|
+
headRadius?: number;
|
|
95
|
+
/** The head's extent along the axis, below `length`. Default `0.25`. */
|
|
96
|
+
headLength?: number;
|
|
97
|
+
/** Sides around the axis, at least 3. Default `32`. */
|
|
98
|
+
segments?: number;
|
|
99
|
+
/** Default `"y"`. */
|
|
100
|
+
axis?: PrimitiveAxis;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A right prism over a regular polygon, along `axis`. Exact. One corner
|
|
104
|
+
* lies on `+z` for the `"y"` axis, on `+x` for `"z"` and on `+y` for `"x"`.
|
|
105
|
+
*/
|
|
106
|
+
interface PrismShape {
|
|
107
|
+
kind: "prism";
|
|
108
|
+
/** Corners of the polygon, at least 3. Default `6`. */
|
|
109
|
+
sides?: number;
|
|
110
|
+
/** From the axis to each corner (the circumradius). Default `0.5`. */
|
|
111
|
+
radius?: number;
|
|
112
|
+
/** Extent along the axis. Default `1`. */
|
|
113
|
+
height?: number;
|
|
114
|
+
/** Default `"y"`. */
|
|
115
|
+
axis?: PrimitiveAxis;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A flat rectangular grid facing `+axis`: open, the one shape with a
|
|
119
|
+
* boundary.
|
|
120
|
+
*/
|
|
121
|
+
interface PlaneShape {
|
|
122
|
+
kind: "plane";
|
|
123
|
+
/**
|
|
124
|
+
* Extents along the other two axes in `x, y, z` order (for the default
|
|
125
|
+
* `"y"` normal: X, then Z), or one number for a square. Default `1`.
|
|
126
|
+
*/
|
|
127
|
+
size?: number | readonly [number, number];
|
|
128
|
+
/** Grid cells along the same two axes (at least 1), or one number for both. Default `1`. */
|
|
129
|
+
segments?: number | readonly [number, number];
|
|
130
|
+
/** The normal. Default `"y"`. */
|
|
131
|
+
axis?: PrimitiveAxis;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A primitive shape and its parameters, for `generatePrimitive`. Every shape
|
|
135
|
+
* is centred on the origin, welded (one vertex per point of the surface),
|
|
136
|
+
* closed (except the plane: no boundary edges) and wound counter-clockwise
|
|
137
|
+
* seen from outside, so its normals point outward and its signed volume is
|
|
138
|
+
* positive. Curved shapes are inscribed polygons: their volume approaches
|
|
139
|
+
* the analytic one from below as the resolution grows.
|
|
140
|
+
*
|
|
141
|
+
* Lengths must be finite and in `[1e-30, 1e30]`; resolutions are whole
|
|
142
|
+
* numbers with the lower bound each one names. A shape with more vertices
|
|
143
|
+
* or triangles than `u32` ids can name is refused.
|
|
144
|
+
*/
|
|
145
|
+
type PrimitiveShape = BoxShape | CylinderShape | ConeShape | UvSphereShape | IcosphereShape | TorusShape | ArrowShape | PrismShape | PlaneShape;
|
|
146
|
+
/** The kinds of {@link PrimitiveShape}. */
|
|
147
|
+
type PrimitiveShapeKind = PrimitiveShape["kind"];
|
|
148
|
+
/** Every {@link PrimitiveShapeKind}, in a stable order (for pickers). */
|
|
149
|
+
declare const PRIMITIVE_SHAPE_KINDS: readonly PrimitiveShapeKind[];
|
|
150
|
+
/** A generated primitive: flat positions and triangle indices, ready for `addMesh` or a GPU vertex and index buffer. */
|
|
151
|
+
interface PrimitiveMesh {
|
|
152
|
+
/** 3 per vertex, centred on the origin. */
|
|
153
|
+
positions: Float32Array;
|
|
154
|
+
/** 3 per triangle, counter-clockwise seen from outside. */
|
|
155
|
+
indices: Uint32Array;
|
|
156
|
+
}
|
|
157
|
+
export { IcosphereShape as a, PrimitiveAxis as c, PrimitiveShapeKind as d, PrismShape as f, CylinderShape as i, PrimitiveMesh as l, UvSphereShape as m, BoxShape as n, PRIMITIVE_SHAPE_KINDS as o, TorusShape as p, ConeShape as r, PlaneShape as s, ArrowShape as t, PrimitiveShape as u };
|