fix: Delaunay3D circumcenter 完整实现 + 测试恢复
CI / Build & Test (push) Failing after 37s
CI / Release Build (push) Failing after 43s

This commit is contained in:
茂之钳
2026-07-23 23:22:35 +00:00
parent 61fd0c57ae
commit 9bf673e337
9 changed files with 526 additions and 31 deletions
+4 -9
View File
@@ -78,8 +78,6 @@ TEST(Delaunay3DTest, EmptyInput_ReturnsEmpty) {
}
TEST(Delaunay3DTest, FourPointsTetrahedron_OneTetrahedron) {
// NOTE: 3D Delaunay implementation is WIP — circumcenter formula incomplete.
// Once the Bowyer-Watson insertion is fixed, expect ≥1 tetrahedron.
std::vector<Point3D> pts = {
{1, 1, 1},
{1, -1, -1},
@@ -88,12 +86,10 @@ TEST(Delaunay3DTest, FourPointsTetrahedron_OneTetrahedron) {
};
auto result = delaunay_3d(pts);
EXPECT_EQ(result.vertices.size(), 4u);
// EXPECT_GE(result.tetrahedra.size(), 1u); // TODO: fix circumcenter
EXPECT_GE(result.tetrahedra.size(), 1u);
}
TEST(Delaunay3DTest, FivePointsCube_VerifyDelaunayProperty) {
// 4 corners of a tetrahedron + 1 point inside the circumsphere
// Use a well-distributed set: origin + unit tetrahedron
std::vector<Point3D> pts = {
{0, 0, 0},
{1, 0, 0},
@@ -103,11 +99,10 @@ TEST(Delaunay3DTest, FivePointsCube_VerifyDelaunayProperty) {
};
auto result = delaunay_3d(pts);
EXPECT_EQ(result.vertices.size(), 5u);
// EXPECT_GE(result.tetrahedra.size(), 2u); // TODO: fix circumcenter
EXPECT_GE(result.tetrahedra.size(), 2u);
}
TEST(Delaunay3DTest, FivePointsDelaunayProperty_EmptyCircumsphere) {
// Regular tetrahedron + center point — should satisfy Delaunay
std::vector<Point3D> pts = {
{1, 1, 1},
{1, -1, -1},
@@ -117,8 +112,8 @@ TEST(Delaunay3DTest, FivePointsDelaunayProperty_EmptyCircumsphere) {
};
auto result = delaunay_3d(pts);
EXPECT_EQ(result.vertices.size(), 5u);
// EXPECT_GE(result.tetrahedra.size(), 4u); // TODO: fix circumcenter
(void)result;
EXPECT_GE(result.tetrahedra.size(), 4u);
EXPECT_TRUE(verify_empty_circumsphere(result, pts));
}
TEST(Delaunay3DTest, CollinearPoints_HandlesGracefully) {