Shape.Polygon

Returns the shape as a polygon.

struct Shape(T : float)
@safe nothrow pure static
Polygon
(,
Vector!T pos = vec!T(0, 0)
)
if (
isNumeric!T &&
isMutable!T
&&
isSigned!T
)

Parameters

points Vector!T[]

An array of polygon vertices.

pos Vector!T

Polygon position.

Return Value

Type: Shape!T

Polygon.

Examples

auto triangle = Shape.Polygon([
    Vecf(64, 32),
    Vecf(32, 64),
    Vecf(96, 64)
]);

Meta