Homesplat-transform API Reference - v3.0.0
    Preparing search index...

    Function readFile

    • Reads a Gaussian splat file and returns its data as ChunkSources (usually one; an LCC/LCC2 container yields a single structural multi-LOD source).

      Readers are chunk-native: ply/splat/spz/lcc/lcc2 return lazy / streaming sources whose close() releases the underlying file(s); whole-blob formats (sog/mjs/ksplat) are decoded up front and returned resident. Callers that need a DataTable materialize at their own boundary (and call source.close() when done).

      Per-format progress (decoding bars, multi-payload bars) is emitted directly by each reader through the global logger; install a renderer via logger.setRenderer(...) to consume those events.

      Parameters

      • readFileOptions: ReadFileOptions

        Options specifying the file to read and how to read it.

      Returns Promise<ChunkSource[]>

      Promise resolving to an array of chunk sources containing the splat data.

      import { readFile, getInputFormat, UrlReadFileSystem } from '@playcanvas/splat-transform';

      const filename = 'scene.ply';
      const fileSystem = new UrlReadFileSystem('https://example.com/');
      const sources = await readFile({
      filename,
      inputFormat: getInputFormat(filename),
      fileSystem
      });