Delaunay Triangulation in (hopefully) idiomatic Scala : single file, efficient
Switch branches/tags
Nothing to show
Clone or download
Latest commit 54df564 Jul 13, 2014


Delaunay Triangulation in Scala


After looking around for a decent stand-alone Scala implementation of Delaunay triangulation, I gave up finding anything that seemed idiomatic to me.

The approach is per the "bourke method" described in However, it's heavily modified here, because the original code is very mutable-state heavy, whereas this scala version is 'pure immutable'.

File Layout

This works in a straight-forward sbt setting.
The meat of it is just the src/main/scala/Delaunay.scala file.

Please let me know if there are insufficient comments.

The .geany folder contains a simple file layout for my geany editor extension geany-project-tree.


import Deluany
val triangles = Deluanay.Triangulation(measurements.toList)


No dependencies : This is really a single scala file.

One can easily redefine 'Vector2' to be the same as the corresponding class in your own projects : It is just a Seq[ (Float, Float) ].


The scala file also contains a main, so that you can run a simple demo test.

cd DelaunayScala

and then copy-paste the output into a 'Processing' session (free), to see the geometry of the output.