项目作者: plimkilde

项目描述 :
Command-line tool to perform 2D Delaunay triangulation on a set of points
高级语言: C++
项目地址: git://github.com/plimkilde/delaunify.git
创建时间: 2018-06-01T12:33:09Z
项目社区:https://github.com/plimkilde/delaunify

开源协议:Other

下载


delaunify

delaunify is a command-line tool to perform 2D Delaunay
triangulation
on a set
of points. It is designed to be a simple
filter) that accepts point
coordinates streamed in via stdin, then outputs the vertex indices of the
generated triangles to stdout.

delaunify uses the
Geogram library
by Bruno Lévy, specifically its Delaunay PSM (pluggable software module, a
library standalone autogenerated from the Geogram source tree). The Geogram
version included here is currently 1.6.4.

Building

Linux

The software should build with g++ using the following command:

  1. g++ -std=gnu++11 -O3 -fopenmp -frounding-math -ffp-contract=off -Wall delaunify.cpp Delaunay_psm.cpp -o delaunify -lm

Windows

Cygwin

It is possible to build using Cygwin after applying the provided patch for the
PSM:

  1. patch --binary < cygwin_psm_patch.patch

(The --binary flag helps deal with any misery caused by mismatching line
endings.)

Then, building is similar to that on Linux, though with a -D__linux__ flag
added:

  1. g++ -std=gnu++11 -D__linux__ -O3 -fopenmp -frounding-math -ffp-contract=off -Wall delaunify.cpp Delaunay_psm.cpp -o delaunify -lm

MinGW

Not yet working.

Running

delaunify expects input through stdin in the form of plaintext, one line for
each point, with x and y coordinates separated by whitespace. The generated
output will contain the (zero-based) indices of the vertices in the
triangulation, specified for one triangle per line.

Example with a heredoc as input:

  1. ./delaunify > faces.txt << EOF
  2. 0.5 1.0
  3. 2.0 0.5
  4. 1.0 1.5
  5. 3.0 3.5
  6. EOF

Using a text file as input:

  1. ./delaunify > faces.txt < vertices.txt