Skip to content

micycle1/SRPG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SRPG – Super Random Polygon Generator

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:

Hierarchy Diagonal Perturb+align Smooth

Grid size (nX, nY)

5x5 10x10 100x100 500x500