SRPG is a library that generates well-formed random polygons using a regular grid consisting of square cells.
It starts with axis & grid-aligned basic rectangular shapes, but can systematically manipulate them through repeated corner-cutting and perturbations to create a variety of polygonal and curve-like shapes, both on the grid and with offset/rotated orientations.
This library is based on Martin Held's C implementation.
Usage
SRPG is available as Maven/Gradle artifact via Jitpack.
Argument Illustrations
SRPG accepts a variety of input arguments that affect shape geometry, providing a good level of customisation over the output. The following illustrations provide an idea of how each argument visually affects the random polygon: