Class: TangleElement

TangleElement(g, center, options)

Base class for a repeatable element of a tangle.

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.

Source:

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.

Source:

draw()

Draw the TangleElement

Source:

getPoly()

Get the vertices of the enclosing polygon.

Source:
Returns:

[p5.Vector] An array of vertices for the enclosing polygon.