Files
hm b378b191da
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
build(io/brep): VDE-006/013/067 依赖环解除 + 模块开关接线 + 裸 mesh:: 清理
VDE-006:新增集成层 vde_io 归集跨层 TU,依赖图变严格单向
io→brep→{sdf,mesh}→{curves,collision}→spatial→core→foundation,删除
-Wl,--start-group;BrepModel 桥接(brep_to_mesh/mesh_bridge)归 vde_brep。
移除兜底后暴露并修复两处反向依赖:core/icp.cpp→vde_spatial,
brep/parallel_boolean.cpp→vde::boolean(VDE_DEPS_brep 增 boolean)。

VDE-013:顶层解析 VDE_BUILD_*→VDE_ENABLE_*,VDE_DEPS_* 级联关闭,
src/ 与 tests/ 按 VDE_ENABLE_* 门控,使模块开关真正生效。

VDE-067:全仓裸 mesh:: 清理为完全限定名 vde::mesh::(正则命中 0)。

回归:全量构建 EXIT 0;test_icp/test_parallel_boolean/test_geometry_completion
全绿。既有缺陷(FEA 球面网格挂起、CAM in_range 哨兵、3MF 装配、时序竞态)
经取证与本批无关,记入 docs/reference/audit-feedback.md §5。
2026-10-07 06:39:07 +08:00

36 lines
994 B
C++

/// bench_delaunay.cpp — 2D Delaunay triangulation benchmarks
///
/// Metrics:
/// Delaunay2D/N{size} — Bowyer-Watson triangulation time for N random points
#include <benchmark/benchmark.h>
#include <vde/mesh/delaunay_2d.h>
#include <random>
#include <vector>
using namespace vde;
namespace {
std::vector<core::Point2D> random_points_2d(int n, double R = 1000.0) {
std::mt19937 rng(42);
std::uniform_real_distribution<double> dist(-R, R);
std::vector<core::Point2D> pts;
pts.reserve(n);
for (int i = 0; i < n; ++i)
pts.emplace_back(dist(rng), dist(rng));
return pts;
}
} // namespace
static void Delaunay2D(benchmark::State& state) {
auto pts = random_points_2d(state.range(0));
for (auto _ : state) {
auto result = vde::mesh::delaunay_2d(pts);
benchmark::DoNotOptimize(result.triangles.size());
}
state.SetItemsProcessed(state.iterations() * state.range(0));
}
BENCHMARK(Delaunay2D)->Arg(100)->Arg(1000)->Arg(10000);