By · Updated

Voronoi Diagram Generator

Voronoi Cells and Delaunay Triangulation from Points, Download SVG or PNG Free

No ratings yet

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the Voronoi Diagram Generator works

This Voronoi diagram generator exports SVG or PNG. A Voronoi diagram divides a plane into regions, one per point, where every spot inside a region is closer to that point than to any other. It answers "which shop, station or sensor is nearest from here" for the whole map at once. Paste your points, choose cells, triangles or both, and download the result as SVG or PNG. Nothing leaves your browser.

What to paste

Two numeric columns, x then y, one point per row, separated by commas or tabs. A text column, if present, names each point and appears as a label and in the hover tooltip; without one the points are numbered in order. A header row is used for axis labels when present. Rows missing either coordinate are dropped, and at least three points are needed, since two points only give a single dividing line.

Voronoi cells in the Voronoi diagram generator

Each point owns the cell around it, bounded by the perpendicular bisectors between it and its neighbours. The cells are clipped to the plot area, which extends a little beyond the data on each side, so points on the outside get finite cells instead of running off to infinity. Cell fill tints each cell with a colour from the chosen palette at light or strong opacity, or leaves them white with black borders for a line drawing. Hover a cell for its point, coordinates and share of the plot area. A large cell means the point has no close competitors; a tiny one means it is crowded.

Delaunay triangles

The Delaunay triangulation joins each point to its natural neighbours, the ones whose Voronoi cells share an edge, so the two diagrams are duals of each other. It has the useful property that no point falls inside any triangle's circumscribed circle, which makes the triangles as fat as the data allows and is why it underpins terrain meshes, finite element grids and nearest neighbour searches. Shown alone it comes with the convex hull outlined; shown with the cells it appears as dashed grey lines crossing every cell border at a right angle.

Reading the stats

Points gives the total and how many sit on the convex hull, the outer boundary of the set. Triangles is the count in the triangulation. Largest and smallest cell name the points with the most and least territory as a percentage of the plot. Closest pair distance is the shortest edge in the triangulation, measured in the units of the data, which is the closest any two points come to each other.

Exporting

Download SVG gives a vector file with one path per cell or triangle mesh and editable labels. Download PNG renders at one, two or three times the preview width. Copy SVG puts the markup on the clipboard for pasting into a design tool.

FAQ

What is a Voronoi diagram used for?

Catchment areas for shops, schools or hospitals, coverage maps for cell towers and weather stations, nearest facility lookups, the cells in a cellular automaton, texture and terrain generation in games, and as a visual aid for any "which is nearest" question. Ecologists use them to estimate the territory of each tree or animal from its position alone.

Why does the diagram change when I add a far-away point?

The plot area is fitted to the data, so a distant point stretches the axes and shrinks everything else. The cells of the outer points are also clipped by the plot edge, so their area depends on that fit. Remove outliers or set the axis labels and export at a larger size if the detail matters.

Can I use latitude and longitude?

Yes, paste longitude as x and latitude as y. The result is a flat-earth approximation that is fine for a city or region; over continental distances the cell borders will drift from true great-circle bisectors, and a proper map projection is the better tool.

What happens with duplicate points?

Two points at exactly the same spot cannot both have a cell; one is kept and the other gets no area, and the stats will report it as the smallest cell at zero percent. Deduplicate the input if each row should count.

See also: all Chart Makers tools, Images, Audio, Video & Screen, PDF, SVG, Simulations & Screensavers, Generative Art, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.

Related tools