C++ 2D tessellation