From 3b72b473d8514757fb494c40f497114a8b785b1d Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:27:29 -0400 Subject: [PATCH 01/20] Define a test for simple offset booleans This is intended to check for performance regressions - the BRL-CAD logic performing this operation using v2.4.5 ran considerably faster. Note - removing in-loop assertions for triangle count > 0 with the intermediate forms greatly increases the speed, but they are placed there deliberately to simulate what BRL-CAD does to validate the output of the booleans on an incremental basis. In the event of a boolean failure or invalid output being produced for any reason, we want to be able to capture the *exact* inputs responsible - which means we need to check after each boolean operation to validate the results and catch any bad intermediate states at the time they are produced. --- test/boolean_complex_test.cpp | 109 +++++++++++++++++++++++++++ test/models/Generic_Twin_91.1.t0.glb | Bin 0 -> 6204 bytes 2 files changed, 109 insertions(+) create mode 100644 test/models/Generic_Twin_91.1.t0.glb diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index 5f99e88eb..5bfde32ed 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -17,6 +17,7 @@ #endif #include "manifold/manifold.h" #include "manifold/polygon.h" +#include "../src/utils.h" // For RotateUp #include "test.h" using namespace manifold; @@ -1030,4 +1031,112 @@ TEST(BooleanComplex, HullMask) { MeshGL mesh = ret.GetMeshGL(); } +TEST(BooleanComplex, SimpleOffset) { + std::string file = __FILE__; + std::string dir = file.substr(0, file.rfind('/')); + MeshGL seeds = ImportMesh(dir + "/models/" + "Generic_Twin_91.1.t0.glb"); + EXPECT_TRUE(seeds.NumTri() > 10); + EXPECT_TRUE(seeds.NumVert() > 10); + // Find unique edges + std::set> edges; + for (size_t i = 0; i < seeds.triVerts.size()/3; i++) { + int eind[3]; + for (int j = 0; j < 3; j++) + eind[j] = seeds.triVerts[i*3+j]; + int e11, e12, e21, e22, e31, e32; + e11 = (eind[0] < eind[1]) ? eind[0] : eind[1]; + e12 = (eind[1] < eind[0]) ? eind[0] : eind[1]; + e21 = (eind[1] < eind[2]) ? eind[1] : eind[2]; + e22 = (eind[2] < eind[1]) ? eind[1] : eind[2]; + e31 = (eind[2] < eind[0]) ? eind[2] : eind[0]; + e32 = (eind[0] < eind[2]) ? eind[2] : eind[0]; + edges.insert(std::make_pair(e11, e12)); + edges.insert(std::make_pair(e21, e22)); + edges.insert(std::make_pair(e31, e32)); + } + manifold::Manifold c; + // Vertex Spheres + Manifold sph = Manifold::Sphere(1, 8); + for (size_t i = 0; i < seeds.NumVert(); i++) { + vec3 vpos(seeds.vertProperties[3*i+0], seeds.vertProperties[3*i+1], seeds.vertProperties[3*i+2]); + Manifold vsph = sph.Translate(vpos); + manifold::Manifold left = c; + manifold::Manifold right(vsph); + if (!right.NumTri()) + continue; + c = left.Boolean(right, manifold::OpType::Add); + EXPECT_TRUE(c.NumTri() > 0); + } + // Edge Cylinders + std::set>::iterator e_it; + for (e_it = edges.begin(); e_it != edges.end(); ++e_it) { + vec3 ev1 = vec3(seeds.vertProperties[3*e_it->first+0], seeds.vertProperties[3*e_it->first+1], seeds.vertProperties[3*e_it->first+2]); + vec3 ev2 = vec3(seeds.vertProperties[3*e_it->second+0], seeds.vertProperties[3*e_it->second+1], seeds.vertProperties[3*e_it->second+2]); + vec3 edge = ev2 - ev1; + double len = la::length(edge); + if (len < std::numeric_limits::min()) + continue; + // TODO - workaround, shouldn't be necessary + if (len < 0.03) + continue; + manifold::Manifold origin_cyl = manifold::Manifold::Cylinder(len, 1, 1, 8); + vec3 evec(-1*edge.x, -1*edge.y, edge.z); + manifold::Manifold rotated_cyl = origin_cyl.Transform(manifold::RotateUp(evec)); + manifold::Manifold right = rotated_cyl.Translate(ev1); + if (!right.NumTri()) + continue; + manifold::Manifold left = c; + c = left.Boolean(right, manifold::OpType::Add); + EXPECT_TRUE(c.NumTri() > 0); + } + // Triangle Volumes + for (size_t i = 0; i < seeds.NumTri(); i++) { + int eind[3]; + for (int j = 0; j < 3; j++) + eind[j] = seeds.triVerts[i*3+j]; + vec3 ev1 = vec3(seeds.vertProperties[3*eind[0]+0], seeds.vertProperties[3*eind[0]+1], seeds.vertProperties[3*eind[0]+2]); + vec3 ev2 = vec3(seeds.vertProperties[3*eind[1]+0], seeds.vertProperties[3*eind[1]+1], seeds.vertProperties[3*eind[1]+2]); + vec3 ev3 = vec3(seeds.vertProperties[3*eind[2]+0], seeds.vertProperties[3*eind[2]+1], seeds.vertProperties[3*eind[2]+2]); + vec3 a = ev1 - ev3; + vec3 b = ev2 - ev3; + vec3 n = la::normalize(la::cross(a, b)); + // Extrude the points above and below the plane of the triangle + vec3 pnts[6]; + pnts[0] = ev1 + n; + pnts[1] = ev2 + n; + pnts[2] = ev3 + n; + pnts[3] = ev1 - n; + pnts[4] = ev2 - n; + pnts[5] = ev3 - n; + // Construct the points and faces of the new manifold + double pts[3*6]; + /* 1 */ pts[0] = pnts[4].x; pts[1] = pnts[4].y; pts[2] = pnts[4].z; + /* 2 */ pts[3] = pnts[3].x; pts[4] = pnts[3].y; pts[5] = pnts[3].z; + /* 3 */ pts[6] = pnts[0].x; pts[7] = pnts[0].y; pts[8] = pnts[0].z; + /* 4 */ pts[9] = pnts[1].x; pts[10] = pnts[1].y; pts[11] = pnts[1].z; + /* 5 */ pts[12] = pnts[5].x; pts[13] = pnts[5].y; pts[14] = pnts[5].z; + /* 6 */ pts[15] = pnts[2].x; pts[16] = pnts[2].y; pts[17] = pnts[2].z; + int faces[24]; + faces[ 0] = 0; faces[ 1] = 1; faces[ 2] = 4; // 1 2 5 + faces[ 3] = 2; faces[ 4] = 3; faces[ 5] = 5; // 3 4 6 + faces[ 6] = 1; faces[ 7] = 0; faces[ 8] = 3; // 2 1 4 + faces[ 9] = 3; faces[10] = 2; faces[11] = 1; // 4 3 2 + faces[12] = 3; faces[13] = 0; faces[14] = 4; // 4 1 5 + faces[15] = 4; faces[16] = 5; faces[17] = 3; // 5 6 4 + faces[18] = 5; faces[19] = 4; faces[20] = 1; // 6 5 2 + faces[21] = 1; faces[22] = 2; faces[23] = 5; // 2 3 6 + manifold::MeshGL64 tri_m; + for (int j = 0; j < 18; j++) + tri_m.vertProperties.insert(tri_m.vertProperties.end(), pts[j]); + for (int j = 0; j < 24; j++) + tri_m.triVerts.insert(tri_m.triVerts.end(), faces[j]); + manifold::Manifold left = c; + manifold::Manifold right(tri_m); + if (!right.NumTri()) + continue; + c = left.Boolean(right, manifold::OpType::Add); + EXPECT_TRUE(c.NumTri() > 0); + } +} + #endif diff --git a/test/models/Generic_Twin_91.1.t0.glb b/test/models/Generic_Twin_91.1.t0.glb new file mode 100644 index 0000000000000000000000000000000000000000..e0f6906e521eb020ac9fe79f2915f6d821d5ca94 GIT binary patch literal 6204 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�yeeGId&rb|4QFJ^?82i5hKj?y!pJbUsEWW4=5~{)nA`tlWXep#V=Wj`W;&da zVV)H!^BvB}l=+5N7#ZeS5oTCXS(rx#hA_j5l$j1^WSC(^%1nndGR(IkWxm51nKIw- z3M0cjE5ZybQf4}wkzs}vDKj0;$S}`}l=%*4WXi0=D~zlqSB0pXd4(!PRwdXaDj2 Date: Fri, 18 Oct 2024 14:49:18 -0400 Subject: [PATCH 02/20] formatting --- test/boolean_complex_test.cpp | 112 ++++++++++++++++++++++++---------- 1 file changed, 80 insertions(+), 32 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index 5bfde32ed..a6a8181ba 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -15,9 +15,9 @@ #ifdef MANIFOLD_CROSS_SECTION #include "manifold/cross_section.h" #endif +#include "../src/utils.h" // For RotateUp #include "manifold/manifold.h" #include "manifold/polygon.h" -#include "../src/utils.h" // For RotateUp #include "test.h" using namespace manifold; @@ -1039,10 +1039,9 @@ TEST(BooleanComplex, SimpleOffset) { EXPECT_TRUE(seeds.NumVert() > 10); // Find unique edges std::set> edges; - for (size_t i = 0; i < seeds.triVerts.size()/3; i++) { + for (size_t i = 0; i < seeds.NumTri(); i++) { int eind[3]; - for (int j = 0; j < 3; j++) - eind[j] = seeds.triVerts[i*3+j]; + for (int j = 0; j < 3; j++) eind[j] = seeds.triVerts[i*3+j]; int e11, e12, e21, e22, e31, e32; e11 = (eind[0] < eind[1]) ? eind[0] : eind[1]; e12 = (eind[1] < eind[0]) ? eind[0] : eind[1]; @@ -1058,27 +1057,29 @@ TEST(BooleanComplex, SimpleOffset) { // Vertex Spheres Manifold sph = Manifold::Sphere(1, 8); for (size_t i = 0; i < seeds.NumVert(); i++) { - vec3 vpos(seeds.vertProperties[3*i+0], seeds.vertProperties[3*i+1], seeds.vertProperties[3*i+2]); + vec3 vpos(seeds.vertProperties[3*i+0], seeds.vertProperties[3*i+1], + seeds.vertProperties[3 * i + 2]); Manifold vsph = sph.Translate(vpos); manifold::Manifold left = c; manifold::Manifold right(vsph); - if (!right.NumTri()) - continue; + if (!right.NumTri()) continue; c = left.Boolean(right, manifold::OpType::Add); EXPECT_TRUE(c.NumTri() > 0); } // Edge Cylinders std::set>::iterator e_it; for (e_it = edges.begin(); e_it != edges.end(); ++e_it) { - vec3 ev1 = vec3(seeds.vertProperties[3*e_it->first+0], seeds.vertProperties[3*e_it->first+1], seeds.vertProperties[3*e_it->first+2]); - vec3 ev2 = vec3(seeds.vertProperties[3*e_it->second+0], seeds.vertProperties[3*e_it->second+1], seeds.vertProperties[3*e_it->second+2]); + vec3 ev1 = vec3(seeds.vertProperties[3*e_it->first+0], + seeds.vertProperties[3*e_it->first+1], + seeds.vertProperties[3*e_it->first+2]); + vec3 ev2 = vec3(seeds.vertProperties[3*e_it->second+0], + seeds.vertProperties[3*e_it->second+1], + seeds.vertProperties[3*e_it->second+2]); vec3 edge = ev2 - ev1; double len = la::length(edge); - if (len < std::numeric_limits::min()) - continue; + if (len < std::numeric_limits::min()) continue; // TODO - workaround, shouldn't be necessary - if (len < 0.03) - continue; + if (len < 0.03) continue; manifold::Manifold origin_cyl = manifold::Manifold::Cylinder(len, 1, 1, 8); vec3 evec(-1*edge.x, -1*edge.y, edge.z); manifold::Manifold rotated_cyl = origin_cyl.Transform(manifold::RotateUp(evec)); @@ -1094,9 +1095,15 @@ TEST(BooleanComplex, SimpleOffset) { int eind[3]; for (int j = 0; j < 3; j++) eind[j] = seeds.triVerts[i*3+j]; - vec3 ev1 = vec3(seeds.vertProperties[3*eind[0]+0], seeds.vertProperties[3*eind[0]+1], seeds.vertProperties[3*eind[0]+2]); - vec3 ev2 = vec3(seeds.vertProperties[3*eind[1]+0], seeds.vertProperties[3*eind[1]+1], seeds.vertProperties[3*eind[1]+2]); - vec3 ev3 = vec3(seeds.vertProperties[3*eind[2]+0], seeds.vertProperties[3*eind[2]+1], seeds.vertProperties[3*eind[2]+2]); + vec3 ev1 = vec3(seeds.vertProperties[3*eind[0]+0], + seeds.vertProperties[3*eind[0]+1], + seeds.vertProperties[3*eind[0]+2]); + vec3 ev2 = vec3(seeds.vertProperties[3*eind[1]+0], + seeds.vertProperties[3*eind[1]+1], + seeds.vertProperties[3*eind[1]+2]); + vec3 ev3 = vec3(seeds.vertProperties[3*eind[2]+0], + seeds.vertProperties[3*eind[2]+1], + seeds.vertProperties[3*eind[2]+2]); vec3 a = ev1 - ev3; vec3 b = ev2 - ev3; vec3 n = la::normalize(la::cross(a, b)); @@ -1110,21 +1117,63 @@ TEST(BooleanComplex, SimpleOffset) { pnts[5] = ev3 - n; // Construct the points and faces of the new manifold double pts[3*6]; - /* 1 */ pts[0] = pnts[4].x; pts[1] = pnts[4].y; pts[2] = pnts[4].z; - /* 2 */ pts[3] = pnts[3].x; pts[4] = pnts[3].y; pts[5] = pnts[3].z; - /* 3 */ pts[6] = pnts[0].x; pts[7] = pnts[0].y; pts[8] = pnts[0].z; - /* 4 */ pts[9] = pnts[1].x; pts[10] = pnts[1].y; pts[11] = pnts[1].z; - /* 5 */ pts[12] = pnts[5].x; pts[13] = pnts[5].y; pts[14] = pnts[5].z; - /* 6 */ pts[15] = pnts[2].x; pts[16] = pnts[2].y; pts[17] = pnts[2].z; + /* 1 */ + pts[0] = pnts[4].x; + pts[1] = pnts[4].y; + pts[2] = pnts[4].z; + /* 2 */ + pts[3] = pnts[3].x; + pts[4] = pnts[3].y; + pts[5] = pnts[3].z; + /* 3 */ + pts[6] = pnts[0].x; + pts[7] = pnts[0].y; + pts[8] = pnts[0].z; + /* 4 */ + pts[9] = pnts[1].x; + pts[10] = pnts[1].y; + pts[11] = pnts[1].z; + /* 5 */ + pts[12] = pnts[5].x; + pts[13] = pnts[5].y; + pts[14] = pnts[5].z; + /* 6 */ + pts[15] = pnts[2].x; + pts[16] = pnts[2].y; + pts[17] = pnts[2].z; int faces[24]; - faces[ 0] = 0; faces[ 1] = 1; faces[ 2] = 4; // 1 2 5 - faces[ 3] = 2; faces[ 4] = 3; faces[ 5] = 5; // 3 4 6 - faces[ 6] = 1; faces[ 7] = 0; faces[ 8] = 3; // 2 1 4 - faces[ 9] = 3; faces[10] = 2; faces[11] = 1; // 4 3 2 - faces[12] = 3; faces[13] = 0; faces[14] = 4; // 4 1 5 - faces[15] = 4; faces[16] = 5; faces[17] = 3; // 5 6 4 - faces[18] = 5; faces[19] = 4; faces[20] = 1; // 6 5 2 - faces[21] = 1; faces[22] = 2; faces[23] = 5; // 2 3 6 + // 1 2 5 + faces[ 0] = 0; + faces[ 1] = 1; + faces[ 2] = 4; + // 3 4 6 + faces[ 3] = 2; + faces[ 4] = 3; + faces[ 5] = 5; + // 2 1 4 + faces[ 6] = 1; + faces[ 7] = 0; + faces[ 8] = 3; + // 4 3 2 + faces[ 9] = 3; + faces[10] = 2; + faces[11] = 1; + // 4 1 5 + faces[12] = 3; + faces[13] = 0; + faces[14] = 4; + // 5 6 4 + faces[15] = 4; + faces[16] = 5; + faces[17] = 3; + // 6 5 2 + faces[18] = 5; + faces[19] = 4; + faces[20] = 1; + // 2 3 6 + faces[21] = 1; + faces[22] = 2; + faces[23] = 5; manifold::MeshGL64 tri_m; for (int j = 0; j < 18; j++) tri_m.vertProperties.insert(tri_m.vertProperties.end(), pts[j]); @@ -1132,8 +1181,7 @@ TEST(BooleanComplex, SimpleOffset) { tri_m.triVerts.insert(tri_m.triVerts.end(), faces[j]); manifold::Manifold left = c; manifold::Manifold right(tri_m); - if (!right.NumTri()) - continue; + if (!right.NumTri()) continue; c = left.Boolean(right, manifold::OpType::Add); EXPECT_TRUE(c.NumTri() > 0); } From a0211349e001338d62b646316c9ea88fdf02c5df Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:58:31 -0400 Subject: [PATCH 03/20] More formatting --- test/boolean_complex_test.cpp | 69 +++++++++++++++++------------------ 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index a6a8181ba..d30aa1484 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -15,7 +15,7 @@ #ifdef MANIFOLD_CROSS_SECTION #include "manifold/cross_section.h" #endif -#include "../src/utils.h" // For RotateUp +#include "../src/utils.h" // For RotateUp #include "manifold/manifold.h" #include "manifold/polygon.h" #include "test.h" @@ -1041,7 +1041,7 @@ TEST(BooleanComplex, SimpleOffset) { std::set> edges; for (size_t i = 0; i < seeds.NumTri(); i++) { int eind[3]; - for (int j = 0; j < 3; j++) eind[j] = seeds.triVerts[i*3+j]; + for (int j = 0; j < 3; j++) eind[j] = seeds.triVerts[i * 3 + j]; int e11, e12, e21, e22, e31, e32; e11 = (eind[0] < eind[1]) ? eind[0] : eind[1]; e12 = (eind[1] < eind[0]) ? eind[0] : eind[1]; @@ -1057,7 +1057,7 @@ TEST(BooleanComplex, SimpleOffset) { // Vertex Spheres Manifold sph = Manifold::Sphere(1, 8); for (size_t i = 0; i < seeds.NumVert(); i++) { - vec3 vpos(seeds.vertProperties[3*i+0], seeds.vertProperties[3*i+1], + vec3 vpos(seeds.vertProperties[3 * i + 0], seeds.vertProperties[3 * i + 1], seeds.vertProperties[3 * i + 2]); Manifold vsph = sph.Translate(vpos); manifold::Manifold left = c; @@ -1069,23 +1069,23 @@ TEST(BooleanComplex, SimpleOffset) { // Edge Cylinders std::set>::iterator e_it; for (e_it = edges.begin(); e_it != edges.end(); ++e_it) { - vec3 ev1 = vec3(seeds.vertProperties[3*e_it->first+0], - seeds.vertProperties[3*e_it->first+1], - seeds.vertProperties[3*e_it->first+2]); - vec3 ev2 = vec3(seeds.vertProperties[3*e_it->second+0], - seeds.vertProperties[3*e_it->second+1], - seeds.vertProperties[3*e_it->second+2]); + vec3 ev1 = vec3(seeds.vertProperties[3 * e_it->first + 0], + seeds.vertProperties[3 * e_it->first + 1], + seeds.vertProperties[3 * e_it->first + 2]); + vec3 ev2 = vec3(seeds.vertProperties[3 * e_it->second + 0], + seeds.vertProperties[3 * e_it->second + 1], + seeds.vertProperties[3 * e_it->second + 2]); vec3 edge = ev2 - ev1; double len = la::length(edge); if (len < std::numeric_limits::min()) continue; // TODO - workaround, shouldn't be necessary if (len < 0.03) continue; manifold::Manifold origin_cyl = manifold::Manifold::Cylinder(len, 1, 1, 8); - vec3 evec(-1*edge.x, -1*edge.y, edge.z); - manifold::Manifold rotated_cyl = origin_cyl.Transform(manifold::RotateUp(evec)); + vec3 evec(-1 * edge.x, -1 * edge.y, edge.z); + manifold::Manifold rotated_cyl = + origin_cyl.Transform(manifold::RotateUp(evec)); manifold::Manifold right = rotated_cyl.Translate(ev1); - if (!right.NumTri()) - continue; + if (!right.NumTri()) continue; manifold::Manifold left = c; c = left.Boolean(right, manifold::OpType::Add); EXPECT_TRUE(c.NumTri() > 0); @@ -1093,17 +1093,16 @@ TEST(BooleanComplex, SimpleOffset) { // Triangle Volumes for (size_t i = 0; i < seeds.NumTri(); i++) { int eind[3]; - for (int j = 0; j < 3; j++) - eind[j] = seeds.triVerts[i*3+j]; - vec3 ev1 = vec3(seeds.vertProperties[3*eind[0]+0], - seeds.vertProperties[3*eind[0]+1], - seeds.vertProperties[3*eind[0]+2]); - vec3 ev2 = vec3(seeds.vertProperties[3*eind[1]+0], - seeds.vertProperties[3*eind[1]+1], - seeds.vertProperties[3*eind[1]+2]); - vec3 ev3 = vec3(seeds.vertProperties[3*eind[2]+0], - seeds.vertProperties[3*eind[2]+1], - seeds.vertProperties[3*eind[2]+2]); + for (int j = 0; j < 3; j++) eind[j] = seeds.triVerts[i * 3 + j]; + vec3 ev1 = vec3(seeds.vertProperties[3 * eind[0] + 0], + seeds.vertProperties[3 * eind[0] + 1], + seeds.vertProperties[3 * eind[0] + 2]); + vec3 ev2 = vec3(seeds.vertProperties[3 * eind[1] + 0], + seeds.vertProperties[3 * eind[1] + 1], + seeds.vertProperties[3 * eind[1] + 2]); + vec3 ev3 = vec3(seeds.vertProperties[3 * eind[2] + 0], + seeds.vertProperties[3 * eind[2] + 1], + seeds.vertProperties[3 * eind[2] + 2]); vec3 a = ev1 - ev3; vec3 b = ev2 - ev3; vec3 n = la::normalize(la::cross(a, b)); @@ -1116,7 +1115,7 @@ TEST(BooleanComplex, SimpleOffset) { pnts[4] = ev2 - n; pnts[5] = ev3 - n; // Construct the points and faces of the new manifold - double pts[3*6]; + double pts[3 * 6]; /* 1 */ pts[0] = pnts[4].x; pts[1] = pnts[4].y; @@ -1143,19 +1142,19 @@ TEST(BooleanComplex, SimpleOffset) { pts[17] = pnts[2].z; int faces[24]; // 1 2 5 - faces[ 0] = 0; - faces[ 1] = 1; - faces[ 2] = 4; + faces[0] = 0; + faces[1] = 1; + faces[2] = 4; // 3 4 6 - faces[ 3] = 2; - faces[ 4] = 3; - faces[ 5] = 5; + faces[3] = 2; + faces[4] = 3; + faces[5] = 5; // 2 1 4 - faces[ 6] = 1; - faces[ 7] = 0; - faces[ 8] = 3; + faces[6] = 1; + faces[7] = 0; + faces[8] = 3; // 4 3 2 - faces[ 9] = 3; + faces[9] = 3; faces[10] = 2; faces[11] = 1; // 4 1 5 From 51d9179d8e6b1fd6c9b58f4b9435ad51805f9f73 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:44:06 -0400 Subject: [PATCH 04/20] Per suggestion from elalish, simplify edge pair setup --- test/boolean_complex_test.cpp | 37 ++++++++++++++--------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index d30aa1484..db404719c 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1037,21 +1037,15 @@ TEST(BooleanComplex, SimpleOffset) { MeshGL seeds = ImportMesh(dir + "/models/" + "Generic_Twin_91.1.t0.glb"); EXPECT_TRUE(seeds.NumTri() > 10); EXPECT_TRUE(seeds.NumVert() > 10); - // Find unique edges - std::set> edges; + // Unique edges + std::vector> edges; for (size_t i = 0; i < seeds.NumTri(); i++) { - int eind[3]; - for (int j = 0; j < 3; j++) eind[j] = seeds.triVerts[i * 3 + j]; - int e11, e12, e21, e22, e31, e32; - e11 = (eind[0] < eind[1]) ? eind[0] : eind[1]; - e12 = (eind[1] < eind[0]) ? eind[0] : eind[1]; - e21 = (eind[1] < eind[2]) ? eind[1] : eind[2]; - e22 = (eind[2] < eind[1]) ? eind[1] : eind[2]; - e31 = (eind[2] < eind[0]) ? eind[2] : eind[0]; - e32 = (eind[0] < eind[2]) ? eind[2] : eind[0]; - edges.insert(std::make_pair(e11, e12)); - edges.insert(std::make_pair(e21, e22)); - edges.insert(std::make_pair(e31, e32)); + const int k[3] = {1, 2, 0}; + for (const int j : {0, 1, 2}) { + int v1 = seeds.triVerts[i * 3 + j]; + int v2 = seeds.triVerts[i * 3 + k[j]]; + if (v2 > v1) edges.push_back(std::make_pair(v1, v2)); + } } manifold::Manifold c; // Vertex Spheres @@ -1067,14 +1061,13 @@ TEST(BooleanComplex, SimpleOffset) { EXPECT_TRUE(c.NumTri() > 0); } // Edge Cylinders - std::set>::iterator e_it; - for (e_it = edges.begin(); e_it != edges.end(); ++e_it) { - vec3 ev1 = vec3(seeds.vertProperties[3 * e_it->first + 0], - seeds.vertProperties[3 * e_it->first + 1], - seeds.vertProperties[3 * e_it->first + 2]); - vec3 ev2 = vec3(seeds.vertProperties[3 * e_it->second + 0], - seeds.vertProperties[3 * e_it->second + 1], - seeds.vertProperties[3 * e_it->second + 2]); + for (size_t i = 0; i < edges.size(); i++) { + vec3 ev1 = vec3(seeds.vertProperties[3 * edges[i].first + 0], + seeds.vertProperties[3 * edges[i].first + 1], + seeds.vertProperties[3 * edges[i].first + 2]); + vec3 ev2 = vec3(seeds.vertProperties[3 * edges[i].second + 0], + seeds.vertProperties[3 * edges[i].second + 1], + seeds.vertProperties[3 * edges[i].second + 2]); vec3 edge = ev2 - ev1; double len = la::length(edge); if (len < std::numeric_limits::min()) continue; From 03186b5da728cb8e3baf723cb57c22f2092c0ec2 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:05:20 -0400 Subject: [PATCH 05/20] Switch to a Status() check - appears to have the same slowing effect. --- test/boolean_complex_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index db404719c..64580dbd9 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1058,7 +1058,7 @@ TEST(BooleanComplex, SimpleOffset) { manifold::Manifold right(vsph); if (!right.NumTri()) continue; c = left.Boolean(right, manifold::OpType::Add); - EXPECT_TRUE(c.NumTri() > 0); + EXPECT_EQ(c.Status(), Manifold::Error::NoError); } // Edge Cylinders for (size_t i = 0; i < edges.size(); i++) { @@ -1081,7 +1081,7 @@ TEST(BooleanComplex, SimpleOffset) { if (!right.NumTri()) continue; manifold::Manifold left = c; c = left.Boolean(right, manifold::OpType::Add); - EXPECT_TRUE(c.NumTri() > 0); + EXPECT_EQ(c.Status(), Manifold::Error::NoError); } // Triangle Volumes for (size_t i = 0; i < seeds.NumTri(); i++) { @@ -1175,7 +1175,7 @@ TEST(BooleanComplex, SimpleOffset) { manifold::Manifold right(tri_m); if (!right.NumTri()) continue; c = left.Boolean(right, manifold::OpType::Add); - EXPECT_TRUE(c.NumTri() > 0); + EXPECT_EQ(c.Status(), Manifold::Error::NoError); } } From 1f47f80305267429e91843d7819c2f65d14a61a1 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:08:12 -0400 Subject: [PATCH 06/20] Move the checks out of the loops --- test/boolean_complex_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index 64580dbd9..19a78af1d 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1058,8 +1058,8 @@ TEST(BooleanComplex, SimpleOffset) { manifold::Manifold right(vsph); if (!right.NumTri()) continue; c = left.Boolean(right, manifold::OpType::Add); - EXPECT_EQ(c.Status(), Manifold::Error::NoError); } + EXPECT_EQ(c.Status(), Manifold::Error::NoError); // Edge Cylinders for (size_t i = 0; i < edges.size(); i++) { vec3 ev1 = vec3(seeds.vertProperties[3 * edges[i].first + 0], @@ -1081,8 +1081,8 @@ TEST(BooleanComplex, SimpleOffset) { if (!right.NumTri()) continue; manifold::Manifold left = c; c = left.Boolean(right, manifold::OpType::Add); - EXPECT_EQ(c.Status(), Manifold::Error::NoError); } + EXPECT_EQ(c.Status(), Manifold::Error::NoError); // Triangle Volumes for (size_t i = 0; i < seeds.NumTri(); i++) { int eind[3]; @@ -1175,8 +1175,8 @@ TEST(BooleanComplex, SimpleOffset) { manifold::Manifold right(tri_m); if (!right.NumTri()) continue; c = left.Boolean(right, manifold::OpType::Add); - EXPECT_EQ(c.Status(), Manifold::Error::NoError); } + EXPECT_EQ(c.Status(), Manifold::Error::NoError); } #endif From 89065dd7833d55933c8367f4734091ae43b4517e Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:21:31 -0400 Subject: [PATCH 07/20] Use initializer lists for better compactness --- test/boolean_complex_test.cpp | 100 +++++++++------------------------- 1 file changed, 25 insertions(+), 75 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index 19a78af1d..316f8b21f 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1087,85 +1087,35 @@ TEST(BooleanComplex, SimpleOffset) { for (size_t i = 0; i < seeds.NumTri(); i++) { int eind[3]; for (int j = 0; j < 3; j++) eind[j] = seeds.triVerts[i * 3 + j]; - vec3 ev1 = vec3(seeds.vertProperties[3 * eind[0] + 0], - seeds.vertProperties[3 * eind[0] + 1], - seeds.vertProperties[3 * eind[0] + 2]); - vec3 ev2 = vec3(seeds.vertProperties[3 * eind[1] + 0], - seeds.vertProperties[3 * eind[1] + 1], - seeds.vertProperties[3 * eind[1] + 2]); - vec3 ev3 = vec3(seeds.vertProperties[3 * eind[2] + 0], - seeds.vertProperties[3 * eind[2] + 1], - seeds.vertProperties[3 * eind[2] + 2]); - vec3 a = ev1 - ev3; - vec3 b = ev2 - ev3; + std::vector ev; + for (int j = 0; j < 3; j++) { + ev.push_back(vec3(seeds.vertProperties[3 * eind[j] + 0], + seeds.vertProperties[3 * eind[j] + 1], + seeds.vertProperties[3 * eind[j] + 2])); + } + vec3 a = ev[0] - ev[2]; + vec3 b = ev[1] - ev[2]; vec3 n = la::normalize(la::cross(a, b)); // Extrude the points above and below the plane of the triangle vec3 pnts[6]; - pnts[0] = ev1 + n; - pnts[1] = ev2 + n; - pnts[2] = ev3 + n; - pnts[3] = ev1 - n; - pnts[4] = ev2 - n; - pnts[5] = ev3 - n; + for (int j = 0; j < 3; j++) pnts[j] = ev[j] + n; + for (int j = 3; j < 6; j++) pnts[j] = ev[j] - n; // Construct the points and faces of the new manifold - double pts[3 * 6]; - /* 1 */ - pts[0] = pnts[4].x; - pts[1] = pnts[4].y; - pts[2] = pnts[4].z; - /* 2 */ - pts[3] = pnts[3].x; - pts[4] = pnts[3].y; - pts[5] = pnts[3].z; - /* 3 */ - pts[6] = pnts[0].x; - pts[7] = pnts[0].y; - pts[8] = pnts[0].z; - /* 4 */ - pts[9] = pnts[1].x; - pts[10] = pnts[1].y; - pts[11] = pnts[1].z; - /* 5 */ - pts[12] = pnts[5].x; - pts[13] = pnts[5].y; - pts[14] = pnts[5].z; - /* 6 */ - pts[15] = pnts[2].x; - pts[16] = pnts[2].y; - pts[17] = pnts[2].z; - int faces[24]; - // 1 2 5 - faces[0] = 0; - faces[1] = 1; - faces[2] = 4; - // 3 4 6 - faces[3] = 2; - faces[4] = 3; - faces[5] = 5; - // 2 1 4 - faces[6] = 1; - faces[7] = 0; - faces[8] = 3; - // 4 3 2 - faces[9] = 3; - faces[10] = 2; - faces[11] = 1; - // 4 1 5 - faces[12] = 3; - faces[13] = 0; - faces[14] = 4; - // 5 6 4 - faces[15] = 4; - faces[16] = 5; - faces[17] = 3; - // 6 5 2 - faces[18] = 5; - faces[19] = 4; - faces[20] = 1; - // 2 3 6 - faces[21] = 1; - faces[22] = 2; - faces[23] = 5; + double pts[3 * 6] = {pnts[4].x, pnts[4].y, pnts[4].z, pnts[3].x, pnts[3].y, + pnts[3].z, pnts[0].x, pnts[0].y, pnts[0].z, pnts[1].x, + pnts[1].y, pnts[1].z, pnts[5].x, pnts[5].y, pnts[5].z, + pnts[2].x, pnts[2].y, pnts[2].z}; + int faces[24] = { + faces[0] = 0, faces[1] = 1, faces[2] = 4, // 1 2 5 + faces[3] = 2, faces[4] = 3, faces[5] = 5, // 3 4 6 + faces[6] = 1, faces[7] = 0, faces[8] = 3, // 2 1 4 + faces[9] = 3, faces[10] = 2, faces[11] = 1, // 4 3 2 + faces[12] = 3, faces[13] = 0, faces[14] = 4, // 4 1 5 + faces[15] = 4, faces[16] = 5, faces[17] = 3, // 5 6 4 + faces[18] = 5, faces[19] = 4, faces[20] = 1, // 6 5 2 + faces[21] = 1, faces[22] = 2, faces[23] = 5 // 2 3 6 + }; + manifold::MeshGL64 tri_m; for (int j = 0; j < 18; j++) tri_m.vertProperties.insert(tri_m.vertProperties.end(), pts[j]); From fe9e2206c33af3da4be37d7634b5c38d0809db5a Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 18:36:43 -0400 Subject: [PATCH 08/20] Restore in-loop checks with explanation --- test/boolean_complex_test.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index 316f8b21f..fa28138f7 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1031,6 +1031,14 @@ TEST(BooleanComplex, HullMask) { MeshGL mesh = ret.GetMeshGL(); } +// Note - For the moment, the Status() checks are included in the loops to +// (more or less) mimic the BRL-CAD behavior of checking the mesh for +// unexpected output after each iteration. Doing so is not ideal - it +// *massively* slows the overall evaluation - but it also seems to be +// triggering behavior that avoids a triangulation failure. +// +// Eventually, once other issues are resolved, the in-loop checks should be +// removed in favor of the top level checks. TEST(BooleanComplex, SimpleOffset) { std::string file = __FILE__; std::string dir = file.substr(0, file.rfind('/')); @@ -1058,8 +1066,11 @@ TEST(BooleanComplex, SimpleOffset) { manifold::Manifold right(vsph); if (!right.NumTri()) continue; c = left.Boolean(right, manifold::OpType::Add); + // See above discussion + EXPECT_EQ(c.Status(), Manifold::Error::NoError); } - EXPECT_EQ(c.Status(), Manifold::Error::NoError); + // See above discussion + // EXPECT_EQ(c.Status(), Manifold::Error::NoError); // Edge Cylinders for (size_t i = 0; i < edges.size(); i++) { vec3 ev1 = vec3(seeds.vertProperties[3 * edges[i].first + 0], @@ -1081,8 +1092,11 @@ TEST(BooleanComplex, SimpleOffset) { if (!right.NumTri()) continue; manifold::Manifold left = c; c = left.Boolean(right, manifold::OpType::Add); + // See above discussion + EXPECT_EQ(c.Status(), Manifold::Error::NoError); } - EXPECT_EQ(c.Status(), Manifold::Error::NoError); + // See above discussion + // EXPECT_EQ(c.Status(), Manifold::Error::NoError); // Triangle Volumes for (size_t i = 0; i < seeds.NumTri(); i++) { int eind[3]; @@ -1125,8 +1139,11 @@ TEST(BooleanComplex, SimpleOffset) { manifold::Manifold right(tri_m); if (!right.NumTri()) continue; c = left.Boolean(right, manifold::OpType::Add); + // See above discussion + EXPECT_EQ(c.Status(), Manifold::Error::NoError); } - EXPECT_EQ(c.Status(), Manifold::Error::NoError); + // See above discussion + // EXPECT_EQ(c.Status(), Manifold::Error::NoError); } #endif From 55ca9a9dea3f3fddad14ea7858603e35a4a2f629 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 18:39:48 -0400 Subject: [PATCH 09/20] Simplify with += syntax. --- test/boolean_complex_test.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index fa28138f7..2ce9d4182 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1062,10 +1062,8 @@ TEST(BooleanComplex, SimpleOffset) { vec3 vpos(seeds.vertProperties[3 * i + 0], seeds.vertProperties[3 * i + 1], seeds.vertProperties[3 * i + 2]); Manifold vsph = sph.Translate(vpos); - manifold::Manifold left = c; - manifold::Manifold right(vsph); - if (!right.NumTri()) continue; - c = left.Boolean(right, manifold::OpType::Add); + if (!vsph.NumTri()) continue; + c += vsph; // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); } @@ -1090,8 +1088,7 @@ TEST(BooleanComplex, SimpleOffset) { origin_cyl.Transform(manifold::RotateUp(evec)); manifold::Manifold right = rotated_cyl.Translate(ev1); if (!right.NumTri()) continue; - manifold::Manifold left = c; - c = left.Boolean(right, manifold::OpType::Add); + c += right; // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); } @@ -1135,10 +1132,9 @@ TEST(BooleanComplex, SimpleOffset) { tri_m.vertProperties.insert(tri_m.vertProperties.end(), pts[j]); for (int j = 0; j < 24; j++) tri_m.triVerts.insert(tri_m.triVerts.end(), faces[j]); - manifold::Manifold left = c; manifold::Manifold right(tri_m); if (!right.NumTri()) continue; - c = left.Boolean(right, manifold::OpType::Add); + c += right; // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); } From ba6027e003e4d6d64deda35eed8c540bff4a0f80 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 18:47:15 -0400 Subject: [PATCH 10/20] Revert "Simplify with += syntax." Getting CI failure, see if this had an impact somehow... This reverts commit 55ca9a9dea3f3fddad14ea7858603e35a4a2f629. --- test/boolean_complex_test.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index 2ce9d4182..fa28138f7 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1062,8 +1062,10 @@ TEST(BooleanComplex, SimpleOffset) { vec3 vpos(seeds.vertProperties[3 * i + 0], seeds.vertProperties[3 * i + 1], seeds.vertProperties[3 * i + 2]); Manifold vsph = sph.Translate(vpos); - if (!vsph.NumTri()) continue; - c += vsph; + manifold::Manifold left = c; + manifold::Manifold right(vsph); + if (!right.NumTri()) continue; + c = left.Boolean(right, manifold::OpType::Add); // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); } @@ -1088,7 +1090,8 @@ TEST(BooleanComplex, SimpleOffset) { origin_cyl.Transform(manifold::RotateUp(evec)); manifold::Manifold right = rotated_cyl.Translate(ev1); if (!right.NumTri()) continue; - c += right; + manifold::Manifold left = c; + c = left.Boolean(right, manifold::OpType::Add); // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); } @@ -1132,9 +1135,10 @@ TEST(BooleanComplex, SimpleOffset) { tri_m.vertProperties.insert(tri_m.vertProperties.end(), pts[j]); for (int j = 0; j < 24; j++) tri_m.triVerts.insert(tri_m.triVerts.end(), faces[j]); + manifold::Manifold left = c; manifold::Manifold right(tri_m); if (!right.NumTri()) continue; - c += right; + c = left.Boolean(right, manifold::OpType::Add); // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); } From f215cbd997b6e4fb414b45a1ca9bdd41c45817e2 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 19:16:21 -0400 Subject: [PATCH 11/20] Revert "Use initializer lists for better compactness" Still not passing?? Revert another commit. This reverts commit 89065dd7833d55933c8367f4734091ae43b4517e. --- test/boolean_complex_test.cpp | 100 +++++++++++++++++++++++++--------- 1 file changed, 75 insertions(+), 25 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index fa28138f7..6ed0cd8e4 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1101,35 +1101,85 @@ TEST(BooleanComplex, SimpleOffset) { for (size_t i = 0; i < seeds.NumTri(); i++) { int eind[3]; for (int j = 0; j < 3; j++) eind[j] = seeds.triVerts[i * 3 + j]; - std::vector ev; - for (int j = 0; j < 3; j++) { - ev.push_back(vec3(seeds.vertProperties[3 * eind[j] + 0], - seeds.vertProperties[3 * eind[j] + 1], - seeds.vertProperties[3 * eind[j] + 2])); - } - vec3 a = ev[0] - ev[2]; - vec3 b = ev[1] - ev[2]; + vec3 ev1 = vec3(seeds.vertProperties[3 * eind[0] + 0], + seeds.vertProperties[3 * eind[0] + 1], + seeds.vertProperties[3 * eind[0] + 2]); + vec3 ev2 = vec3(seeds.vertProperties[3 * eind[1] + 0], + seeds.vertProperties[3 * eind[1] + 1], + seeds.vertProperties[3 * eind[1] + 2]); + vec3 ev3 = vec3(seeds.vertProperties[3 * eind[2] + 0], + seeds.vertProperties[3 * eind[2] + 1], + seeds.vertProperties[3 * eind[2] + 2]); + vec3 a = ev1 - ev3; + vec3 b = ev2 - ev3; vec3 n = la::normalize(la::cross(a, b)); // Extrude the points above and below the plane of the triangle vec3 pnts[6]; - for (int j = 0; j < 3; j++) pnts[j] = ev[j] + n; - for (int j = 3; j < 6; j++) pnts[j] = ev[j] - n; + pnts[0] = ev1 + n; + pnts[1] = ev2 + n; + pnts[2] = ev3 + n; + pnts[3] = ev1 - n; + pnts[4] = ev2 - n; + pnts[5] = ev3 - n; // Construct the points and faces of the new manifold - double pts[3 * 6] = {pnts[4].x, pnts[4].y, pnts[4].z, pnts[3].x, pnts[3].y, - pnts[3].z, pnts[0].x, pnts[0].y, pnts[0].z, pnts[1].x, - pnts[1].y, pnts[1].z, pnts[5].x, pnts[5].y, pnts[5].z, - pnts[2].x, pnts[2].y, pnts[2].z}; - int faces[24] = { - faces[0] = 0, faces[1] = 1, faces[2] = 4, // 1 2 5 - faces[3] = 2, faces[4] = 3, faces[5] = 5, // 3 4 6 - faces[6] = 1, faces[7] = 0, faces[8] = 3, // 2 1 4 - faces[9] = 3, faces[10] = 2, faces[11] = 1, // 4 3 2 - faces[12] = 3, faces[13] = 0, faces[14] = 4, // 4 1 5 - faces[15] = 4, faces[16] = 5, faces[17] = 3, // 5 6 4 - faces[18] = 5, faces[19] = 4, faces[20] = 1, // 6 5 2 - faces[21] = 1, faces[22] = 2, faces[23] = 5 // 2 3 6 - }; - + double pts[3 * 6]; + /* 1 */ + pts[0] = pnts[4].x; + pts[1] = pnts[4].y; + pts[2] = pnts[4].z; + /* 2 */ + pts[3] = pnts[3].x; + pts[4] = pnts[3].y; + pts[5] = pnts[3].z; + /* 3 */ + pts[6] = pnts[0].x; + pts[7] = pnts[0].y; + pts[8] = pnts[0].z; + /* 4 */ + pts[9] = pnts[1].x; + pts[10] = pnts[1].y; + pts[11] = pnts[1].z; + /* 5 */ + pts[12] = pnts[5].x; + pts[13] = pnts[5].y; + pts[14] = pnts[5].z; + /* 6 */ + pts[15] = pnts[2].x; + pts[16] = pnts[2].y; + pts[17] = pnts[2].z; + int faces[24]; + // 1 2 5 + faces[0] = 0; + faces[1] = 1; + faces[2] = 4; + // 3 4 6 + faces[3] = 2; + faces[4] = 3; + faces[5] = 5; + // 2 1 4 + faces[6] = 1; + faces[7] = 0; + faces[8] = 3; + // 4 3 2 + faces[9] = 3; + faces[10] = 2; + faces[11] = 1; + // 4 1 5 + faces[12] = 3; + faces[13] = 0; + faces[14] = 4; + // 5 6 4 + faces[15] = 4; + faces[16] = 5; + faces[17] = 3; + // 6 5 2 + faces[18] = 5; + faces[19] = 4; + faces[20] = 1; + // 2 3 6 + faces[21] = 1; + faces[22] = 2; + faces[23] = 5; manifold::MeshGL64 tri_m; for (int j = 0; j < 18; j++) tri_m.vertProperties.insert(tri_m.vertProperties.end(), pts[j]); From 9a3dba3a25032463263f4f9e6f4404333b5e5312 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 19:54:45 -0400 Subject: [PATCH 12/20] Reapply "Simplify with += syntax." OK, starting from a passing state, see if this works. This reverts commit ba6027e003e4d6d64deda35eed8c540bff4a0f80. --- test/boolean_complex_test.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index 6ed0cd8e4..dfc8aa5e9 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1062,10 +1062,8 @@ TEST(BooleanComplex, SimpleOffset) { vec3 vpos(seeds.vertProperties[3 * i + 0], seeds.vertProperties[3 * i + 1], seeds.vertProperties[3 * i + 2]); Manifold vsph = sph.Translate(vpos); - manifold::Manifold left = c; - manifold::Manifold right(vsph); - if (!right.NumTri()) continue; - c = left.Boolean(right, manifold::OpType::Add); + if (!vsph.NumTri()) continue; + c += vsph; // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); } @@ -1090,8 +1088,7 @@ TEST(BooleanComplex, SimpleOffset) { origin_cyl.Transform(manifold::RotateUp(evec)); manifold::Manifold right = rotated_cyl.Translate(ev1); if (!right.NumTri()) continue; - manifold::Manifold left = c; - c = left.Boolean(right, manifold::OpType::Add); + c += right; // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); } @@ -1185,10 +1182,9 @@ TEST(BooleanComplex, SimpleOffset) { tri_m.vertProperties.insert(tri_m.vertProperties.end(), pts[j]); for (int j = 0; j < 24; j++) tri_m.triVerts.insert(tri_m.triVerts.end(), faces[j]); - manifold::Manifold left = c; manifold::Manifold right(tri_m); if (!right.NumTri()) continue; - c = left.Boolean(right, manifold::OpType::Add); + c += right; // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); } From f928ef830096474ee1dd658c13a90d5958ba4590 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 19:59:16 -0400 Subject: [PATCH 13/20] Break the initialization changes down - start with faces array. --- test/boolean_complex_test.cpp | 43 ++++++++--------------------------- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index dfc8aa5e9..12020ff30 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1144,39 +1144,16 @@ TEST(BooleanComplex, SimpleOffset) { pts[15] = pnts[2].x; pts[16] = pnts[2].y; pts[17] = pnts[2].z; - int faces[24]; - // 1 2 5 - faces[0] = 0; - faces[1] = 1; - faces[2] = 4; - // 3 4 6 - faces[3] = 2; - faces[4] = 3; - faces[5] = 5; - // 2 1 4 - faces[6] = 1; - faces[7] = 0; - faces[8] = 3; - // 4 3 2 - faces[9] = 3; - faces[10] = 2; - faces[11] = 1; - // 4 1 5 - faces[12] = 3; - faces[13] = 0; - faces[14] = 4; - // 5 6 4 - faces[15] = 4; - faces[16] = 5; - faces[17] = 3; - // 6 5 2 - faces[18] = 5; - faces[19] = 4; - faces[20] = 1; - // 2 3 6 - faces[21] = 1; - faces[22] = 2; - faces[23] = 5; + int faces[24] = { + faces[0] = 0, faces[1] = 1, faces[2] = 4, // 1 2 5 + faces[3] = 2, faces[4] = 3, faces[5] = 5, // 3 4 6 + faces[6] = 1, faces[7] = 0, faces[8] = 3, // 2 1 4 + faces[9] = 3, faces[10] = 2, faces[11] = 1, // 4 3 2 + faces[12] = 3, faces[13] = 0, faces[14] = 4, // 4 1 5 + faces[15] = 4, faces[16] = 5, faces[17] = 3, // 5 6 4 + faces[18] = 5, faces[19] = 4, faces[20] = 1, // 6 5 2 + faces[21] = 1, faces[22] = 2, faces[23] = 5 // 2 3 6 + }; manifold::MeshGL64 tri_m; for (int j = 0; j < 18; j++) tri_m.vertProperties.insert(tri_m.vertProperties.end(), pts[j]); From 3feecbba6d87f5a3f5d67587860434b14bc74628 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 20:02:04 -0400 Subject: [PATCH 14/20] Initialize pts array --- test/boolean_complex_test.cpp | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index 12020ff30..546c13fb1 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1119,31 +1119,10 @@ TEST(BooleanComplex, SimpleOffset) { pnts[4] = ev2 - n; pnts[5] = ev3 - n; // Construct the points and faces of the new manifold - double pts[3 * 6]; - /* 1 */ - pts[0] = pnts[4].x; - pts[1] = pnts[4].y; - pts[2] = pnts[4].z; - /* 2 */ - pts[3] = pnts[3].x; - pts[4] = pnts[3].y; - pts[5] = pnts[3].z; - /* 3 */ - pts[6] = pnts[0].x; - pts[7] = pnts[0].y; - pts[8] = pnts[0].z; - /* 4 */ - pts[9] = pnts[1].x; - pts[10] = pnts[1].y; - pts[11] = pnts[1].z; - /* 5 */ - pts[12] = pnts[5].x; - pts[13] = pnts[5].y; - pts[14] = pnts[5].z; - /* 6 */ - pts[15] = pnts[2].x; - pts[16] = pnts[2].y; - pts[17] = pnts[2].z; + double pts[3 * 6] = {pnts[4].x, pnts[4].y, pnts[4].z, pnts[3].x, pnts[3].y, + pnts[3].z, pnts[0].x, pnts[0].y, pnts[0].z, pnts[1].x, + pnts[1].y, pnts[1].z, pnts[5].x, pnts[5].y, pnts[5].z, + pnts[2].x, pnts[2].y, pnts[2].z}; int faces[24] = { faces[0] = 0, faces[1] = 1, faces[2] = 4, // 1 2 5 faces[3] = 2, faces[4] = 3, faces[5] = 5, // 3 4 6 From 7ffb94078304ba0d0fc0587840463e3bd827268a Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 20:05:39 -0400 Subject: [PATCH 15/20] Ah ha. There it is. Indexing problem with second half of pnts setup. --- test/boolean_complex_test.cpp | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index 546c13fb1..2df5d74a7 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1098,26 +1098,19 @@ TEST(BooleanComplex, SimpleOffset) { for (size_t i = 0; i < seeds.NumTri(); i++) { int eind[3]; for (int j = 0; j < 3; j++) eind[j] = seeds.triVerts[i * 3 + j]; - vec3 ev1 = vec3(seeds.vertProperties[3 * eind[0] + 0], - seeds.vertProperties[3 * eind[0] + 1], - seeds.vertProperties[3 * eind[0] + 2]); - vec3 ev2 = vec3(seeds.vertProperties[3 * eind[1] + 0], - seeds.vertProperties[3 * eind[1] + 1], - seeds.vertProperties[3 * eind[1] + 2]); - vec3 ev3 = vec3(seeds.vertProperties[3 * eind[2] + 0], - seeds.vertProperties[3 * eind[2] + 1], - seeds.vertProperties[3 * eind[2] + 2]); - vec3 a = ev1 - ev3; - vec3 b = ev2 - ev3; + std::vector ev; + for (int j = 0; j < 3; j++) { + ev.push_back(vec3(seeds.vertProperties[3 * eind[j] + 0], + seeds.vertProperties[3 * eind[j] + 1], + seeds.vertProperties[3 * eind[j] + 2])); + } + vec3 a = ev[0] - ev[2]; + vec3 b = ev[1] - ev[2]; vec3 n = la::normalize(la::cross(a, b)); // Extrude the points above and below the plane of the triangle vec3 pnts[6]; - pnts[0] = ev1 + n; - pnts[1] = ev2 + n; - pnts[2] = ev3 + n; - pnts[3] = ev1 - n; - pnts[4] = ev2 - n; - pnts[5] = ev3 - n; + for (int j = 0; j < 3; j++) pnts[j] = ev[j] + n; + for (int j = 3; j < 6; j++) pnts[j] = ev[j-3] - n; // Construct the points and faces of the new manifold double pts[3 * 6] = {pnts[4].x, pnts[4].y, pnts[4].z, pnts[3].x, pnts[3].y, pnts[3].z, pnts[0].x, pnts[0].y, pnts[0].z, pnts[1].x, From c44e4564c42ce6a27212b7879a25020bbfd77019 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 20:22:34 -0400 Subject: [PATCH 16/20] formatting --- test/boolean_complex_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index 2df5d74a7..ca5b1517f 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1110,7 +1110,7 @@ TEST(BooleanComplex, SimpleOffset) { // Extrude the points above and below the plane of the triangle vec3 pnts[6]; for (int j = 0; j < 3; j++) pnts[j] = ev[j] + n; - for (int j = 3; j < 6; j++) pnts[j] = ev[j-3] - n; + for (int j = 3; j < 6; j++) pnts[j] = ev[j - 3] - n; // Construct the points and faces of the new manifold double pts[3 * 6] = {pnts[4].x, pnts[4].y, pnts[4].z, pnts[3].x, pnts[3].y, pnts[3].z, pnts[0].x, pnts[0].y, pnts[0].z, pnts[1].x, From c137a4825824c43a56ba51ea32b073072c9af20e Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 20:37:20 -0400 Subject: [PATCH 17/20] Test --- test/boolean_complex_test.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index ca5b1517f..c5d6eac36 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1056,6 +1056,7 @@ TEST(BooleanComplex, SimpleOffset) { } } manifold::Manifold c; + manifold::Manifold c_noeval; // Vertex Spheres Manifold sph = Manifold::Sphere(1, 8); for (size_t i = 0; i < seeds.NumVert(); i++) { @@ -1066,6 +1067,10 @@ TEST(BooleanComplex, SimpleOffset) { c += vsph; // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); + // Check behavior of reordered CSG tree + c_noeval += vsph; + Manifold c_noeval_check = c_noeval; + EXPECT_EQ(c_noeval_check.Status(), Manifold::Error::NoError); } // See above discussion // EXPECT_EQ(c.Status(), Manifold::Error::NoError); @@ -1091,6 +1096,10 @@ TEST(BooleanComplex, SimpleOffset) { c += right; // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); + // Check behavior of reordered CSG tree + c_noeval += right; + Manifold c_noeval_check = c_noeval; + EXPECT_EQ(c_noeval_check.Status(), Manifold::Error::NoError); } // See above discussion // EXPECT_EQ(c.Status(), Manifold::Error::NoError); @@ -1136,6 +1145,10 @@ TEST(BooleanComplex, SimpleOffset) { c += right; // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); + // Check behavior of reordered CSG tree + c_noeval += right; + Manifold c_noeval_check = c_noeval; + EXPECT_EQ(c_noeval_check.Status(), Manifold::Error::NoError); } // See above discussion // EXPECT_EQ(c.Status(), Manifold::Error::NoError); From 2d9fff35b48d1ddce0dc7f7feb351d7d797f6e5c Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 20:38:21 -0400 Subject: [PATCH 18/20] Revert "Test" This reverts commit c137a4825824c43a56ba51ea32b073072c9af20e. --- test/boolean_complex_test.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index c5d6eac36..ca5b1517f 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1056,7 +1056,6 @@ TEST(BooleanComplex, SimpleOffset) { } } manifold::Manifold c; - manifold::Manifold c_noeval; // Vertex Spheres Manifold sph = Manifold::Sphere(1, 8); for (size_t i = 0; i < seeds.NumVert(); i++) { @@ -1067,10 +1066,6 @@ TEST(BooleanComplex, SimpleOffset) { c += vsph; // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); - // Check behavior of reordered CSG tree - c_noeval += vsph; - Manifold c_noeval_check = c_noeval; - EXPECT_EQ(c_noeval_check.Status(), Manifold::Error::NoError); } // See above discussion // EXPECT_EQ(c.Status(), Manifold::Error::NoError); @@ -1096,10 +1091,6 @@ TEST(BooleanComplex, SimpleOffset) { c += right; // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); - // Check behavior of reordered CSG tree - c_noeval += right; - Manifold c_noeval_check = c_noeval; - EXPECT_EQ(c_noeval_check.Status(), Manifold::Error::NoError); } // See above discussion // EXPECT_EQ(c.Status(), Manifold::Error::NoError); @@ -1145,10 +1136,6 @@ TEST(BooleanComplex, SimpleOffset) { c += right; // See above discussion EXPECT_EQ(c.Status(), Manifold::Error::NoError); - // Check behavior of reordered CSG tree - c_noeval += right; - Manifold c_noeval_check = c_noeval; - EXPECT_EQ(c_noeval_check.Status(), Manifold::Error::NoError); } // See above discussion // EXPECT_EQ(c.Status(), Manifold::Error::NoError); From 35f0eb0c96685defbfb44910f75bf5974b5c754e Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 22:41:12 -0400 Subject: [PATCH 19/20] See if the failure triggers if we only check once at the end. --- test/boolean_complex_test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index ca5b1517f..b2bc8a63e 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1065,7 +1065,7 @@ TEST(BooleanComplex, SimpleOffset) { if (!vsph.NumTri()) continue; c += vsph; // See above discussion - EXPECT_EQ(c.Status(), Manifold::Error::NoError); + //EXPECT_EQ(c.Status(), Manifold::Error::NoError); } // See above discussion // EXPECT_EQ(c.Status(), Manifold::Error::NoError); @@ -1090,7 +1090,7 @@ TEST(BooleanComplex, SimpleOffset) { if (!right.NumTri()) continue; c += right; // See above discussion - EXPECT_EQ(c.Status(), Manifold::Error::NoError); + //EXPECT_EQ(c.Status(), Manifold::Error::NoError); } // See above discussion // EXPECT_EQ(c.Status(), Manifold::Error::NoError); @@ -1135,10 +1135,10 @@ TEST(BooleanComplex, SimpleOffset) { if (!right.NumTri()) continue; c += right; // See above discussion - EXPECT_EQ(c.Status(), Manifold::Error::NoError); + //EXPECT_EQ(c.Status(), Manifold::Error::NoError); } // See above discussion - // EXPECT_EQ(c.Status(), Manifold::Error::NoError); + EXPECT_EQ(c.Status(), Manifold::Error::NoError); } #endif From e08cb1c24652639310e2dfff659934b4649af39c Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 22:41:47 -0400 Subject: [PATCH 20/20] Revert "See if the failure triggers if we only check once at the end." This reverts commit 35f0eb0c96685defbfb44910f75bf5974b5c754e. --- test/boolean_complex_test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index b2bc8a63e..ca5b1517f 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -1065,7 +1065,7 @@ TEST(BooleanComplex, SimpleOffset) { if (!vsph.NumTri()) continue; c += vsph; // See above discussion - //EXPECT_EQ(c.Status(), Manifold::Error::NoError); + EXPECT_EQ(c.Status(), Manifold::Error::NoError); } // See above discussion // EXPECT_EQ(c.Status(), Manifold::Error::NoError); @@ -1090,7 +1090,7 @@ TEST(BooleanComplex, SimpleOffset) { if (!right.NumTri()) continue; c += right; // See above discussion - //EXPECT_EQ(c.Status(), Manifold::Error::NoError); + EXPECT_EQ(c.Status(), Manifold::Error::NoError); } // See above discussion // EXPECT_EQ(c.Status(), Manifold::Error::NoError); @@ -1135,10 +1135,10 @@ TEST(BooleanComplex, SimpleOffset) { if (!right.NumTri()) continue; c += right; // See above discussion - //EXPECT_EQ(c.Status(), Manifold::Error::NoError); + EXPECT_EQ(c.Status(), Manifold::Error::NoError); } // See above discussion - EXPECT_EQ(c.Status(), Manifold::Error::NoError); + // EXPECT_EQ(c.Status(), Manifold::Error::NoError); } #endif