Options
All
  • Public
  • Public/Protected
  • All
Menu

A class representing a ring of a polygon geometry.

Hierarchy

  • Ring

Index

Constructors

constructor

  • new Ring(points: Vector2[], textureCoords?: Vector2[], extents?: number, hasClipInfo?: boolean): Ring
  • Creates a new Ring.

    Parameters

    • points: Vector2[]

      The coordinates of the rings.

    • Optional textureCoords: Vector2[]

      The optional Array of texture coordinates.

    • Default value extents: number = 4 * 1024

      The extents of the tile bounds.

    • Default value hasClipInfo: boolean = false

      A flag indicating that vertices of this Ring may be clipped.

    Returns Ring

Properties

Readonly area

area: number

The signed area of this Ring.

remarks

The sign of the area depends on the projection and the axis orientation of the ring coordinates. For example, given a ring with CW winding: area > 0 with Y-axis that grows downwards and area < 0 otherwise.

Readonly extents

extents: number

The extents of the tile bounds.

Readonly hasClipInfo

hasClipInfo: boolean

A flag indicating that vertices of this Ring may be clipped.

Readonly points

points: Vector2[]

The coordinates of the rings.

Optional Readonly textureCoords

textureCoords: Vector2[]

The optional Array of texture coordinates.

Readonly vertexStride

vertexStride: number

The vertex stride.

Readonly winding

winding: boolean

The winding of this Ring.

remarks

Derived from the sign of the area of this Ring.

Methods

isProperEdge

  • isProperEdge(index: number): boolean
  • Tests if the edge connecting the vertex at index with the vertex at index+1 should be connected by a line when stroking the polygon.

    Parameters

    • index: number

      The index of the first vertex of the outline edge.

    Returns boolean

toArray

  • toArray(array?: number[], offset?: number): number[]
  • Returns a flattened Array containing the position and texture coordinates of this Ring.

    Parameters

    • Default value array: number[] = []

      The target Array.

    • Default value offset: number = 0

      Optional offset into the array.

    Returns number[]

Generated using TypeDoc