Skip to main content

Class: ShapeFactory

Rendering.2D.ShapeFactory()

Polygon generator with

Constructor

new ShapeFactory()

Since:

  • 3.0

Methods

(static) createCircle(nopt, ropt, copt) → Polygon

Creates polygon with circle shape

Parameters:
NameTypeAttributesDefaultDescription
nint<optional>20number of polygon segments
rint<optional>0.5radius (0 < r <= 0.5)
cCommon.Point<optional>{x: 0, y: 0}center
Returns:

circle shape points

Type

Polygon

(static) createEllipse(nopt, rxopt, ryopt, copt) → Polygon

Creates polygon with circle shape

Parameters:
NameTypeAttributesDefaultDescription
nint<optional>20number of polygon segments
rxint<optional>0.5radius (0 < r <= 0.5)
ryint<optional>0.25radius (0 < r <= 0.5)
cCommon.Point<optional>{x: 0, y: 0}center
Returns:

ellipse shape points

Type

Polygon

(static) createStar(nopt, r1opt, ropt) → Polygon

Creates polygon with star shape

Parameters:
NameTypeAttributesDefaultDescription
nint<optional>5number of points
r1float<optional>0.25internal radius (0 < r1 < r)
rfloat<optional>0.5outer radius (0 < r <= 0.5)
Returns:

star shape points

Type

Polygon

Home