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

    Builder for lines test data.

    Mirrors the PointsBuilder API: chained withX() setters and a final build() that returns plain typed arrays + counts. Use this in spatial-index loader, projection, and clipping tests so the test fixtures stay consistent across geometry types.

    const lines = new LinesBuilder()
    .withSegments(50)
    .withDimensions(3)
    .withRandomVertices()
    .withWidths(1.0)
    .build();
    Index
    numSegments: number = 100
    dimensions: number = 3
    vertices: Float32Array<ArrayBufferLike> | null = null
    widths: Float32Array<ArrayBufferLike> | null = null
    segments: Uint32Array<ArrayBufferLike> | null = null
    colors: Float32Array<ArrayBufferLike> | null = null
    sharpness: Float32Array<ArrayBufferLike> | null = null
    • Provide explicit vertex data ((numSegments * 2) * dimensions floats).

      Parameters

      • vertices: number[] | Float32Array<ArrayBufferLike>

      Returns this

    • Provide explicit segment indices. If omitted, auto-generates the canonical [0, 1, 2, 3, ..., 2N-1] packing where each segment takes two consecutive vertex indices.

      Parameters

      • segments: number[] | Uint32Array<ArrayBufferLike>

      Returns this

    • Add per-vertex colors as RGB floats. Random when no values are passed.

      Parameters

      • Optionalcolors: number[] | Float32Array<ArrayBufferLike>

      Returns this

    • Build the test fixture. vertices is auto-populated with random values if no withVertices/withRandomVertices call preceded build(). widths defaults to a uniform 1.0 if unset (required attribute). segments defaults to the canonical packing if unset.

      Returns {
          vertices: Float32Array;
          widths: Float32Array;
          segments: Uint32Array;
          colors: Float32Array<ArrayBufferLike> | null;
          sharpness: Float32Array<ArrayBufferLike> | null;
          numSegments: number;
          dimensions: number;
      }