Files
ViewDesignEngine/include/vde/mesh/delaunay_2d.h
T

17 lines
414 B
C++
Raw Normal View History

#pragma once
#include "vde/core/point.h"
#include <vector>
#include <array>
namespace vde::mesh {
struct DelaunayResult {
std::vector<Point2D> vertices;
std::vector<std::array<int, 3>> triangles; // indices into vertices
};
/// Bowyer-Watson incremental Delaunay triangulation, O(n²) worst, O(n log n) typical
DelaunayResult delaunay_2d(const std::vector<Point2D>& points);
} // namespace vde::mesh