wasm-spatial-core
    Preparing search index...

    Function processChunked

    • Process point cloud data in chunks on the main thread.

      This is a fallback for environments where Web Workers are not available (e.g. missing COOP/COEP headers). It processes the data in chunks and yields to the main thread between chunks using setTimeout(0).

      The pipeline runs Octree build + Tileset generation. Since the actual processing is synchronous in WASM, this function splits the work into conceptual phases and calls onChunk after each phase.

      Arguments

      • positionsFloat32Array of [x, y, z, ...].
      • colors — Optional Uint8Array of [r, g, b, ...].
      • max_points_per_node — Max points per octree leaf (default: 50,000).
      • max_depth — Max tree depth (default: 21).
      • on_chunk — Callback (phase: string, done: number, total: number).

      Returns

      A Promise that resolves with the TilesetResult (as JSON string).

      Parameters

      • positions: Float32Array
      • colors: Uint8Array<ArrayBufferLike> | null | undefined
      • max_points_per_node: number | null | undefined
      • max_depth: number | null | undefined
      • on_chunk: Function

      Returns Promise<any>