Skip to content

Commit

Permalink
some minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pca006132 committed Dec 9, 2024
1 parent 77c9069 commit 4bda6a3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
4 changes: 4 additions & 0 deletions src/csg_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ std::shared_ptr<CsgLeafNode> 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";
Expand Down
6 changes: 4 additions & 2 deletions src/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

#include "./impl.h"

#include <string.h>

#include <algorithm>
#include <atomic>
#include <map>
Expand All @@ -29,6 +27,10 @@
#include <iostream>
#endif

#ifdef MANIFOLD_DEBUG
#include <string.h>
#endif

namespace {
using namespace manifold;

Expand Down
24 changes: 8 additions & 16 deletions src/properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<vec3, 3> 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) {
Expand Down

0 comments on commit 4bda6a3

Please sign in to comment.