v0.1.0: 初始工程骨架 — 7模块 40头文件 32源文件 17文档 Apache-2.0
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
add_executable(delaunay main.cpp)
|
||||
target_link_libraries(delaunay PRIVATE vde)
|
||||
@@ -0,0 +1,17 @@
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
#include "vde/mesh/delaunay_2d.h"
|
||||
|
||||
int main() {
|
||||
using namespace vde::mesh;
|
||||
std::vector<Point2D> pts;
|
||||
std::mt19937 rng(42);
|
||||
std::uniform_real_distribution<double> dist(0, 1);
|
||||
for (int i = 0; i < 100; ++i)
|
||||
pts.emplace_back(dist(rng), dist(rng));
|
||||
|
||||
auto result = delaunay_2d(pts);
|
||||
std::cout << "Delaunay: " << result.vertices.size()
|
||||
<< " vertices, " << result.triangles.size() << " triangles\n";
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user