diff --git a/src/csg_tree.cpp b/src/csg_tree.cpp index b49689ad3..4c5082f76 100644 --- a/src/csg_tree.cpp +++ b/src/csg_tree.cpp @@ -109,14 +109,6 @@ std::shared_ptr CsgLeafNode::Transform(const mat3x4 &m) const { CsgNodeType CsgLeafNode::GetNodeType() const { return CsgNodeType::Leaf; } std::shared_ptr ImplToLeaf(Manifold::Impl &&impl) { -#ifdef MANIFOLD_DEBUG - if (impl.IsSelfIntersecting()) { - dump_lock.lock(); - std::cout << "self-intersection detected" << std::endl; - dump_lock.unlock(); - throw logicErr("self intersection detected"); - } -#endif return std::make_shared(std::make_shared(impl)); } @@ -126,7 +118,7 @@ std::shared_ptr SimpleBoolean(const Manifold::Impl &a, try { Boolean3 boolean(a, b, op); auto impl = boolean.Result(op); - if (impl.IsSelfIntersecting()) { + if (ManifoldParams().intermediateChecks && impl.IsSelfIntersecting()) { dump_lock.lock(); std::cout << "self-intersection detected" << std::endl; dump_lock.unlock(); diff --git a/src/properties.cpp b/src/properties.cpp index 40b2cb1f0..c40b9d578 100644 --- a/src/properties.cpp +++ b/src/properties.cpp @@ -231,7 +231,7 @@ bool Manifold::Impl::IsSelfIntersecting() const { // distance epsilon squared for (int i : {0, 1, 2}) for (int j : {0, 1, 2}) - if (linalg::distance2(tri_x[i], tri_y[j]) <= epsilonSq) return true; + if (distance2(tri_x[i], tri_y[j]) <= epsilonSq) return true; if (DistanceTriangleTriangleSquared(tri_x, tri_y) == 0.0) { #ifdef MANIFOLD_DEBUG