Class Multiline represent connected path of [edges]Edge, where each edge may be [segment]Segment, [arc]Arc

Hierarchy (view full)

Constructors

Properties

first: undefined | LinkedListElement
last: undefined | LinkedListElement

Accessors

  • get box(): Box
  • (Getter) Return bounding box of the multiline

    Returns Box

  • get edges(): Edge[]
  • (Getter) Return array of edges

    Returns Edge[]

    array of edges

  • get size(): number
  • Return the number of elements in the list

    Returns number

    number of elements in the list

  • get vertices(): Point[]
  • (Getter) Returns array of vertices

    Returns Point[]

    array of vertices

Methods

  • Split edge and add new vertex, return new edge inserted

    Parameters

    • pt: Point

      point on edge that will be added as new vertex

    • edge: Edge

      edge to split

    Returns undefined | Edge

  • Return new cloned instance of Multiline

    Returns Multiline

  • Returns edge which contains given point

    Parameters

    Returns undefined | Edge

  • Return true if the list is empty

    Returns boolean

  • Return new multiline rotated by given angle around given point If point omitted, rotate around origin (0,0) Positive value of angle defines rotation counterclockwise, negative - clockwise

    Parameters

    • angle: number = 0

      rotation angle in radians

    • center: Point = ...

      rotation center, default is (0,0)

    Returns Multiline

    • new rotated polygon
  • Split edges of multiline with intersection points and return mutated multiline

    Parameters

    • ip: Point[]

      array of points to be added as new vertices

    Returns Multiline

  • Return an array of elements from start to end If start or end is not defined, take the first as the start, the last as the end

    Parameters

    Returns LinkedListElement[]

    Array containing elements

  • Transform multiline into array of shapes

    Returns (Segment | Arc)[]

  • Return new multiline transformed using affine transformation matrix Method does not support unbounded shapes

    Parameters

    • matrix: Matrix = ...

      affine transformation matrix

    Returns Multiline

    • new multiline
  • Returns new multiline translated by vector vec

    Parameters

    Returns Multiline

  • Throw an error if a circular loop is detected in the linked list

    Parameters

    Returns void