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

    Function clip_segment_single

    • Clip a single segment to the nD slice and return interpolation parameters.

      Returns [visible, t1, t2] where:

      • visible: 1.0 if any part of segment intersects slice, 0.0 otherwise
      • t1: interpolation parameter for clipped start (0.0 = original start)
      • t2: interpolation parameter for clipped end (1.0 = original end)

      MED-20: pass workspace (length >= ndim) to avoid per-call Uint8Array allocation in hot loops; the buffer is zeroed by this function before use.

      Parameters

      • p1: Float32Array
      • p2: Float32Array
      • slicePosition: Float32Array
      • tolerance: Float32Array
      • displayDims: Uint32Array
      • ndim: number
      • Optionalworkspace: Uint8Array<ArrayBufferLike>

      Returns Float32Array