Class representing an edge of polygon. Edge shape may be Segment or Arc. Each edge contains references to the next and previous edges in the face of the polygon.

Implements

Constructors

  • Construct new instance of edge

    Parameters

    Returns Edge

Properties

arcLength: number = 0

"Arc distance" from the face start

bv: undefined | number = undefined

Edge inclusion flag (INSIDE, OUTSIDE, BOUNDARY)

bvEnd: undefined | number = undefined

End inclusion flag (inside/outside/boundary)

bvStart: undefined | number = undefined

Start inclusion flag (inside/outside/boundary)

face: undefined | Face = undefined

Pointer to the face containing this edge

next: undefined | Edge = undefined

Pointer to the next edge in the face

overlap: undefined | number = undefined

Overlap flag for boundary edge (OVERLAP_SAME/OVERLAP_OPPOSITE)

prev: undefined | Edge = undefined

Pointer to the previous edge in the face

shape: Segment | Arc

Shape of the edge: Segment or Arc

Accessors

  • get box(): Box
  • Get bounding box of the edge

    Returns Box

    bounding box

  • get end(): Point
  • Get edge end point

    Returns Point

    Point

  • get length(): number
  • Get edge length

    Returns number

    edge length

  • get start(): Point
  • Get edge start point

    Returns Point

    Point

Methods

  • Returns true if point belongs to the edge, false otherwise

    Parameters

    Returns boolean

  • Returns boolean

  • Returns boolean

  • Get middle point of the edge

    Returns Point

    middle point of the edge

  • Get point at given length

    Parameters

    • length: number

      The length along the edge

    Returns Point

    point at given length

  • Reverse edge direction

    Returns void

  • Set inclusion flag of the edge with respect to another polygon Inclusion flag is one of INSIDE, OUTSIDE, BOUNDARY

    Parameters

    Returns number