@meshioplusplus/wasm 17.7.0 → 17.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/dist/meshioplusplus_wasm.mjs +1 -1
- package/dist/meshioplusplus_wasm.wasm +0 -0
- package/dist/meshioplusplus_wasm_full.mjs +1 -1
- package/dist/meshioplusplus_wasm_full.wasm +0 -0
- package/dist/meshioplusplus_wasm_full_mt.mjs +1 -1
- package/dist/meshioplusplus_wasm_full_mt.wasm +0 -0
- package/dist/meshioplusplus_wasm_mt.mjs +1 -1
- package/dist/meshioplusplus_wasm_mt.wasm +0 -0
- package/index.d.ts +84 -0
- package/package.json +1 -1
- package/src/index.mjs +30 -0
package/index.d.ts
CHANGED
|
@@ -902,6 +902,36 @@ export type OpSpec =
|
|
|
902
902
|
maxCells?: number;
|
|
903
903
|
sign?: SdfSign;
|
|
904
904
|
}
|
|
905
|
+
| {
|
|
906
|
+
/**
|
|
907
|
+
* An octree (quadtree for a planar `line` skin) around the mesh: leaves
|
|
908
|
+
* are fine only where the skin is. Like `voxelize` it replaces the
|
|
909
|
+
* geometry; the result carries `octree:level`/`octree:cut` cell data and
|
|
910
|
+
* `octree:hanging` point data.
|
|
911
|
+
*/
|
|
912
|
+
op: 'octree';
|
|
913
|
+
rootCells?: number[];
|
|
914
|
+
minLevel?: number;
|
|
915
|
+
maxLevel?: number;
|
|
916
|
+
bounds?: number[];
|
|
917
|
+
padding?: number;
|
|
918
|
+
paddingRelative?: number;
|
|
919
|
+
dimension?: number;
|
|
920
|
+
sampleDistance?: number;
|
|
921
|
+
balance?: OctreeBalance;
|
|
922
|
+
fill?: VoxelFill;
|
|
923
|
+
attachDistance?: boolean;
|
|
924
|
+
evenOdd?: boolean;
|
|
925
|
+
maxCells?: number;
|
|
926
|
+
sign?: SdfSign;
|
|
927
|
+
transition?: OctreeTransition;
|
|
928
|
+
snap?: boolean;
|
|
929
|
+
surfaceLevel?: number;
|
|
930
|
+
curvatureThreshold?: number;
|
|
931
|
+
featureAngle?: number;
|
|
932
|
+
sizeArray?: string;
|
|
933
|
+
plane?: PlanarPlane;
|
|
934
|
+
}
|
|
905
935
|
| {
|
|
906
936
|
/**
|
|
907
937
|
* A signed distance field: a grid over the mesh's surface, filled. Like
|
|
@@ -971,6 +1001,15 @@ export type GradientOperator = 'gradient' | 'divergence' | 'curl';
|
|
|
971
1001
|
/** Which cells `voxelize` keeps. See doc/voxelize.md. */
|
|
972
1002
|
export type VoxelFill = 'all' | 'surface' | 'inside';
|
|
973
1003
|
|
|
1004
|
+
/** How strictly `octree` keeps neighbouring leaves the same size. See doc/octree.md. */
|
|
1005
|
+
export type OctreeBalance = 'none' | 'face' | 'full';
|
|
1006
|
+
|
|
1007
|
+
/** What `octree` emits where a fine leaf meets a coarse one. See doc/octree.md. */
|
|
1008
|
+
export type OctreeTransition = 'hanging' | 'polyhedra' | 'templates';
|
|
1009
|
+
|
|
1010
|
+
/** The plane of a 2-D skin. */
|
|
1011
|
+
export type PlanarPlane = 'auto' | 'xy' | 'xz' | 'yz';
|
|
1012
|
+
|
|
974
1013
|
/** How a signed distance decides which side of the surface a point is on. */
|
|
975
1014
|
export type SdfSign = 'unsigned' | 'pseudonormal' | 'winding-number';
|
|
976
1015
|
|
|
@@ -2046,6 +2085,51 @@ export interface MeshioPlusPlusModule {
|
|
|
2046
2085
|
numOccupied: number;
|
|
2047
2086
|
};
|
|
2048
2087
|
|
|
2088
|
+
/**
|
|
2089
|
+
* Build an octree (a quadtree for a planar `line` skin) around a mesh: leaves
|
|
2090
|
+
* are fine only where the skin is. `balance` keeps neighbours within 2:1;
|
|
2091
|
+
* `fill` is as for `voxelize`. Pass `null` for `rootCells`/`bounds` to take the
|
|
2092
|
+
* defaults.
|
|
2093
|
+
* @throws {Error} on an empty or oversized level range, an unknown
|
|
2094
|
+
* `balance`/`fill`/`sign`, an open polyline with `fill: 'inside'`, or when
|
|
2095
|
+
* the tree exceeds `maxCells`.
|
|
2096
|
+
*/
|
|
2097
|
+
octree(
|
|
2098
|
+
mesh: Mesh,
|
|
2099
|
+
rootCells?: number[] | null,
|
|
2100
|
+
minLevel?: number,
|
|
2101
|
+
maxLevel?: number,
|
|
2102
|
+
bounds?: number[] | null,
|
|
2103
|
+
padding?: number,
|
|
2104
|
+
paddingRelative?: number,
|
|
2105
|
+
dimension?: number,
|
|
2106
|
+
sampleDistance?: number,
|
|
2107
|
+
balance?: OctreeBalance,
|
|
2108
|
+
fill?: VoxelFill,
|
|
2109
|
+
sign?: SdfSign,
|
|
2110
|
+
attachDistance?: boolean,
|
|
2111
|
+
evenOdd?: boolean,
|
|
2112
|
+
maxCells?: number,
|
|
2113
|
+
watertightCheck?: SdfWatertightCheck,
|
|
2114
|
+
transition?: OctreeTransition,
|
|
2115
|
+
snap?: boolean,
|
|
2116
|
+
surfaceLevel?: number,
|
|
2117
|
+
curvatureThreshold?: number,
|
|
2118
|
+
featureAngle?: number,
|
|
2119
|
+
sizeArray?: string,
|
|
2120
|
+
plane?: PlanarPlane,
|
|
2121
|
+
): {
|
|
2122
|
+
mesh: Mesh;
|
|
2123
|
+
dimension: number;
|
|
2124
|
+
numLeaves: number;
|
|
2125
|
+
numHanging: number;
|
|
2126
|
+
finestLevel: number;
|
|
2127
|
+
origin: number[];
|
|
2128
|
+
rootSize: number;
|
|
2129
|
+
numSnapped: number;
|
|
2130
|
+
numRefused: number;
|
|
2131
|
+
};
|
|
2132
|
+
|
|
2049
2133
|
/** What is wrong with a surface, in numbers rather than a bare flag. */
|
|
2050
2134
|
surfaceWatertightCheck(mesh: Mesh): {
|
|
2051
2135
|
boundaryEdges: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshioplusplus/wasm",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.8.0",
|
|
4
4
|
"description": "meshio++ mesh I/O compiled to WebAssembly: read 80 and write 75 mesh formats (incl. MED, CGNS, Exodus; STEP and IGES in the full build) in the browser or Node.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.mjs",
|
package/src/index.mjs
CHANGED
|
@@ -276,6 +276,7 @@ export class MeshioPlusPlusLoadError extends Error {
|
|
|
276
276
|
* isosurface: (mesh: Mesh, array: string, isovalues: number|number[], component?: number, recordParentIds?: boolean) => Mesh,
|
|
277
277
|
* grid: (dims: number[], origin?: number[], spacing?: number[], maxCells?: number) => Mesh,
|
|
278
278
|
* voxelize: (mesh: Mesh, resolution?: number[], cellSize?: number, bounds?: number[], padding?: number, paddingRelative?: number, fill?: string, sign?: string, attachOccupancy?: boolean, maxCells?: number, watertightCheck?: string) => {mesh: Mesh, dims: number[], origin: number[], spacing: number[], numOccupied: number},
|
|
279
|
+
* octree: (mesh: Mesh, rootCells?: number[], minLevel?: number, maxLevel?: number, bounds?: number[], padding?: number, paddingRelative?: number, dimension?: number, sampleDistance?: number, balance?: string, fill?: string, sign?: string, attachDistance?: boolean, evenOdd?: boolean, maxCells?: number, watertightCheck?: string, transition?: string, snap?: boolean, surfaceLevel?: number, curvatureThreshold?: number, featureAngle?: number, sizeArray?: string, plane?: string) => {mesh: Mesh, dimension: number, numLeaves: number, numHanging: number, finestLevel: number, origin: number[], rootSize: number, numSnapped: number, numRefused: number},
|
|
279
280
|
* surfaceWatertightCheck: (mesh: Mesh) => {boundaryEdges: number, nonManifoldEdges: number, inconsistentPairs: number, degenerateTriangles: number, watertight: boolean},
|
|
280
281
|
* sampleDistance: (surface: Mesh, points: number[], sign?: string, band?: number, watertightCheck?: string) => Float64Array,
|
|
281
282
|
* distanceToSurface: (query: Mesh, surface: Mesh, sign?: string, location?: string, band?: number, recordInside?: boolean, watertightCheck?: string) => {mesh: Mesh, numBanded: number, quality: object},
|
|
@@ -755,6 +756,35 @@ export async function loadMeshioPlusPlus(
|
|
|
755
756
|
) =>
|
|
756
757
|
Module.voxelize(mesh, resolution, cellSize, bounds, padding, paddingRelative,
|
|
757
758
|
fill, sign, attachOccupancy, maxCells, watertightCheck),
|
|
759
|
+
octree: (
|
|
760
|
+
mesh,
|
|
761
|
+
rootCells = null,
|
|
762
|
+
minLevel = 0,
|
|
763
|
+
maxLevel = 4,
|
|
764
|
+
bounds = null,
|
|
765
|
+
padding = 0,
|
|
766
|
+
paddingRelative = 0,
|
|
767
|
+
dimension = 0,
|
|
768
|
+
sampleDistance = 0,
|
|
769
|
+
balance = 'face',
|
|
770
|
+
fill = 'all',
|
|
771
|
+
sign = 'pseudonormal',
|
|
772
|
+
attachDistance = false,
|
|
773
|
+
evenOdd = false,
|
|
774
|
+
maxCells = 20000000,
|
|
775
|
+
watertightCheck = 'warn',
|
|
776
|
+
transition = 'hanging',
|
|
777
|
+
snap = false,
|
|
778
|
+
surfaceLevel = -1,
|
|
779
|
+
curvatureThreshold = 0,
|
|
780
|
+
featureAngle = 0,
|
|
781
|
+
sizeArray = '',
|
|
782
|
+
plane = 'auto',
|
|
783
|
+
) =>
|
|
784
|
+
Module.octree(mesh, rootCells, minLevel, maxLevel, bounds, padding, paddingRelative,
|
|
785
|
+
dimension, sampleDistance, balance, fill, sign, attachDistance, evenOdd, maxCells,
|
|
786
|
+
watertightCheck, transition, snap, surfaceLevel, curvatureThreshold, featureAngle,
|
|
787
|
+
sizeArray, plane),
|
|
758
788
|
surfaceWatertightCheck: (mesh) => Module.surfaceWatertightCheck(mesh),
|
|
759
789
|
sampleDistance: (surface, points, sign = 'pseudonormal', band = 0, watertightCheck = 'warn') =>
|
|
760
790
|
Module.sampleDistance(surface, points, sign, band, watertightCheck),
|