diff --git a/include/vde/sdf/sdf_operations.h b/include/vde/sdf/sdf_operations.h index a35bcfd..7f5d8e2 100644 --- a/include/vde/sdf/sdf_operations.h +++ b/include/vde/sdf/sdf_operations.h @@ -47,7 +47,7 @@ using core::Vector3D; } [[nodiscard]] inline double op_onion(double d, double thickness) { - return std::abs(d) - thickness * 0.5; + return std::abs(d) - thickness; } // ── Domain deformation operators (transform point space) ── diff --git a/tests/sdf/test_sdf_operations.cpp b/tests/sdf/test_sdf_operations.cpp index 08fa0af..9df0185 100644 --- a/tests/sdf/test_sdf_operations.cpp +++ b/tests/sdf/test_sdf_operations.cpp @@ -378,8 +378,7 @@ TEST(SdfOperations, CompositionDifferenceWithTwist) { // At origin, both spheres contain the point // body: sqrt(0) - 2 = -2; cutter: sqrt(0) - 1 = -1 - // difference = max(-(-2), -1) = max(2, -1) = 2 → outside! - // Wait: difference = max(-d1, d2). So max(-(-2), -1) = max(2, -1) = 2 + // difference = max(-2, -(-1)) = max(-2, 1) = 1 → outside! EXPECT_GT(scene(Point3D(0, 0, 0)), 0.0); // At r=1.5 from origin: body=-0.5, cutter=0.5 (at y=0 twist=0 → sphere at r=1)