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:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
n | int | <optional> | 20 | number of polygon segments |
r | int | <optional> | 0.5 | radius (0 < r <= 0.5) |
c | Common.Point | <optional> | {x: 0, y: 0} | center |
Returns:
circle shape points
Type
(static) createEllipse(nopt, rxopt, ryopt, copt) → Polygon
Creates polygon with circle shape
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
n | int | <optional> | 20 | number of polygon segments |
rx | int | <optional> | 0.5 | radius (0 < r <= 0.5) |
ry | int | <optional> | 0.25 | radius (0 < r <= 0.5) |
c | Common.Point | <optional> | {x: 0, y: 0} | center |
Returns:
ellipse shape points
Type
(static) createStar(nopt, r1opt, ropt) → Polygon
Creates polygon with star shape
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
n | int | <optional> | 5 | number of points |
r1 | float | <optional> | 0.25 | internal radius (0 < r1 < r) |
r | float | <optional> | 0.5 | outer radius (0 < r <= 0.5) |
Returns:
star shape points
Type