fix: Delaunay3D circumcenter 完整实现 + 测试恢复
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user