/** * AutoMesher — Surface-to-volume tetrahedral mesh generation. * * Provides structured meshing for axis-aligned boxes (built-in) and a * pluggable interface for WASM-based meshers (TetGen, Gmsh) to handle * arbitrary surface geometry. * * ## Built-in: Structured Box Mesher * * Generates a regular hexahedral grid subdivided into 5 tetrahedra per hex * using the alternating Freudenthal decomposition (same as verification tests). * Produces consistent, high-quality meshes for rectangular domains. * * ## Pluggable: Surface Mesh Interface * * `meshSurface()` accepts a triangle surface mesh (STL/OBJ-style) and * delegates to a registered WASM mesher. When no WASM mesher is registered, * falls back to bounding-box meshing. * * ## TET10 Upgrade * * All meshers produce TET4 connectivity. Use `tet4ToTet10()` from * StructuralSolverTET10 to upgrade to quadratic elements. * * @see StructuralSolverTET10 — consumes the mesh this module produces * @see tet4ToTet10 — upgrades TET4 → TET10 by inserting mid-edge nodes */ export interface TetMesh { /** Vertex positions: flat [x0,y0,z0, x1,y1,z1, ...] */ vertices: Float64Array; /** Element connectivity: flat [n0,n1,n2,n3, ...] — 4 per tet */ tetrahedra: Uint32Array; /** Number of vertices */ nodeCount: number; /** Number of tetrahedra */ elementCount: number; } export interface BoxMeshOptions { /** Box origin [x, y, z] (default: [0, 0, 0]) */ origin?: [number, number, number]; /** Box dimensions [lx, ly, lz] */ size: [number, number, number]; /** Number of subdivisions [nx, ny, nz] (default: [4, 4, 4]) */ divisions?: [number, number, number]; } export interface SurfaceMesh { /** Triangle vertex positions: flat [x0,y0,z0, ...] */ vertices: Float64Array | Float32Array; /** Triangle connectivity: flat [i0,i1,i2, ...] — 3 per face */ triangles: Uint32Array; } export interface SurfaceMeshOptions { /** Target maximum edge length */ maxEdgeLength?: number; /** Target element quality (0-1, higher = better) */ quality?: number; /** Volume constraint (max tet volume) */ maxVolume?: number; } /** * Pluggable WASM mesher interface. * Implement this and register via `AutoMesher.registerWasmMesher()`. */ export interface WasmMesher { /** Generate volumetric tet mesh from surface triangles */ tetrahedralize(surface: SurfaceMesh, options?: SurfaceMeshOptions): Promise; } /** * Generate a structured tetrahedral mesh for an axis-aligned box. * * Algorithm: Regular hexahedral grid → 5 tets per hex (alternating Freudenthal). * This decomposition alternates orientation at each cell to maintain conforming * faces between adjacent hexahedra, producing a valid conformal mesh. * * @returns TET4 mesh (upgrade to TET10 via tet4ToTet10) */ export declare function meshBox(options: BoxMeshOptions): TetMesh; /** * Find all nodes on a specific face of an axis-aligned box mesh. * Useful for applying boundary conditions (constraints/loads). */ export declare function findNodesOnFace(mesh: TetMesh, face: 'x-' | 'x+' | 'y-' | 'y+' | 'z-' | 'z+', tolerance?: number): number[]; /** * Find all nodes within a spherical region. * Useful for point load application. */ export declare function findNodesInSphere(mesh: TetMesh, center: [number, number, number], radius: number): number[]; /** * Register a WASM-based mesher (e.g., TetGen compiled to WASM). * Once registered, `meshSurface()` will use it instead of the fallback. */ export declare function registerWasmMesher(mesher: WasmMesher): void; /** * Generate a volumetric tet mesh from a surface triangle mesh. * * If a WASM mesher is registered (via `registerWasmMesher`), delegates to it. * Otherwise falls back to bounding-box meshing with the surface's AABB. */ export declare function meshSurface(surface: SurfaceMesh, options?: SurfaceMeshOptions): Promise; /** * Compute mesh quality statistics. */ export declare function meshQuality(mesh: TetMesh): { minVolume: number; maxVolume: number; avgVolume: number; minAspectRatio: number; invertedCount: number; }; //# sourceMappingURL=AutoMesher.d.ts.map