- positions
The array that contains the vertices of the triangles
- PositionMaker() ⇒
Object
The part of the system that converts complex shapes to triangles that can drawn by
Drawer
- reset()
Reset all values
- addPolygon(vertices)
Get array of values and add represented polygon to
PositionMaker.positions
.- addLine(x1, y1, x2, y2, width)
Add a line between P1 and P2 to
PositionMaker.positions
.- addCircle(cx, cy, r, cuts)
Add a circle that centered on
P
with radius ofR
toPositionMaker.positions
.- addRectangle(x1, y1, x2, y2)
Add a rectangle P1P2P3P4 to
PositionMaker.positions
.- addSequenceLine(positions, width)
Add multiple lines to
PositionMaker.positions
- addClosedSequenceLine(positions, width)
Add multiple lines to
PositionMaker.positions
and closed lines.- getPositionsList() ⇒
Array.<number>
Returns the array that contains the vertices of the triangles
The array that contains the vertices of the triangles
The part of the system that converts complex shapes to
triangles that can drawn by Drawer
Kind: global function
Returns: Object
- PositionMaker object
Reset all values
Get array of values and add represented polygon to PositionMaker.positions
.
Kind: global function
Param | Type | Description |
---|---|---|
vertices | Array.<number> |
sequence of X s and Y s of vertices of polygon. For example [0,0, 50,0, 50,50, 0,50] represents an square |
Add a line between P1 and P2 to PositionMaker.positions
.
Kind: global function
Param | Type | Description |
---|---|---|
x1 | number |
X of P1 |
y1 | number |
Y of P1 |
x2 | number |
X of P2 |
y2 | number |
Y of P2 |
width | number |
width of line |
Add a circle that centered on P
with radius of R
to PositionMaker.positions
.
Kind: global function
Param | Type | Description |
---|---|---|
cx | number |
X of P |
cy | number |
Y of P |
r | number |
radius |
cuts | integer |
number of triangles to draw circle |
Add a rectangle P1P2P3P4 to PositionMaker.positions
.
Kind: global function
Param | Type | Description |
---|---|---|
x1 | number |
X of P1 |
y1 | number |
Y of P1 |
x2 | number |
X of P3 |
y2 | number |
Y of P3 |
Add multiple lines to PositionMaker.positions
Kind: global function
Param | Type | Description |
---|---|---|
positions | Array.<number> |
sequence of vetices of line. For example [0,0, 100,0, 100,50] represents an L shape line |
width | number |
line width |
Add multiple lines to PositionMaker.positions
and closed lines.
Kind: global function
Param | Type | Description |
---|---|---|
positions | Array.<number> |
sequence of vetices of line. For example [0,0, 100,0, 100,50] represents an triangle shaped line |
width | number |
line width |
Returns the array that contains the vertices of the triangles
Kind: global function
Returns: Array.<number>
- PositionMaker.positions