Skip to main content

Polygon

Polygon is a fixed number of vertices on a layer. Create one with polygon.

Fields

FieldTypeDescription
layerStringLayer name.
points[Point]Vertices, in order.
xNFloatx coordinate of vertex N, such as x0 or x2.
yNFloaty coordinate of vertex N.

shape.x2 and shape.points[2].x refer to the same coordinate.

let triangle = polygon(
"met1", 3,
x0=0., y0=0.,
x1=100., y1=0.,
x2=50., y2=80.,
);

The constructor's xNi and yNi arguments set initial coordinates.