Class: Tangle

Tangle(mask, options)

Base class for a tangle, which is an area filled with TangleElements

Constructor

new Tangle(mask, options)

Create a new Tangle

Parameters:
Name Type Description
mask Array.<Point> | Polygon

Vertices of a polygon used as a mask. Only the portion of the tangle inside the polygon will be visible.

options TangleOptions

A map of values to be loaded into instance variables.

Source:

Methods

applyMask()

Apply the mask polygon to this tangle. Only the portion of the tangle inside the mask polygon will be displayed.

Source:

collisionTest(poly) → {boolean}

Test an polygon for collisions with existing polygons.

Parameters:
Name Type Description
poly Array.<p5.Vector>

The polygon to test.

Source:
Returns:

True if there is a collision.

Type
boolean

execute()

Build the tangle. Executes the this.build method with before and after processing appropriate to the tangle type. This is normally the last method called by a child class.

Source:

paste(position)

Paste the graphics buffer onto the canvas at the specified position .

Parameters:
Name Type Description
position Point

The position at which to place the image on the canvas.

Source: