2026-07-23 05:27:51 +00:00
|
|
|
#pragma once
|
|
|
|
|
#include "vde/core/point.h"
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <array>
|
|
|
|
|
|
|
|
|
|
namespace vde::mesh {
|
2026-07-23 08:19:24 +00:00
|
|
|
using core::Point2D;
|
|
|
|
|
using core::Point3D;
|
|
|
|
|
using core::Vector3D;
|
2026-07-23 05:27:51 +00:00
|
|
|
|
|
|
|
|
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
|