# Voronoi tessellation source code

**URL:** <https://fortran-lang.discourse.group/t/voronoi-tessellation-source-code/680>\
**Category:** Help\
**Created:** [February 7, 2021, 8:52pm UTC](https://fortran-lang.discourse.group/t/voronoi-tessellation-source-code/680 "2021-02-07T20:52:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![VOLCANIC\_9](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/volcanic_9/32/1047_2.png) [@VOLCANIC\_9](https://fortran-lang.discourse.group/u/VOLCANIC_9)\
**Post date:** [February 7, 2021, 8:52pm UTC](https://fortran-lang.discourse.group/t/voronoi-tessellation-source-code/680/1 "2021-02-07T20:52:38Z")

</div>

I don’t know it is regular to ask about source code, but I ask my question:

In mathematics and computational geometry, a Delaunay triangulation for a given set P of discrete points in a plane is a triangulation DT§ such that no point in P is inside the circumcircle of any triangle in DT§. A Voronoi diagram is a kind of tesselation that divided the medium into polygons in 2D and polyhedrons in 3D.

I want to know is there any library to calculated the Voronoi diagram in two-dimension and three-dimension. I also have data of Delaunay triangulation via a written-code from myself. So, if there is any library that determines the Voronoi diagram from Delaunay triangulation, it would be desired.

I will appreciate any comments that give me a little help and forgive me for writing shortcomings.

---

<div class="post-metadata">

**Author:** ![Beliavsky](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Beliavsky](https://fortran-lang.discourse.group/u/Beliavsky)\
**Post date:** [February 7, 2021, 9:00pm UTC](https://fortran-lang.discourse.group/t/voronoi-tessellation-source-code/680/2 "2021-02-07T21:00:32Z")

</div>

Are any of John Burkardt’s 1327 (!) Fortran [codes](https://people.sc.fsu.edu/~jburkardt/f_src/f_src.html) relevant? “Voronoi tessellation” and “Delaunay triangulation” appear in the descriptions of several of them.

---

<div class="post-metadata">

**Author:** ![VOLCANIC\_9](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/volcanic_9/32/1047_2.png) [@VOLCANIC\_9](https://fortran-lang.discourse.group/u/VOLCANIC_9)\
**Post date:** [February 7, 2021, 9:18pm UTC](https://fortran-lang.discourse.group/t/voronoi-tessellation-source-code/680/3 "2021-02-07T21:18:09Z")

</div>

Thanks for the comment. I scrutinized mentioned library but it doesn’t contain simple Voronoi tessellation.

---

<div class="post-metadata">

**Author:** ![nshaffer](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/nshaffer/32/161_2.png) [@nshaffer](https://fortran-lang.discourse.group/u/nshaffer)\
**Post date:** [February 8, 2021, 12:33am UTC](https://fortran-lang.discourse.group/t/voronoi-tessellation-source-code/680/4 "2021-02-08T00:33:06Z")

</div>

I code I work on uses parts of Javier Bernal’s suite of programs refractored into modules. [Selected Developed Software](https://math.nist.gov/~JBernal/JBernal_Sft.html)  
That refactoring was done before I was involved, and I cannot vouch that the underlying code is “nice”, only that it works.

You may consider interfacing with the C qhull library, which is what scipy wraps for its Delaunay/Voronoi function. I have not tried this myself, though.

---

<div class="post-metadata">

**Author:** ![VOLCANIC\_9](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/volcanic_9/32/1047_2.png) [@VOLCANIC\_9](https://fortran-lang.discourse.group/u/VOLCANIC_9)\
**Post date:** [February 8, 2021, 8:21am UTC](https://fortran-lang.discourse.group/t/voronoi-tessellation-source-code/680/5 "2021-02-08T08:21:03Z")

</div>

I also find a library in c++. Probably, I use the interface approach with other libraries in three-dimensional.  
Do you know interface with which language (Python, C++, or C) has enough speed?

---

<div class="post-metadata">

**Author:** ![Rob777](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@Rob777](https://fortran-lang.discourse.group/u/Rob777)\
**Post date:** [February 8, 2021, 9:09am UTC](https://fortran-lang.discourse.group/t/voronoi-tessellation-source-code/680/6 "2021-02-08T09:09:43Z")

</div>

Take a look at this [page](https://people.math.sc.edu/Burkardt/f_src/geompack2/geompack2.html). GEOMPACK3 can be what are you searching for.

---

<div class="post-metadata">

**Author:** ![VOLCANIC\_9](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/volcanic_9/32/1047_2.png) [@VOLCANIC\_9](https://fortran-lang.discourse.group/u/VOLCANIC_9)\
**Post date:** [February 8, 2021, 9:17am UTC](https://fortran-lang.discourse.group/t/voronoi-tessellation-source-code/680/7 "2021-02-08T09:17:39Z")

</div>

Thanks for your comment.  
“\* **VORNBR** : determines the Voronoi neighbors of an eyepoint.”  
As mentioned on the page, it has just one subroutine to find neighbors in two-dimensional and not a whole of Voronoi diagram.

---

<div class="post-metadata">

**Author:** ![Rob777](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@Rob777](https://fortran-lang.discourse.group/u/Rob777)\
**Post date:** [February 8, 2021, 9:24am UTC](https://fortran-lang.discourse.group/t/voronoi-tessellation-source-code/680/8 "2021-02-08T09:24:55Z")

</div>

The subtitle of GEOMPACK2 reads " Voronoi diagrams, Delaunay triangulations". Maybe more than one subroutine must be used to obtain a Voronoi diagram…

---

<div class="post-metadata">

**Author:** ![VOLCANIC\_9](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/volcanic_9/32/1047_2.png) [@VOLCANIC\_9](https://fortran-lang.discourse.group/u/VOLCANIC_9)\
**Post date:** [February 8, 2021, 10:07am UTC](https://fortran-lang.discourse.group/t/voronoi-tessellation-source-code/680/9 "2021-02-08T10:07:51Z")

</div>

I checked the source code. There is no output for the Voronoi diagram.
