64ad721ed7
- CMake: INTERFACE 库修复、vde_compile_options 顺序修复 - 命名空间: 所有模块添加 using 声明 - 类型补全: Ray3Dd、Point4D - 头文件: tolerance 泛型化、std::optional include - 警告: 放宽 -Wconversion/-Wsign-conversion - 构建结果: 0 errors, 22/25 tests passed
23 lines
622 B
C++
23 lines
622 B
C++
#pragma once
|
|
#include "vde/core/point.h"
|
|
#include <vector>
|
|
#include <array>
|
|
|
|
namespace vde::core {
|
|
using foundation::Point2D;
|
|
using foundation::Point3D;
|
|
using foundation::Vector2D;
|
|
using foundation::Vector3D;
|
|
|
|
struct VoronoiCell {
|
|
Point2D site; // Generator point
|
|
std::vector<Point2D> vertices; // Cell boundary vertices
|
|
std::vector<std::array<int, 2>> edges; // Edge indices into vertices
|
|
};
|
|
|
|
/// 2D Voronoi diagram from Delaunay dual graph
|
|
/// Returns cells for each input point
|
|
std::vector<VoronoiCell> voronoi_2d(const std::vector<Point2D>& points);
|
|
|
|
} // namespace vde::core
|