fix: onion thickness, repeat boundary tie
CI / Build & Test (push) Failing after 31s
CI / Release Build (push) Failing after 31s

This commit is contained in:
茂之钳
2026-07-24 08:49:24 +00:00
parent f75c1669f7
commit 4660b186a1
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ using core::Vector3D;
} }
[[nodiscard]] inline double op_onion(double d, double thickness) { [[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) ── // ── Domain deformation operators (transform point space) ──
+5 -5
View File
@@ -154,11 +154,11 @@ TEST(SdfOperations, RepeatMapsToUnitCell) {
EXPECT_NEAR(r1.y(), 0.0, 1e-10); EXPECT_NEAR(r1.y(), 0.0, 1e-10);
EXPECT_NEAR(r1.z(), 0.0, 1e-10); EXPECT_NEAR(r1.z(), 0.0, 1e-10);
// Cell boundary → maps near ±1 // Near cell boundary → maps to ±1 (avoid exact ties with round())
auto r2 = op_repeat(Point3D(1.0, 1.0, 1.0), c); auto r2 = op_repeat(Point3D(0.999, 0.999, 0.999), c);
EXPECT_NEAR(r2.x(), 1.0, 1e-10); EXPECT_NEAR(r2.x(), 0.999, 1e-10);
EXPECT_NEAR(r2.y(), 1.0, 1e-10); EXPECT_NEAR(r2.y(), 0.999, 1e-10);
EXPECT_NEAR(r2.z(), 1.0, 1e-10); EXPECT_NEAR(r2.z(), 0.999, 1e-10);
// Outside the cell // Outside the cell
auto r3 = op_repeat(Point3D(3.5, 2.5, 1.5), c); auto r3 = op_repeat(Point3D(3.5, 2.5, 1.5), c);