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

    Function countFromUserData

    • Committed visible-element count read straight off a leaf mesh's userData, or null when untracked. The allocation-free primitive behind :func:visibleElementCount — the subtree fold in lod-display-gate.ts calls this per descendant on the per-frame hot path (during a hold), so it must not wrap ud in a throwaway { object: { userData } } object.

      Parameters

      • ud:
            | {
                nodeType?: string;
                loadedViewVersion?: number;
                visiblePointCount?: number;
                visibleSegmentCount?: number;
                visibleSplatCount?: number;
                visibleTriangleCount?: number;
                committedLadderComplete?: boolean;
                committedEnergyFraction?: number;
                attrs?: {
                    level_stats?: {
                        quality?: number;
                        reference_energy?: number;
                        geometric_error?: number;
                    };
                };
            }
            | undefined
        • {
              nodeType?: string;
              loadedViewVersion?: number;
              visiblePointCount?: number;
              visibleSegmentCount?: number;
              visibleSplatCount?: number;
              visibleTriangleCount?: number;
              committedLadderComplete?: boolean;
              committedEnergyFraction?: number;
              attrs?: {
                  level_stats?: {
                      quality?: number;
                      reference_energy?: number;
                      geometric_error?: number;
                  };
              };
          }
          • OptionalnodeType?: string
          • OptionalloadedViewVersion?: number
          • OptionalvisiblePointCount?: number
          • OptionalvisibleSegmentCount?: number
          • OptionalvisibleSplatCount?: number
          • OptionalvisibleTriangleCount?: number

            Mesh's committed count — TRIANGLES; see countFromUserData.

          • OptionalcommittedLadderComplete?: boolean

            Commit-time ladder stamp — see stamp-view-version.ts.

          • OptionalcommittedEnergyFraction?: number

            Commit-time committed-energy stamp e(k) ∈ [0, 1] — see stamp-view-version.ts. Absent on unstamped (legacy) datasets.

          • Optionalattrs?: {
                level_stats?: {
                    quality?: number;
                    reference_energy?: number;
                    geometric_error?: number;
                };
            }

            The leaf's zarr attrs; the display gate reads the static level_stats quality stamps (reference_energy = the leaf's absolute self-energy weight w, used to aggregate committed energy across a partition's leaves; quality = measured Q, for UX).

        • undefined

      Returns number | null