WOLFRAM

VoronoiMesh[{p1,,pn}]

gives a MeshRegion representing the Voronoi mesh from the points p1, p2, .

VoronoiMesh[{p1,,pn},{{xmin,xmax},}]

clips the mesh to the bounds .

Details and Options

  • VoronoiMesh is also known as Voronoi diagram and Dirichlet tessellation.
  • The Voronoi mesh consists of n convex cells, each associated with a point pi and defined by , which is the region of points closer to pi than any other point pj for ji.
  • The cells associated with the outer points will be unbounded, but only a bounded range will be returned. If no explicit range {{xmin,xmax},} is given, a range is computed automatically.
  • The cells will be intervals in 1D, convex polygons in 2D and convex polyhedra in 3D.
  • VoronoiMesh takes the same options as MeshRegion.

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Create a 1D Voronoi mesh from a set of points:

Out[2]=2

Each point corresponds to a Voronoi cell, which is an interval in the 1D case:

Out[3]=3

Create a 2D Voronoi mesh from a set of points:

Out[2]=2

Each point corresponds to a Voronoi cell:

Out[3]=3

Scope  (2)Survey of the scope of standard use cases

Create a 1D Voronoi mesh from a set of points:

Out[2]=2

Basic properties:

Out[3]=3

Voronoi meshes are full-dimensional:

Out[4]=4

Voronoi meshes are bounded by their clipping values:

Out[5]=5
Out[6]=6

Create a 2D Voronoi mesh from a set of points:

Out[2]=2

Basic properties:

Out[3]=3

Voronoi meshes are full-dimensional:

Out[4]=4

Voronoi meshes are bounded by their clipping values:

Out[5]=5
Out[6]=6

Options  (11)Common values & functionality for each option

MeshCellHighlight  (2)

MeshCellHighlight allows you to specify highlighting for parts of a VoronoiMesh:

Out[1]=1

Individual cells can be highlighted using their cell index:

Out[1]=1

Or by the cell itself:

Out[2]=2

MeshCellLabel  (2)

MeshCellLabel can be used to label parts of a VoronoiMesh:

Out[1]=1

Individual cells can be labeled using their cell index:

Out[1]=1

Or by the cell itself:

Out[2]=2

MeshCellMarker  (1)

MeshCellMarker can be used to assign values to parts of a VoronoiMesh:

Out[1]=1

Use MeshCellLabel to show the markers:

Out[2]=2

MeshCellShapeFunction  (2)

MeshCellShapeFunction allows you to specify functions for parts of a VoronoiMesh:

Out[1]=1

Individual cells can be drawn using their cell index:

Out[1]=1

Or by the cell itself:

Out[2]=2

MeshCellStyle  (2)

MeshCellStyle allows you to specify styling for parts of a VoronoiMesh:

Out[1]=1

Individual cells can be highlighted using their cell index:

Out[1]=1

Or by the cell itself:

Out[2]=2

PlotTheme  (2)

Use a theme with grid lines and a legend:

Out[1]=1

Use a theme to draw a wireframe:

Out[1]=1

Applications  (8)Sample problems that can be solved with this function

Basic Applications  (2)

Create an interactive Voronoi mesh with draggable points. Use Click on the Voronoi mesh to add and remove draggable points:

Out[1]=1

Voronoi meshes for simple point configurations including a grid:

Out[2]=2

A circle of points:

Out[4]=4

Geography  (1)

Create an interactive map of the closest large city in Italy. Start by getting names and coordinate data for large cities in Italy:

Nearest function for labeling region cells:

Generate a Voronoi mesh from city coordinates:

Out[4]=4

Create a tooltip map from the Voronoi mesh:

Mouse over the map to get the name of the closest large city:

Out[6]=6

Physics  (1)

Given a 2D lattice basis:

Out[1]=1

Generate lattice points:

Out[2]=2

Generate and visualize the Voronoi cells, also known as Brillouin zones:

