Classdesc

A bounds class with min and max values. Implementing IBounds.

Requires

XYCoords

Requires

Vertex

Requires

IBounds

Implements

Constructors

Properties

height: number

Member

Memberof

Bounds

Instance

Member

Memberof

Bounds

Instance

Member

Memberof

Bounds

Instance

width: number

Member

Memberof

Bounds

Instance

Methods

  • Clone this bounds object (create a deep clone).

    Returns Bounds

    Creates a deep clone of this bounds object.

    Method

    clone

    Instance

    Memberof

    Bounds

  • Generate a random point inside this bounds object. Safe areas at the border to avoid included.

    Parameters

    • horizontalSafeArea: number = 0
    • verticalSafeArea: number = 0

    Returns Vertex

    A pseudo random point inside these bounds.

    Method

    randomPoint

    Instance

    Memberof

    Bounds

  • Convert this rectangular bounding box to a polygon with four vertices.

    Returns Polygon

    This bound rectangle as a polygon.

    Method

    toPolygon

    Instance

    Memberof

    Bounds

  • Convert these bounds to a human readable form.

    Note: the returned format might change in the future, so please do not rely on the returned string format.

    Returns string

    Get these bounds in a human readable form.

    Method

    toString

    Instance

    Memberof

    Bounds

  • Compute the minimal bounding box for a given set of vertices.

    An empty vertex array will return an empty bounding box located at (0,0).

    Parameters

    • vertices: Vertex[]

      The set of vertices you want to get the bounding box for.

    Returns Bounds

    The minimal Bounds for the given vertices.

    Static

    Method

    computeFromVertices

    Memberof

    Bounds

  • Create a new Bounds instance just from width and height, located at (0,0) or the optionally given origin.

    Parameters

    • width: number

      The width of the bounds

    • height: number

      The height of the bounds

    • Optional origin: XYCoords

      [optional] A origin to locate the new Bounds object at.

    Returns Bounds

    A new Bounds instance width given width and height, located at (0,0) or the given origin..

Generated using TypeDoc