The node of a RegionPolygonTree.

Hierarchy (view full)

Constructors

Accessors

  • get depth(): number
  • The depth of this node. The depth of the root node is 0.

    Returns number

  • get isHole(): boolean
  • Is this a hole? The root node is a hole.

    Returns boolean

  • get clipperPath(): readonly IntPoint[]
  • The Clipper path of this node. It is empty in case of the root node.

    Returns readonly IntPoint[]

  • get polygon(): Polygon
  • The polygon of this node. It is null in case of the root node.

    Returns Polygon

  • get points(): readonly number[]
  • The points of the polygon ([x0, y0, x1, y1, ...]). They are null in case of the root node.

    Returns readonly number[]

  • get bounds(): Rectangle
  • The bounds of the polygon. They are null in case of the root node.

    Returns Rectangle

Methods

  • Test whether given point is contained within this node.

    Parameters

    • point: Point

      The point.

    Returns boolean

  • Test circle containment/intersection with this node.

    Parameters

    • center: Point

      The center point of the circle.

    • radius: number

      The radius of the circle.

    Returns -1 | 0 | 1

    • -1: the circle is in the exterior and does not intersect the boundary. - 0: the circle is intersects the boundary. - 1: the circle is in the interior and does not intersect the boundary.
  • Iterate over recursively over the children in depth-first order.

    Returns any

    Yields

  • Test point containment.

    Parameters

    • point: Point

      The point.

    Returns 0 | 1 | 2

    • 0: not contained within the polygon of this node. - 1: contained within the polygon of this node but also contained inside the polygon of a sub-node that is a hole. - 2: contained within the polygon of this node and not contained inside any polygon of a sub-node that is a hole.
  • Test circle containment/intersection with this node.

    Parameters

    • center: Point

      The center point of the circle.

    • radius: number

      The radius of the circle.

    Returns 0 | 1 | 2 | 3

    • 0: does not intersect the boundary or interior of this node. - 1: contained within the polygon of this node but also contained inside the polygon of a sub-node that is a hole. - 2: contained within the polygon of this node and not contained inside any polygon of a sub-node that is a hole. - 3: intersects the boundary of this node or any sub-node.
  • Create the polygon of this node.

    Returns Polygon