Voronoi Diagrams

Grades 8-12
  • Art Art
  • Math Math

Introduction


Image from project2gether.com

Image from thingfuture.com

Image from 3dsoup.com

© 3Dizingof.com Image from Adafruit


Image from ink361.com
A Dirichlet tessellation, or Voronoi diagram, is a partitioning of a plane containing a set of points into convex polygons such that
  • each polygon contains exactly one generating point
  • every point in a given polygon is closer to its generating point than to any other
The individual cells resulting from this process are known as Dirichlet regions, Thiessen polytopes, or Voronoi polygons.

Voronoi diagrams were considered as early as 1644 by René Descartes and were used in 1850 by Lejeune Dirichlet in the investigation of positive quadratic forms. They were also studied by Georgy Voronoi in 1907. Voronoi diagrams find widespread applications in areas such as computer graphics, epidemiology, geophysics, and meteorology. A particularly notable use of Voronoi diagrams is the analysis of the 1854 Cholera epidemic in London, in which physician John Snow determined a strong correlation between death rates and proximity to the infected Broad Street water pump.








Voronoi diagrams have a wide range of uses from calculating the area per tree in the forest, to determining the source of Cholera. In general these diagrams are useful for finding "who is closest to whom." Voronoi diagrams are used:
  • Path planning in the presence of obstacles
  • Model and analyze plant competition
  • Analyzing patterns of urban settlements
  • Geometric modeling
  • Closest pairs algorithms
  • Nearest-neighbor queries
Given a set of points, a Voronoi diagram defines a series of cells surrounding each point. Each cell contains all points that are closer to its defining point than to any other point in the set. As a result the "borders" of the cells are equidistant between the defining points of the adjacent cells.
Say you have a map of your city, and on it you have located a set of points representing every fast food restaurant. Creating a Voronoi diagram from these points would enable you (on your walk through the city) to know which restaurant you're closest to at any given time. Of course, an application that simple could be solved more efficiently via other methods, but let's raise the stakes a bit. What if you want to know the percentage of your walk that will be closest to one particular McDonalds. Suddenly, without a Voronoi diagram, this is tricky. With a Voronoi diagram, however, it's a simple matter of intersecting the line that represents your walk with the cell that surrounds that particular restaurant.

Voronoi diagrams can also be used to make maps, not just analyze them. Say you have a set of points that represent air quality sample locations. To quickly generalize the sample points into a local map… bam! Voronoi diagram!

How to Draw A Voronoi Cell

First way:
voronoi_dr_math.png
Image frommathforum.org

Start with a figure of six points ABCDE (F comes later). To construct the Voronoi cell of A draw the perpendicular bisectors of segments AB, AC, AD, and AE. These perpendicular bisectors enclose a polygon around point A. In the figure above this polygon is the bold black quadrilateral. Only the sides of this polygon form the cell around A. The rest can be removed (as is done in the figure).
from
Second way:
  1. Input Sites.
  2. Connect Nearest Neighbors (shortest line wins).
  3. Find Center Points.
  4. Draw Perpendicular Bisectors.
  5. Trace Cells.
drawing.png
Images from sevensixfive

Use different colors for the input sites, the Delauney lines, and the bisectors.
  1. The input points, step one, are called sites, labeled here A, B, C, etc.
  2. Connect the sites to all of their nearest neighbors without making a line that crosses another. This is known technically as the Delauney Triangulation.
  3. Find and mark the centerpoint of every line on the Delauney graph.
  4. Draw the perpendicular bisector for each Delauney line. This is where careful accuracy, in finding the centerpoints, and in drawing a tight 90 degree angle, pays off. If everything has been done correctly, there will always be three lines converging at a point, unless the input sites are on a perfectly regular rectangular grid.
  5. Retrace the outline of each Voronoi cell from the perpendicular bisectors. There will be one cell for every site, and at the end, each cell is just the set of all surface area points that are closer to its site than any of the other sites, as illustrated in the last panel: A' -> A, B' -> B, etc.

Lesson Purpose

  • To explore voronoi cells.
  • To create art with math.

Materials

  • 3D printer
  • Access to the internet.
  • Applications: MeshLab, Blender, TinkerCad

Resources

Procedure

finished.png
  1. Open MeshLab
  2. Import or add a new form:Filters>Create New Mesh Layer>some_form
  3. Turn on flat lines
    _01_turn_on_flat_lines.png
  4. Enable Layers. This will bring up the Layers sidebar.
    _02_open_layers.png
  5. You want around 300k faces so select Filter>Remeshing>Subdivision surfaces:Loop or midpoint._04_subsurface_midpoint.png
  6. Change the perc field to .5
    _05_midpoint_point5.png
  7. Keep clicking on Apply until you get close to 300k faces
    _06_click_apply_for_300k.png
  8. Select Filter>Sampling>Poisson Disk Sampling
    _07_poisson.png
  9. In the dialog box enter 35
    _08_enter_35.png

    You are looking for about 50 points
    _09_close_to_fifty.png

    The points represent your sites
  10. Select Filter>Sampling>Voronoi Vertex Coloring
    _10_vetex_coloring.png
  11. Make sure your dialog box is set up similar to the one below:
    _11_dialog_window.png
  12. CTRL+click on the top layer and select Flatten Visible Layers_12_flatten.png
  13. Apply flatten
    _13_apply_flatten.png
  14. Remove the interior faces. First click on Render>Color>None
    _14_render_none.png
  15. Select Filters>Selection>Select Faces by Vertex Quality
    _15_vertex_quality.png
  16. Check the Preview checkbox and adjust the sliders
    _16_adjust_sliders.png
  17. Keep adjusting until the selection looks the way you want it to. Click apply and then close the selection window.
    _17_something_like_this.png
  18. Select Filter>Selection>Invert Selection
    _18_invert.png
  19. Apply the Inversion
    _19_invert_apply.png
  20. Click the Delete Faces button.
    _21_delete_faces.png
  21. You should have a single-sided Voronoi mesh.
    _22_result.png
  22. Time to refine the mesh. Select Filters>Smoothing, Fairing, and Deformation>Laplacian Smooth.
    _23_laplacian.png
  23. Apply the filter
    _24_laplacian_apply.png
  24. You still have just a 2D mesh. You need to extrude the mesh. Select Filters>Remeshing, Simplification, and Reconstruction>Uniform Surface Resampling
    _25_mesh_resampling.png
  25. Make sure your dialog box looks similar
    _26_resampling_apply.png
  26. Click Apply. This will take some time to process. Be patient.
  27. Turn off the layer that is not the offset layer./li>
  28. Select the Offset layer. One last smothing algorithm: select Filters>Smoothing, Fairing, and Deformation>Taubin Smooth.
    _27_taubin.png
  29. Keep the defaults and apply Taubin filter
    _28_taubin_apply.png
  30. Export As and save as an STL
    _29_export_as.png

Analysis

  1. Compare the different forms created. What is responsible for the similarities or differences?
  2. Design a practical object that takes advantage of the voronoi algorithm
  3. Explore creating Voronoi diagrams with other applications: TinkerCad and/or Blender