PGS
Processing Geometry Suite
Processing Geometry Suite
Processing Geometry Suite is a software project that provides easy access to 2D geometric algorithms in the form of a Processing library. Over time it has grown to include an incredibly comprehensive range of algorithms.
The focus of the library is on visualisation rather than providing underlying data structures. To this end all methods in the library are static and most of them take in and return PShapes or PVectors.
Docs are hosted via GitHub Pages here.
Overview
Library functionality is split over the following classes:
PGS_CirclePacking- Circle packings of shapes, subject to varying constraints and patterns of tangencies.
PGS_Coloring- Minimal colorings of meshes (or mesh-like shapes).
PGS_Construction- Construct uncommon/interesting 2D primitives.
PGS_Contour- Methods that produce various contours from shapes: medial axes, straight skeletons, offset curves, etc.
PGS_Conversion- Conversion between Processing PShapes and JTS Geometries (amongst other formats).
PGS_Hull- Convex and concave hulls of polygons and point sets.
PGS_Meshing- Mesh generation (excluding triangulation) and processing.
PGS_Morphology- Methods that affect the geometry or topology of shapes (buffering, simplification, smoothing, etc.).
PGS_Optimisation- Solve geometric optimisation problems, such as finding the maximum inscribed circle, or the closest vertex to a coordinate.
PGS_PointSet- Generates sets of 2D points having a variety of different distributions and constraints.
PGS_Polygonisation- Generates simple polygonisations of point sets.
PGS_Processing- Methods that process a shape in some way: partition, slice, clean, etc.
PGS_SegmentSet- Generates sets of random non-intersecting line segments.
PGS_ShapeBoolean- Boolean set-operations for 2D shapes.
PGS_ShapePredicates- Various shape metrics (area, circularity, etc.) and predicates ("do these shapes intersect?").
PGS_Tiling- Tiling, tessellation and subdivision of the plane using periodic or non-periodic geometric shapes.
PGS_Transformation- Various geometric and affine transformations that affect vertex coordinates.
PGS_Triangulation- Delaunay triangulation (constrained and refined) and earcut triangulation of shapes and point sets.
PGS_Voronoi- Voronoi Diagrams of shapes and point sets.
Installation
Processing
PGS is available on Processing's contribution manager as "Geometry Suite for Processing".
Maven/Gradle
PGS is hosted as an artifact for use in Maven or Gradle projects via Jitpack — follow the instructions there (very easy).
Examples
A number of example Processing sketches are provided in examples.
Illustrations
Much of the functionality (but by no means all) is demonstrated below:
2D Boolean Operations
| Union | Intersection | Subtraction | Symmetric Difference |
![]() |
![]() |
![]() |
![]() |
| Complement | Mesh Union | Mesh Intersection | Mesh Subtraction |
![]() |
![]() |
![]() |
![]() |
| Union Lines | Overlap Regions | ||
![]() |
![]() |
Transformation
Geometric Predicates & Metrics
Metrics
| Length/perimeter | Similarity | Is simple? |
| Width & Height | Sphericity | Is convex? |
| Diameter | Elongation | Equal? (structural and topological equivalence) |
| Circularity | Density | Distance |
| Area | Holes | Centroid |
| Interior angles | Maximum interior angle | Median |
Contour
Morphology
Hull
| Concave Hull | Convex Hull of Polygons | ||
![]() |
![]() |
![]() |
![]() |
| Concave hull of point sets via breadth-first or depth-first approaches. | |||
| Convex Hull | Snap Hull | Bounding Box | |
![]() |
![]() |
![]() |
|
| A variable-convexity hull. | |||
Geometry Processing
Triangulation
Voronoi Diagrams
| Voronoi Diagram (inner) | Voronoi Diagram (compound) | ||
![]() |
![]() |
![]() |
![]() |
| Manhattan Voronoi | Additively Weighted Voronoi | Multiplicatively Weighted Voronoi | Farthest-Point Voronoi |
![]() |
![]() |
![]() |
![]() |
| Power Diagram | Centroidal Relaxation | ||
![]() |
![]() |
||
Meshing
Geometric Optimisation
Circle Packing
| Front Chain | Trinscribed | ||
![]() |
![]() |
![]() |
![]() |
| Maximum Inscribed | Stochastic | ||
![]() |
![]() |
![]() |
![]() |
| Repulsion | Square Lattice | ||
![]() |
![]() |
![]() |
![]() |
| Hex Lattice | Tangency Pack | ||
![]() |
![]() |
![]() |
![]() |
| Obstacle | |||
![]() |
|||
Coloring
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Construction
Point Sets
Segment Sets
| Graph-matched | Stochastic | Noded | |
![]() |
![]() |
![]() |
![]() |
| Parallel | Perpendicular Path Segments | Polygon Interior Segments | weave Segments |
![]() |
![]() |
![]() |
![]() |
Tiling & Subdivision
Polygonisation
| Max Area | Min Area | Min Perimeter (TSP) | Hilbert |
![]() |
![]() |
![]() |
![]() |
| Horizontal | Vertical | Circular | Angular |
![]() |
![]() |
![]() |
![]() |
| Onion | |||
![]() |
more like this
prompt-to-puzzle
A web app that dynamically generates playable 'Spot the Difference' games from a single text prompt using a multimodal…
tektosyne
The Tektosyne Library for Java provides algorithms for computational geometry and graph-based pathfinding, along with s…













































































































































































































































































