SDFIdk / DHMQC

Processing suite for the Danish Digital Elevation Model

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delaunay triangulation makes excessive copies of data

plimkilde opened this issue · comments

The glue code in delaunator_wrapper.cpp copies both the input vertex coordinates and the resulting vertex indices of the Delaunay triangulation, the latter in order to work around manual memory management. This copying causes excessive memory usage.

As delaunator-cpp builds a C++ vector<size_t> for the indices, we are currently forced to duplicate the data as C ints in order to pass them around to the index-building functions etc. that expect int arrays. I am currently working on changing those functions to accept something better than int arrays anyway.