Constructor
new TangleElement(g, center, options)
Create a TangleElement.
Parameters:
Name | Type | Description |
---|---|---|
g |
p5.Graphics | The graphics object to write to. |
center |
Point | The location of the element. |
options |
TangleElementOptions | A map of values to be loaded into instance variables. |
Methods
addVertex(p)
Add a vertex to the enclosing polygon for this TangleElement.
Parameters:
Name | Type | Description |
---|---|---|
p |
Point | A Point describing the vertex location. |
draw()
Draw the TangleElement
getPoly()
Get the vertices of the enclosing polygon.
Returns:
[p5.Vector] An array of vertices for the enclosing polygon.