Shape

Description

Base interface for geometric two-dimensional shapes that are defined by a distance field.

Shapes can be defined implicitly. In this case, Shape.Info.vertices returns zero and the implementation is responsible for computing a proper distance field. Explicit shape definitions make use of vertices, edges (Shape.Info.edges) and triangles (Shape.Info.triangles). Edges can also be used to define polygon contours (see Shape.Info.parity).

shape type |   vertex |     edge | triangle |   edge
           |    count |    count |    count | parity
-----------+----------+----------+----------+-------
implicit   |        0 |        0 |        0 |      0
-----------+----------+----------+----------+-------
points     |      > 0 |        0 |        0 |      0
-----------+----------+----------+----------+-------
graph      |      > 0 |      > 0 |        0 |      0
-----------+----------+----------+----------+-------
polygon    |      > 0 |      > 0 |        0 |   != 0
-----------+----------+----------+----------+-------
mesh       |      > 0 |        0 |      > 0 |      0

A polygon is made up of one or more contours, where each contour is a connected sequence of edges, usually forming a closed ring. Polygon contours are defined piecewise by the set of edges. A contour can either be an outer ring or a hole.

Usually, contours will be closed. Open contours can occur during transformation of shapes from one coordinate system to another (see Shape.Georef or Shape.Info.cubemap) for vertex coordinates which are not defined in the target coordinate system.