Out[3]=3

Image Processing  (1)

Create a polygonal mosaic from an image:

Find the edges of the image:

Out[2]=2

Create a Voronoi mesh from the edge positions:

Out[4]=4

Recursively apply VoronoiMesh to the mean vertex positions of the precursive Voronoi cells to create a more uniform mesh:

Out[5]=5

Color each polygon with the image color coinciding with its mean vertex positions:

Out[6]=6

Other  (3)

Create a jigsaw puzzle from a random Voronoi mesh:

Extract lines from the mesh:

Define a function that converts a line to an interlocking edge:

Replace lines of sufficient length with an interlocking edge:

Visualize the result:

Out[5]=5

Visualize a piecewise constant interpolation of a function over a set of random point samples:

Voronoi mesh from , sample coordinates:

Function to rescale values to :

Piecewise constant contour plot of sample data:

Out[5]=5

A similar plot can also be achieved with ListContourPlot:

Out[6]=6

Plan a path for a point robot through a random set of point obstacles by following Voronoi edges:

Generate Voronoi edges around the obstacles:

Create an undirected Graph from the Voronoi edges with their lengths as edge weights:

Use Nearest function to find the closest Voronoi vertices to the start and end points:

Drag starting or ending points to explore different paths (red):

Out[7]=7

Properties & Relations  (6)Properties of the function, and connections to other functions

The output of VoronoiMesh is always a full-dimensional MeshRegion:

Out[1]=1
Out[2]=2

Each point of the original data is contained in exactly one cell in the Voronoi mesh:

Out[3]=3

VoronoiMesh is the dual of the DelaunayMesh:

Each Voronoi cell has a single point from the original point set:

Out[4]=4

The Voronoi cell for pi is given by :

Out[2]=2

Generate the conditions for each cell:

Out[4]=4

DistanceTransform for black points on a white background will be similar to VoronoiMesh:

Out[3]=3

2D Voronoi diagrams can be rendered in Graphics3D using Cone primitives:

Out[3]=3
Wolfram Research (2014), VoronoiMesh, Wolfram Language function, https://reference.wolfram.com/language/ref/VoronoiMesh.html (updated 2022).
Wolfram Research (2014), VoronoiMesh, Wolfram Language function, https://reference.wolfram.com/language/ref/VoronoiMesh.html (updated 2022).

Text

Wolfram Research (2014), VoronoiMesh, Wolfram Language function, https://reference.wolfram.com/language/ref/VoronoiMesh.html (updated 2022).

Wolfram Research (2014), VoronoiMesh, Wolfram Language function, https://reference.wolfram.com/language/ref/VoronoiMesh.html (updated 2022).

CMS

Wolfram Language. 2014. "VoronoiMesh." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/VoronoiMesh.html.

Wolfram Language. 2014. "VoronoiMesh." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/VoronoiMesh.html.

APA

Wolfram Language. (2014). VoronoiMesh. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VoronoiMesh.html

Wolfram Language. (2014). VoronoiMesh. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VoronoiMesh.html

BibTeX

@misc{reference.wolfram_2025_voronoimesh, author="Wolfram Research", title="{VoronoiMesh}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/VoronoiMesh.html}", note=[Accessed: 26-March-2025 ]}

@misc{reference.wolfram_2025_voronoimesh, author="Wolfram Research", title="{VoronoiMesh}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/VoronoiMesh.html}", note=[Accessed: 26-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_voronoimesh, organization={Wolfram Research}, title={VoronoiMesh}, year={2022}, url={https://reference.wolfram.com/language/ref/VoronoiMesh.html}, note=[Accessed: 26-March-2025 ]}

@online{reference.wolfram_2025_voronoimesh, organization={Wolfram Research}, title={VoronoiMesh}, year={2022}, url={https://reference.wolfram.com/language/ref/VoronoiMesh.html}, note=[Accessed: 26-March-2025 ]}