fix: SDF nan/edge cases + B-Rep vertex index → ID fix + IGES 1-based DE + STEP cleanup
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user