# Delaunay Triangulator

**URL:** <https://fortran-lang.discourse.group/t/delaunay-triangulator/7416>\
**Category:** Uncategorized\
**Created:** [February 16, 2024, 7:41am UTC](https://fortran-lang.discourse.group/t/delaunay-triangulator/7416 "2024-02-16T07:41:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![phangelder](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@phangelder](https://fortran-lang.discourse.group/u/phangelder)\
**Post date:** [February 16, 2024, 7:41am UTC](https://fortran-lang.discourse.group/t/delaunay-triangulator/7416/1 "2024-02-16T07:41:58Z")

</div>

Does anyone know of a fortran version of the Delaunay Triangulator.

[https://www.cs.cmu.edu/~quake/triangle.html](https://www.cs.cmu.edu/~quake/triangle.html)

---

<div class="post-metadata">

**Author:** ![Arjen](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Arjen](https://fortran-lang.discourse.group/u/Arjen)\
**Post date:** [February 16, 2024, 8:16am UTC](https://fortran-lang.discourse.group/t/delaunay-triangulator/7416/2 "2024-02-16T08:16:55Z")

</div>

I have modernised a few packages that generate such a triangular grid for use in interpolation. See [GitHub - arjenmarkus/interpolation2d3d: Interpolation in 2D and 3D, object-oriented interfaces](https://github.com/arjenmarkus/interpolation2d3d). The original code comes the netlib site.

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [February 16, 2024, 8:49am UTC](https://fortran-lang.discourse.group/t/delaunay-triangulator/7416/3 "2024-02-16T08:49:52Z")

</div>

There are a few old libraries out there (not on netlib) that do it. I will try and dig them up during the weekend.

---

<div class="post-metadata">

**Author:** ![rwmsu](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@rwmsu](https://fortran-lang.discourse.group/u/rwmsu)\
**Post date:** [February 16, 2024, 12:31pm UTC](https://fortran-lang.discourse.group/t/delaunay-triangulator/7416/4 "2024-02-16T12:31:05Z")

</div>

I wrote a Fortran-C interop package that provides Fortran interfaces to Shewchuk’s Triangle code about 16 years ago. Only ran the test program but that appeared to work. I’ll upload it to github if there is interest.

---

<div class="post-metadata">

**Author:** ![phangelder](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@phangelder](https://fortran-lang.discourse.group/u/phangelder)\
**Post date:** [February 17, 2024, 9:50am UTC](https://fortran-lang.discourse.group/t/delaunay-triangulator/7416/5 "2024-02-17T09:50:44Z")

</div>

I am trying to find the gradient at each nodal point of a simple hypar shaped surface model with triangular elements. I call

```
call shepard%create_mesh( xc, yc, zc, f )

```

where xc,yc and zc store the centroid of each element and f store the gradient of the surface.  
f is having values ranging from from zero degree to 90 deg.  
Calling shepard%gradient\_point( xcord, ycord, zcord ) at each nodal point return 3 values all less than 1.0.  
Is this correct? If so, how do i recover the slop (angle) at each node.

---

<div class="post-metadata">

**Author:** ![IanMartinAjzenszmidt](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ianmartinajzenszmidt/32/1992_2.png) [@IanMartinAjzenszmidt](https://fortran-lang.discourse.group/u/IanMartinAjzenszmidt)\
**Post date:** [February 17, 2024, 12:02pm UTC](https://fortran-lang.discourse.group/t/delaunay-triangulator/7416/6 "2024-02-17T12:02:08Z")

</div>

`I have not found a ready to run fortran version of the Delaunay Triangulator, but here is one in C  
[Triangle: A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator](https://www.cs.cmu.edu/~quake/triangle.html). The C version can be compiled, built and run, complete with demo example. Read README FOR MORE INFO.

```auto

```

---

<div class="post-metadata">

**Author:** ![phangelder](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@phangelder](https://fortran-lang.discourse.group/u/phangelder)\
**Post date:** [February 18, 2024, 8:22am UTC](https://fortran-lang.discourse.group/t/delaunay-triangulator/7416/7 "2024-02-18T08:22:16Z")

</div>

I have managed to get it worked.  
Thank you Arjen

---

<div class="post-metadata">

**Author:** ![phangelder](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@phangelder](https://fortran-lang.discourse.group/u/phangelder)\
**Post date:** [February 18, 2024, 8:22am UTC](https://fortran-lang.discourse.group/t/delaunay-triangulator/7416/8 "2024-02-18T08:22:25Z")

</div>

Thank you.
