An open API service indexing awesome lists of open source software.

https://github.com/micycle1/srpg

Super Random Polygon Generator
https://github.com/micycle1/srpg

polygon-construction polygon-generator polygons shape-generation

Last synced: 11 months ago
JSON representation

Super Random Polygon Generator

Awesome Lists containing this project

README

          

[![](https://jitpack.io/v/micycle1/SRPG.svg)](https://jitpack.io/#micycle1/SRPG)

# 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](https://github.com/cgalab/genpoly-srpg).

## Usage
SRPG is available as Maven/Gradle artifact via [Jitpack](https://jitpack.io/#micycle1/SRPG).

## 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