Skip to content

lyrahgames/delaunay

Repository files navigation

Delaunay Triangulation

A simple implementation of the Bowyer-Watson algorithm to construct the Delaunay triangulation of a given set of points. It was put into an easy-to-use C++ header-only library currently based on the build2 build system.

Read the report.

master
Current

Author

Requirements

Supported Platforms

  • Operating System: Linux | Windows | MacOS
  • Compiler: GCC | Clang | MSVC | MinGW
  • Build System: build2

Installation

The standard installation process will only install the header-only library. If you are interested in installing examples, benchmarks, or tests, you have to run these installation commands manually.

bpkg -d build2-packages cc \
  config.install.root=/usr/local \
  config.install.sudo=sudo

Get the latest package release and build it.

bpkg build https://github.com/lyrahgames/delaunay.git

Install the built package.

bpkg install lyrahgames-delaunay

For uninstalling, do the following.

bpkg uninstall lyrahgames-delaunay

If your package uses an explicit depends: lyrahgames-delaunay make sure to initialize this dependency as a system dependency when creating a new configuration.

bdep init -C @build cc config.cxx=g++ "config.cxx.coptions=-O3" -- "?sys:lyrahgames-delaunay/*"

Usage with build2

For now, there is no official package release on cppget.org. Therefore add this repository in your repositories.manifest file of your package.

:
role: prerequisite
location: https://github.com/lyrahgames/delaunay#master

Add the following entry to the manifest file of your package with an optional version dependency.

depends: lyrahgames-delaunay

Then import the library in your buildfile to be able to link against your own executable or library.

import libs = lyrahgames-delaunay%lib{lyrahgames-delaunay}
exe{myexe}: {hxx cxx}{**} $libs

Examples

#include <random>
#include <vector>
//
#include <lyrahgames/delaunay/bowyer_watson.hpp>

int main() {
  using namespace std;
  using namespace lyrahgames;
  using delaunay::bowyer_watson::point;

  // Initialize oracle for random numbers.
  mt19937 rng{random_device{}()};
  uniform_real_distribution<float> dist{0, 1};
  const auto random = [&] { return dist(rng); };

  // Generate random points.
  vector<point> points(5);
  for (auto& p : points) p = point{random(), random()};

  // Construct Delaunay triangulation.
  const auto elements = delaunay::bowyer_watson::triangulation(points);
}

3D Triangulation Surface Triangles

Tests

Benchmarks

API

Features

Background

Circumcircles and Circumspheres

Bowyer-Watson Algorithm

Implementation Details

References

About

Package for Delaunay Triangulation

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published