Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...
    • Project Lines nD → 3D on the main thread via the shared dispatcher.

      Parameters

      • params: {
            positions: Float32Array;
            segments: Uint32Array;
            widths: Float32Array;
            colors:
                | Uint8Array<ArrayBufferLike>
                | Float32Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | null;
            sharpness: Float32Array<ArrayBufferLike> | null;
            scalars:
                | Uint8Array<ArrayBufferLike>
                | Float32Array<ArrayBufferLike>
                | Float16Array<ArrayBufferLike>
                | null;
            viewState: ProjectionViewState;
            ndim: number;
            segmentCount: number;
            colorComponents?: 3 | 4;
            emitSourceIndices?: boolean;
        }
        • positions: Float32Array
        • segments: Uint32Array
        • widths: Float32Array
        • colors:
              | Uint8Array<ArrayBufferLike>
              | Float32Array<ArrayBufferLike>
              | Uint16Array<ArrayBufferLike>
              | null
        • sharpness: Float32Array<ArrayBufferLike> | null
        • scalars:
              | Uint8Array<ArrayBufferLike>
              | Float32Array<ArrayBufferLike>
              | Float16Array<ArrayBufferLike>
              | null

          Optional per-vertex scalar attribute for colormap-mode Lines. Accepted dtypes: Float32Array (passes through zero-copy), Float16Array (element-wise expand), Uint8Array (normalized by 1/255 to align with the colormap shader's [0, 1] contract). When null the worker emits empty startScalars/endScalars arrays and the loader leaves the geometry's scalar attribute unallocated.

        • viewState: ProjectionViewState

          View state for projection. Same ProjectionViewState shape every project*To3D worker function accepts — keeps the worker API uniform across node types. All three fields are consumed: the WASM clip_segments_batch step reads slicePosition + tolerance

          • displayDims to decide per-segment visibility and to clip partially-visible segments at the slice boundary.
        • ndim: number
        • segmentCount: number
        • OptionalcolorComponents?: 3 | 4

          Channels per color entry: 3 (RGB, default) or 4 (RGBA — the alpha column is per-vertex opacity, volumetric phase 4). When 4, the worker de-interleaves the coerced colors into an RGB stride-3 array for interpolate_colors_batch (an RGB-only kernel) plus a stride-1 alpha column routed through interpolate_scalars_batch (the widths/sharpness/scalars kernel — alpha interpolates linearly like any scalar), emitting startAlphas/endAlphas.

        • OptionalemitSourceIndices?: boolean

          Record, for every emitted visible slot, which LOADED SEGMENT ROW it came from (sourceSegmentIndices). Opt-in: it costs 4 B per visible segment and only a label-carrying node has a reader (issue #1424), so data-processor-lines.ts sets it exactly when the loader published vertexRangeBounds. Mirrors emitSourceIndices on the gsplats projection.

      Returns Promise<
          {
              startPositions: Float32Array;
              endPositions: Float32Array;
              startColors: Float32Array;
              endColors: Float32Array;
              startWidths: Float32Array;
              endWidths: Float32Array;
              startSharpness: Float32Array;
              endSharpness: Float32Array;
              startScalars: Float32Array;
              endScalars: Float32Array;
              startAlphas: Float32Array;
              endAlphas: Float32Array;
              segmentLengths: Float32Array;
              startJointCode: Float32Array;
              endJointCode: Float32Array;
              visibleSegmentCount: number;
              bounds?: LinesProjectionBounds;
              sourceSegmentIndices?: Uint32Array<ArrayBufferLike>;
          },
      >