Function clipLineConvexPolygon

  • Parameters

    • poly: [number, number][]

      array of points (which are arrays of numbers)

    • line: VecLine2

      a line in "vector" "origin" form

    • Optional fnPoly: Function = include

      include or exclude polygon boundary in clip

    • Optional fnLine: Function = includeL

      function to determine line/ray/segment, and inclusive or exclusive.

    • Optional epsilon: number = EPSILON

      optional epsilon

    Returns [number, number][]

    Description

    find the overlap between one line and one convex polygon and clip the line into a segment (two endpoints) or return undefined if no overlap. The input line can be a line, ray, or segment, as determined by "fnLine".