• Stars
    star
    372
  • Rank 114,858 (Top 3 %)
  • Language
    C++
  • License
    BSD 3-Clause "New...
  • Created over 12 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

2D constrained Delaunay triangulation library

Since there are no Input validation of the data given for triangulation you need to think about this. Poly2Tri does not support repeat points within epsilon.

  • If you have a cyclic function that generates random points make sure you don't add the same coordinate twice.
  • If you are given input and aren't sure same point exist twice you need to check for this yourself.
  • Only simple polygons are supported. You may add holes or interior Steiner points
  • Interior holes must not touch other holes, nor touch the polyline boundary
  • Use the library in this order:
    1. Initialize CDT with a simple polyline (this defines the constrained edges)
    2. Add holes if necessary (also simple polylines)
    3. Add Steiner points
    4. Triangulate

Make sure you understand the preceding notice before posting an issue. If you have an issue not covered by the above, include your data-set with the problem. The only easy day was yesterday; have a nice day.

TESTBED INSTALLATION GUIDE

Dependencies

Core poly2tri lib:

  • Standard Template Library (STL)

Unit tests:

  • Boost (filesystem, test framework)

Testbed:

Build the library

With the ninja build system installed:

mkdir build && cd build
cmake -GNinja ..
cmake --build .

Build and run with unit tests

With the ninja build system:

mkdir build && cd build
cmake -GNinja -DP2T_BUILD_TESTS=ON ..
cmake --build .
ctest --output-on-failure

Build with the testbed

mkdir build && cd build
cmake -GNinja -DP2T_BUILD_TESTBED=ON ..
cmake --build .

Running the Examples

Load data points from a file:

build/testbed/p2t <filename> <center_x> <center_y> <zoom>

Load data points from a file and automatically fit the geometry to the window:

build/testbed/p2t <filename>

Random distribution of points inside a constrained box:

build/testbed/p2t random <num_points> <box_radius> <zoom>

Examples:

build/testbed/p2t testbed/data/dude.dat 350 500 3

build/testbed/p2t testbed/data/nazca_monkey.dat

build/testbed/p2t random 10 100 5.0
build/testbed/p2t random 1000 20000 0.025

References

  • Domiter V. and Zalik B. (2008) Sweepโ€line algorithm for constrained Delaunay triangulation
  • FlipScan by library author Thomas ร…hlรฉn

FlipScan

More Repositories

1

jngl

Easy to use cross-platform 2D game library for C++
C++
180
star
2

chipmunkpp

Chipmunk Physics C++ wrapper
C++
40
star
3

coffeepp

Little language that compiles into C++
C++
30
star
4

smart_cmd

Runs cmd.exe in the current path of your Windows Explorer
C++
15
star
5

pwcalculator

Automatically calculate strong passwords
Python
14
star
6

clicolors

HTML
10
star
7

ja

Frontend for Ninja focusing on a faster edit, compile, debug cycle
Python
8
star
8

pwcalculator-qt

Automatically calculate strong passwords
C++
4
star
9

jntetri

Tetris clone using the JNGL 2D library
C++
3
star
10

minclude

Remove unneeded include directives from your C/C++ project
Python
3
star
11

jngl-rocket

Integrating RmlUi (libRocket) with JNGL
C++
2
star
12

jngl-starter

JNGL project template
C++
2
star
13

sleeptimer

Shutdown timer for Linux and Windows
Python
2
star
14

taluka

Taluka IDE written in Python (Gtk+) and based on gedit
Python
1
star
15

jhasse.github.io

HTML
1
star
16

dotfiles

configuration files for emacs, vim, ...
Vim Script
1
star
17

mingw-docker

Docker image with MinGW cross-compiler based on Fedora
1
star
18

cpp-style-guide

Style guide for C++
1
star
19

android-ndk-docker

Docker image containing the Android SDK and NDK
Dockerfile
1
star
20

coreutilspp

Reimplementation of some of the GNU Coreutils in C++, useful to be used in Windows' cmd.exe.
C++
1
star
21

boost-libs

Boost binaries for Windows, Mac and iOS
C++
1
star
22

binpath

Get the directory path of the running binary of a C++ program
C
1
star
23

android-qt-docker

Docker image with Qt for Android
Dockerfile
1
star
24

mingw32-docker

Docker image with MinGW cross-compiler (32 bit) based on Fedora 27
1
star