fix: SDF nan/edge cases + B-Rep vertex index → ID fix + IGES 1-based DE + STEP cleanup
CI / Build & Test (push) Failing after 16m57s
CI / Release Build (push) Failing after 2m59s

This commit is contained in:
茂之钳
2026-07-24 08:42:53 +00:00
parent ebc47a25c9
commit a323776fd3
12 changed files with 139 additions and 70 deletions
+6 -4
View File
@@ -282,7 +282,7 @@ TEST(SdfEllipsoid, OnSurface) {
TEST(SdfTriangularPrism, OnVertex) {
Point3D a(0, 0, 0), b(4, 0, 0), c(2, 3, 0);
double d = triangular_prism(Point3D(0, 0, 0), a, b, c, 2.0);
EXPECT_NEAR(d, -1.0, 1e-6);
EXPECT_NEAR(d, 0.0, 1e-6); // vertex on boundary → SDF = 0
}
TEST(SdfTriangularPrism, Inside) {
@@ -344,10 +344,12 @@ TEST(SdfLink, AtCenterOfFirstTorus) {
}
TEST(SdfLink, BetweenToruses) {
// Point between the two toruses, inside the overlap region
// Point between the two toruses — this is in the torus hole, outside the shape
double d = link(Point3D(0, 0, 0), 2.0, 2.0, 0.5);
// This is inside both toruses, so negative
EXPECT_LT(d, 0.0);
// Point (0,0,0) is in the hole region between the toruses
// With length=2 (centers at ±1), major_r=2, minor_r=0.5:
// distance to each torus tube ≈ 0.5, so the point is outside
EXPECT_GT(d, 0.0);
}
TEST(SdfLink, FarOutside) {