Generators
RPG - Random Polygon Generator
rpg was originally presented in Auer and Held (CCCG’96).
rpg implements various algorithms to generate polygons described in that paper, such as Quick Star, Steady Growth, Space Partitioning, and 2-opt Moves.
Furthermore, its xmono backend implements Zhu et al’s (CGTA 1996) algorithm for generating x-monotone polygons, and triangle generates polygons by searching for feasible edges within a random triangulation of the vertices.
rpg can also produce polygons with holes and smooth sharp corners; please see rpg’s readme.
Generators
Koch Snowflake
The code make_koch_snowflake generates instances of Koch’s snowflake curve, optionally in a nested variant, and make_koch_snowflake_quad generates instances of Koch’s rectilinear snowflake.
Source code for genpoly-koch-snowflake and genpoly-koch-snowflake-quad is available.
For the (triangle-based, classic) snowflake, see /db/wip/polygons/contrived/koch-snowflake/ for polygons and /db/wip/polygons-with-holes/contrived/koch-snowflake-nested/ for polygons with holes.
kn00000096 For the rectilinear snowflake, see see /db/wip/polygons/contrived/koch-snowflake_quad/ for grid-aligned and /db/wip/polygons/contrived/koch-snowflake_quad_perturbed/ for randomly perturbed.
kq00000256
Generators
SRPG - Super Random Polygon Generator
srpg generates simply-connected and multiply-connected polygons by means of a regular grid (with quadratic cells).
Source code is available on github. See the srpg* directories in /db/wip/polygons/random/ for polygons and /db/wip/polygons-with-holes/random/ for polygons with holes.
There are several variants:
srpg_iso: orthogonal polygons. srpg_iso_aligned: orthogonal polygons on an integer grid. srpg_octa: octagonal polygons. srpg_perturbed: random polygons. srpg_perturbed_smo: random polygons with smoothed corners. srpg_perturbed_smr: random polygons with even smoother corners. srpg0000051 srpg_iso0000039 srpg_octa0000035 srpg_smo0000123 srpg_mc0000166 srpg_iso_aligned_mc0000150
Generators
Lebesgue Curves
The code make_lebesgue generates instances of (closed) Lebesgue curves. All vertices have integer coordinates.
Source code is available on github. See /db/wip/polygons/contrived/lebesgue/ for polygons.
l00000064
Generators
Sierpinski Curves
The code make_sierpinski generates instances of Sierpinski curves. All vertices have integer coordinates.
Source code is available on github. See /db/wip/polygons/contrived/sierpinski/ for polygons.
s00000256
Generators
Hilbert Curves
The code make_hilbert generates instances of (closed) Hilbert curves
Source code is available on github. See /db/wip/polygons/contrived/hilbert/ for polygons.
h00000072
Generators
FPG - Triangulation Perturbation
Our implementation fpg is based on the approach originally proposed by O’Rourke and Virmani. Given a regular polygon P, its vertices are translated in the plane while maintaining the polygon’s simplicity.
The implementation is being developed as part of a master thesis by Philipp Mayer.
Source code is available on github. See /db/wip/polygons/random/fpg/ for polygons and /db/wip/polygons-with-holes/random/fpg/ for polygons with holes.
fpg-poly_0000000040 fpg-poly_0000000040_h2
Generators
spg - Combining Line-Sweep and Two-Opt
The spg (simple polygon generator) code constructs a simple polygon P on a given point set S in the plane. Initially, spg creates a (not necessarily simple) polygon by choosing a random perturbation of the input vertices. Then it performs a series of line sweeps to find intersections and resolves these using two-opt moves.
The implementation is being developed as part of a master thesis by Steinþór Jasonarson.
Source code is available on github.