feat: v0.5.0 P1 + 差异化功能 — Voronoi, Marching Cubes, 曲率, 序列化, Python绑定
新增功能: - core: 2D Voronoi 图(Delaunay 对偶图) - mesh: Marching Cubes(完整256项三角表 + SDF 辅助函数) - mesh: 离散曲率(Gaussian/Mean, Cotan 公式) - foundation: 二进制序列化(版本化格式,Little-Endian) - python: pybind11 绑定(30+ API 暴露) - marching_cubes.h: SDF 基本体(球/盒)+ 光滑布尔
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include "vde/core/point.h"
|
||||
#include <vector>
|
||||
#include <array>
|
||||
|
||||
namespace vde::core {
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user