Skip to content

Latest commit

 

History

History
150 lines (111 loc) · 4.83 KB

PositionMaker.md

File metadata and controls

150 lines (111 loc) · 4.83 KB

PositionMaker

Members

positions

The array that contains the vertices of the triangles

Functions

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 of R to PositionMaker.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

positions

The array that contains the vertices of the triangles

Kind: global variable

PositionMaker() ⇒ Object

The part of the system that converts complex shapes to triangles that can drawn by ‍‍Drawer

Kind: global function
Returns: Object - PositionMaker object

reset()

Reset all values

Kind: global function

addPolygon(vertices)

Get array of values and add represented polygon to PositionMaker.positions.

Kind: global function

Param Type Description
vertices Array.<number> sequence of Xs and Ys of vertices of polygon. For example [0,0, 50,0, 50,50, 0,50] represents an square

addLine(x1, y1, x2, y2, width)

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

addCircle(cx, cy, r, cuts)

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

addRectangle(x1, y1, x2, y2)

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

addSequenceLine(positions, width)

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

addClosedSequenceLine(positions, 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

getPositionsList() ⇒ Array.<number>

Returns the array that contains the vertices of the triangles

Kind: global function
Returns: Array.<number> - PositionMaker.positions