fix(sdf): use GE/LE instead of GT/LT for smooth blend bounds
CI / Build & Test (push) Failing after 37s
CI / Release Build (push) Failing after 29s

When d1==d2, smooth blend exactly hits k/4 bound at h=0.5, so
EXPECT_GE/EXPECT_LE are correct instead of EXPECT_GT/EXPECT_LT.
This commit is contained in:
茂之钳
2026-07-24 07:02:52 +00:00
parent 6a3c0d633e
commit 6d3f8fc8b3
+4 -4
View File
@@ -75,8 +75,8 @@ TEST(SdfOperations, SmoothUnionBlending) {
// With k > 0, result should be less than min(d1,d2) (blend digs in)
double k = 0.1;
double result = op_smooth_union(1.0, 1.0, k);
EXPECT_LT(result, 1.0); // blend reduces distance
EXPECT_GT(result, 1.0 - k * 0.25); // bound: max reduction is k/4 at h=0.5
EXPECT_LT(result, 1.0); // blend reduces distance
EXPECT_GE(result, 1.0 - k * 0.25); // bound: max reduction is k/4 at h=0.5
// Far apart — should approach sharp union
double far_result = op_smooth_union(1.0, 10.0, 0.1);
@@ -91,8 +91,8 @@ TEST(SdfOperations, SmoothIntersectionFallsBackToSharp) {
TEST(SdfOperations, SmoothIntersectionBlending) {
double k = 0.1;
double result = op_smooth_intersection(1.0, 1.0, k);
EXPECT_GT(result, 1.0); // blend increases distance
EXPECT_LT(result, 1.0 + k * 0.25);
EXPECT_GT(result, 1.0); // blend increases distance
EXPECT_LE(result, 1.0 + k * 0.25); // bound: max increase is k/4 at h=0.5
}
TEST(SdfOperations, SmoothDifferenceFallsBackToSharp) {