Collection of polygon data in various formats for testing computational geometry algorithms.
Supported by the Frank-Ratchye Studio for Creative Inquiry at Carnegie Mellon University.
Polygons in this archive have following properties:
- With or without holes
- Non-degenerate (no self-intersection/overlaps, no zero-area parts)
- Concave
- Relatively small amount of vertices
- Hand-traced from various papers on computational geometry algorithms, as well as from other sources (see below).
In all formats, outer contour is clockwise (y-axis points downwards) while holes are counter-clockwise.
The first contour is the outer contour, and the rest (if any) are holes.
- JSON, 3D Array storing contours > vertices > x,y coordinates.
- CSV, Each line is a contour, with flattened x,y coordinates separated by commas, e.g.
x0,y0,x1,y1,x2,y2,...
- SVG, Single
<path>
tag encoding the outer contour and all holes. No styling or other redundency applied. - PNG, Rasterized binary images (white foreground, black background) in png format.
- PLY, Since
face
elements requires triangulation in most softwares, the polygons are stored asedge
's connecting adjacent vertices.z
of vertices are always0
.y
axis might look inverted in 3D softwares. - Hardcode, For programming languages/environments where parsing any of the above is inconvenient, hardcoded variables are available for copy-pasting into source code.
Following renderings are triangulated (and holes bridged) for easier viewing. The original data are not triangulated, and contain holes. Triangulation code is included in /tools
folder.
Basic info about each polygon are stored separately in the meta
folder as JSON's. Metadata for a polygon looks something like this (re-formatted and commented for explanation):
{// meta/skimage-horse.json
"centroid": [371.77, 390.94], // true polygon centroid (aka center of mass)
"area": 180144, // area of polygon
"bounds": [24,111,784,732], // left,top,right,bottom
// minimum bounding box and circle
"rotatedBoundingBox":{"center": [422.99, 480.58], "size": [809.30, 563.60], "angle":-15.34},
"boundingCircle": {"center": [408,416.5],"radius": 435.96},
// convex hull encoded with vertex indices of the outermost contour
"hull": [1,3,7,27,28,72,73,75,97,100,101,102,105,106,107]
}
Visualization of the metadata are stored in the meta/render
folder. For example:
Supported by the Frank-Ratchye Studio for Creative Inquiry at Carnegie Mellon University.