diff --git a/README.md b/README.md index 1abde3b..a772f38 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Here are the timings (in seconds) for computing the Boolean intersection between |-------------------|-----------------------:|--------------------------:|---------------:|--------------:|-----------------------:|---------------:| | **Open** | 4.6 | FAILED | 2.8 | 1.7 | FAILED | FAILED | | **Open & closed** | FAILED | 70.5 | 2.0 | 1.3 | FAILED | FAILED | -| **Closed** | 57.4 | FAILED | 6.4 | 3.5 | 8.9 | 1.7 | +| **Closed** | 57.4 | FAILED | 6.4 | 3.4 | 8.9 | 1.7 | | **Non-manifold** | FAILED | FAILED | 0.5 | 0.3 | FAILED | FAILED | ¹ Ran with `KIGUMI_NUM_THREADS=1`. ² Configured with `-DMANIFOLD_PAR=TBB`. diff --git a/include/kigumi/Find_coplanar_faces.h b/include/kigumi/Find_coplanar_faces.h index 450be31..0e82360 100644 --- a/include/kigumi/Find_coplanar_faces.h +++ b/include/kigumi/Find_coplanar_faces.h @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -43,14 +44,14 @@ class Find_coplanar_faces { triangle_to_fi.emplace(tri, fi); } - for (auto fi : b.faces()) { + parallel_do(b.faces().begin(), b.faces().end(), [&](Face_index fi) { auto tri = triangle(b, fi, b_points); auto it = triangle_to_fi.find(tri); if (it != triangle_to_fi.end()) { a_face_tags.at(it->second.idx()) = Face_tag::COPLANAR; b_face_tags.at(fi.idx()) = Face_tag::COPLANAR; - continue; + return; } it = triangle_to_fi.find(opposite(tri)); @@ -58,7 +59,7 @@ class Find_coplanar_faces { a_face_tags.at(it->second.idx()) = Face_tag::OPPOSITE; b_face_tags.at(fi.idx()) = Face_tag::OPPOSITE; } - } + }); return {std::move(left_face_tags), std::move(right_face_tags)}; }