diff --git a/src/csg_tree.cpp b/src/csg_tree.cpp index 4c9bf343e..dfc4f46c7 100644 --- a/src/csg_tree.cpp +++ b/src/csg_tree.cpp @@ -117,6 +117,10 @@ std::shared_ptr SimpleBoolean(const Manifold::Impl &a, #ifdef MANIFOLD_DEBUG auto dump = [&]() { if (ManifoldParams().verbose) { + std::cout << "LHS self-intersecting: " << a.IsSelfIntersecting() + << std::endl; + std::cout << "RHS self-intersecting: " << b.IsSelfIntersecting() + << std::endl; dump_lock.lock(); if (op == OpType::Add) std::cout << "Add"; diff --git a/src/impl.cpp b/src/impl.cpp index 5a5ebc61a..7eff62ff2 100644 --- a/src/impl.cpp +++ b/src/impl.cpp @@ -14,8 +14,6 @@ #include "./impl.h" -#include - #include #include #include @@ -29,6 +27,10 @@ #include #endif +#ifdef MANIFOLD_DEBUG +#include +#endif + namespace { using namespace manifold; diff --git a/src/properties.cpp b/src/properties.cpp index a54666602..5b6403a6c 100644 --- a/src/properties.cpp +++ b/src/properties.cpp @@ -236,22 +236,14 @@ bool Manifold::Impl::IsSelfIntersecting() const { if (DistanceTriangleTriangleSquared(tri_x, tri_y) == 0.0) { // try to move the triangles around the normal of the other face std::array tmp_x, tmp_y; - for (int i : {0, 1, 2}) - tmp_x[i] = tri_x[i] + epsilon_ * faceNormal_[y]; - if (DistanceTriangleTriangleSquared(tmp_x, tri_y) > 0.0) - return true; - for (int i : {0, 1, 2}) - tmp_x[i] = tri_x[i] - epsilon_ * faceNormal_[y]; - if (DistanceTriangleTriangleSquared(tmp_x, tri_y) > 0.0) - return true; - for (int i : {0, 1, 2}) - tmp_y[i] = tri_y[i] + epsilon_ * faceNormal_[x]; - if (DistanceTriangleTriangleSquared(tri_x, tmp_y) > 0.0) - return true; - for (int i : {0, 1, 2}) - tmp_y[i] = tri_y[i] - epsilon_ * faceNormal_[x]; - if (DistanceTriangleTriangleSquared(tri_x, tmp_y) > 0.0) - return true; + for (int i : {0, 1, 2}) tmp_x[i] = tri_x[i] + epsilon_ * faceNormal_[y]; + if (DistanceTriangleTriangleSquared(tmp_x, tri_y) > 0.0) return true; + for (int i : {0, 1, 2}) tmp_x[i] = tri_x[i] - epsilon_ * faceNormal_[y]; + if (DistanceTriangleTriangleSquared(tmp_x, tri_y) > 0.0) return true; + for (int i : {0, 1, 2}) tmp_y[i] = tri_y[i] + epsilon_ * faceNormal_[x]; + if (DistanceTriangleTriangleSquared(tri_x, tmp_y) > 0.0) return true; + for (int i : {0, 1, 2}) tmp_y[i] = tri_y[i] - epsilon_ * faceNormal_[x]; + if (DistanceTriangleTriangleSquared(tri_x, tmp_y) > 0.0) return true; #ifdef MANIFOLD_DEBUG if (verbose) {