module:extras/randompolygon

Back to documentation index.

### module:extras/randompolygon()

Contains a method to generate a simple polygon at random.

To import all symbols in this module, either of the following can be used:

import * from "extras/randompolygon.js";
// -- or --
import * as CustomModuleName from "extras/randompolygon.js";

Methods

### (static) module:extras/randompolygon.randomPolygon(cx, cy, avgRadius, sides, [irregular], [spiky])

Generates a simple polygon at random. Inspired by a Stack Overflow question.

Parameters

Return Value

The randomly generated polygon. (Type: GraphicsPath)

Back to documentation index.