wasm-spatial-core
    Preparing search index...

    Function buildOctree

    • Build an octree from a flat [x, y, z, ...] position buffer.

      The input buffer is not modified (a copy is made internally). Points with NaN/Infinity coordinates are silently filtered.

      Performs a memory pre-check if setMaxWasmMemory has been called with a non-zero limit. Returns an error if estimated memory exceeds the limit.

      Arguments

      • positionsFloat32Array of [x, y, z, ...] triples.
      • max_points_per_node — Max points per leaf (default: 50 000).
      • max_depth — Max tree depth (default: 21).

      Parameters

      • positions: Float32Array
      • Optionalmax_points_per_node: number | null
      • Optionalmax_depth: number | null

      Returns Octree