splat-transform API Reference - v2.0.5
    Preparing search index...

    Function fillFloor

    • Floor-fill via XZ dilate -> per-column upward walk -> XZ dilate -> OR.

      Mirrors the shape of fillExterior (dilate -> traverse -> dilate -> OR) but the traversal is a per-(lx, lz) upward walk through empty space instead of a 3D boundary BFS, and the dilations operate only in X and Z.

      Steps with r = ceil(dilation / voxelResolution):

      1. S_xz = gpuDilate3(S, r, 0) closes any XZ holes in horizontal surfaces smaller than 2 * r.
      2. For every (lx, lz), walk y = 0 upward through S_xz. Mark each visited empty voxel into foundEmpty. Stop on the first solid voxel of S_xz or at the grid top.
      3. dilatedFound = gpuDilate3(foundEmpty, r, 0) spreads the found under-surface volume back out in XZ to cover the kernel halo.
      4. output = S | dilatedFound adds the dilated under-surface region as solid on top of the original solids.

      Intended to run before carve: it seals the under-side of the floor (and patches small XZ holes via the dilation), and the carve handles the remaining hole plugging via its 3D dilate + capsule BFS.

      With r = 0 the dilations are skipped and the algorithm degrades to "fill the under-side of every column up to the first solid", matching the original (pre-dilation) fillFloor behavior.

      Parameters

      • grid: SparseVoxelGrid

        Voxel grid (linear-keyed) — mutated as the under-surface region is OR'd into it. The same grid instance is returned in NavSimplifyResult.grid.

      • gridBounds: Bounds

        Axis-aligned bounds of the voxel grid.

      • voxelResolution: number

        Size of each voxel in world units.

      • dilation: number = 0

        XZ dilation radius in world units. 0 disables dilation.

      • gpu: GpuDilation = null

        Reusable GPU dilation context. Required when dilation > 0.

      Returns Promise<NavSimplifyResult>

      Modified grid with under-surface regions filled.