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

    Interface ToleranceOptions

    Configuration options for tolerance computation.

    interface ToleranceOptions {
        maxRadius?: number;
        meshSlabTolerance?: number;
        spatialExtendDims?: boolean[];
        barrierDims?: readonly number[];
        truncationRadius?: number;
        discreteRole?: "query" | "membership";
    }
    Index
    maxRadius?: number

    Maximum point radius (only used for 'points' type). Non-displayed spatial dimensions use this as tolerance so that all points whose radius intersects the slice are included.

    1.0
    
    meshSlabTolerance?: number

    Slab thickness multiplier for mesh hidden CONTINUOUS dimensions, in cells. Tolerance = step * meshSlabTolerance.

    Mesh is the only type with a tunable continuous arm, and the number is an invention rather than a measurement: a mesh has no per-element extent (docs/specs/MESH_NODE_SPEC.md §2.2), so nothing in the data says how thick the slab should be. (GSplats, by contrast, exposes no slab knob — its chunk bounds already carry the real truncation_radius · σ extent, so its continuous arm is a float-safety epsilon, max(1e-3 × step, T × 1e-5). T is per-node rather than a constant, but it is read off the store, not authored here: nothing about that arm is a tuning choice.) One cell is the neutral choice — it admits a triangle whose vertices straddle the slice by up to a voxel. It must never be 0: see the module docstring.

    1.0
    
    spatialExtendDims?: boolean[]

    Flags per dimension indicating whether it is spatial (true) or discrete (false). Only used for 'points' type. Dimensions beyond the array length default to spatial.

    barrierDims?: readonly number[]

    The AUTHORITATIVE set of barrier (categorical) dimension indices, as PUBLISHED BY THE WRITER — the top-level slice_dims ordering attr, in center-column / chunk_bounds column indices, the same space as this module's d loop over ndim.

    GSPLATS-ONLY today, and deliberately: isBarrierDim ignores this option for the other three types, so supplying it to them is a no-op rather than a silent behaviour change. It picks the rule matching the chunk BOUNDS, which by itself can NARROW a window the renderer still draws, so each arm owes its own check before honouring it — and only the gsplats arm has one (its demote case, computeGSplatsHiddenTolerance). Before wiring lines or mesh up, give that arm a floor FIRST: lines' continuous arm is a literal 0, so a demoted dim would lose its reach entirely while data-processor-lines.ts keeps clipping against a half-cell membership slab, and mesh's two arms are both MEMBERSHIP gates, so a promoted dim narrows a full cell to a half — changing what the user SEES rather than how much is downloaded.

    When SUPPLIED, a gsplats dimension is a barrier iff barrierDims.includes(d), whatever DimensionInfo.discrete says — the write side is the only party that knows which dims it gave a tight _BARRIER_BOUND_EPS pad instead of the truncation_radius · σ expansion, so reading its answer makes the gsplats premise structural rather than conditional (see gsplatsContinuousDimTolerance).

    When ABSENT (undefined) barrier-ness falls back to DimensionInfo.discrete, which is the historical behaviour and all a legacy store with no slice_dims attr can offer. An EMPTY array is meaningful and is NOT "absent": it means the writer used pure spatial ordering, so NOTHING is a barrier.

    INDEX SPACE, for whoever eventually wires another type up. Center-column space holds for GSPLATS (io/_compiler/gsplat_assembly.py stamps slice_dims whenever ordering != 'none') and for POINTS, the two types that write their ordering keys flat. It does NOT hold for LINES, which has two orderings and therefore namespaces them: there is no top-level slice_dims at all (io/_compiler/geometry_writers/lines.py writes vertex_ordering / segment_ordering dicts), and of those two only vertex_ordering["slice_dims"] is in D space — segment_ordering's copy is in DOUBLED (2×D) space, since io/_ordering/lines.py appends both i and n_dims_original + i for each discrete dim. The SEGMENT chunk bounds a lines query scans are nevertheless built from the D-space vertex_ordering["slice_dims"], so a future lines caller must pass that one and never segment_ordering's.

    The caller owns validation: this array comes off disk and is untrusted, so the gsplats loader rejects a bad attr WHOLESALE rather than filtering it (see gsplats-spatial-index-loader.ts::readBarrierDims).

    truncationRadius?: number

    The node's own Gaussian truncation_radius T, in sigmas. Scales the degenerate-band term of the gsplats continuous arm (gsplatsContinuousDimTolerance).

    Pass the value the RENDERER will actually use, i.e. already through rendering/materials/gsplat/math.ts::clampTruncationRadius — the band this covers is the band the material draws, so the two must agree. The gsplats loader does exactly that.

    Absent ⇒ GSPLAT_DEFAULT_TRUNCATION_RADIUS, which is also what the material path substitutes for an absent attr. A 0, a negative or a non-finite value also lands on that default, but that is only a BACKSTOP against an unsanitized value, not a second rule: clampTruncationRadius floors at MIN_TRUNCATION_RADIUS (≈2.44e-4) rather than the default, so the real caller can never send one. A caller that skips the clamp and passes an UNCLAMPED radius in (0, MIN_TRUNCATION_RADIUS) gets a band narrower than the one the material will draw with (the material raises it to MIN, this takes it literally) — named here rather than hidden, and avoided by doing what the paragraph above says.

    discreteRole?: "query" | "membership"

    Which ROLE the discrete-dim tolerance plays (default 'query').

    • 'query' — chunk-fetch reach: the quarter-cell 0.25 × step (must stay below the write-side pad + half step so the neighbour category never bleeds in; see the module docstring).
    • 'membership' — per-element visibility gate applied AFTER fetch (the projection/clipping slab): the half-cell 0.5 × step, matching the points gate (effective-radius-calculator.ts, absolute 0.5 on a unit grid) and the gsplats projection gate (step × 0.5). The lines projection-clipping path must use this role — with the query role its rendered cross-category whiskers halve and off-grid vertices in the (0.25, 0.5] × step band vanish while identical points/gsplats stay visible.