fix(sdf): use GE/LE instead of GT/LT for smooth blend bounds
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:
@@ -76,7 +76,7 @@ TEST(SdfOperations, SmoothUnionBlending) {
|
||||
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_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);
|
||||
@@ -92,7 +92,7 @@ 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_LE(result, 1.0 + k * 0.25); // bound: max increase is k/4 at h=0.5
|
||||
}
|
||||
|
||||
TEST(SdfOperations, SmoothDifferenceFallsBackToSharp) {
|
||||
|
||||
Reference in New Issue
Block a user