Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Function buildSpatialIndexMetrics

    • Build the chunk-index telemetry snapshot every facade's getMetrics attaches as metrics.spatialIndex (consumed by the monitor advisor's query-efficiency recommendations). Shared by all three geometry facades: points/gsplats pass their single chunk index; lines passes its SEGMENT index (the queried side of its dual index).

      The "cell" vocabulary is the metric shape's legacy naming for a chunk-based index: one "cell" = one chunk. avgCellsPerQuery is a TRUE rolling mean — CUMULATIVE queried cells over cumulative query count. (The historical points formula divided the LAST query's cell count by the cumulative query count, which decayed ~1/n with session length and made queryEfficiency drift toward 0, eventually firing the advisor's "Suboptimal Query Efficiency" recommendation on any long session.)

      Parameters

      • chunkCount: number
      • queries: number
      • totalQueryCells: number
      • elementsLoaded: number

      Returns SpatialIndexMetrics