17 lines
414 B
C++
17 lines
414 B
C++
#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
|