Bounds

Bounds~ Bounds

Polygonal container for Paths that can constrain them to particular shapes

Constructor

new Bounds(p5, polygon)

Source:
Create a new Bounds object
Parameters:
Name Type Description
p5 object Reference to global instance of p5.js for drawing
polygon array Array of sequential points in the format of [polygon_n][x1][y1], ...

Methods

contains(point) → {boolean}

Source:
Test if a given point is within this Bounds polygon
Parameters:
Name Type Description
point array Coordinates of point to test ([x,y])
Returns:
Type
boolean

draw()

Source:
Draws this Bounds polygon to the canvas