Skip to content

Commit 82e67e8

Browse files
committed
Issue #933
1 parent 096703c commit 82e67e8

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

src/cpp/geometry/operations/boolean-utils/clip-mesh.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ namespace fuzzybools
8282
{
8383
if (isInside2 == MeshLocation::INSIDE || isInside1 == MeshLocation::OUTSIDE)
8484
{
85-
if(isInside1 == MeshLocation::INSIDE)
86-
{
87-
doit = true;
88-
}
8985
// inside 2, with subtract, means don't include
9086
// outside 1, with subtract, means don't include
9187
}

src/cpp/geometry/operations/boolean-utils/shared-position.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,7 @@ namespace fuzzybools
366366

367367
bool IsEqualTo(const Vec3& n, double d)
368368
{
369-
return (equals(normal, n, toleranceVectorEquality) && equals(distance, d, toleranceScalarEquality)) ||
370-
(equals(normal, -n, toleranceVectorEquality) && equals(distance, -d, toleranceScalarEquality));
369+
return (equals(normal, n, toleranceVectorEquality) && equals(distance, d, toleranceScalarEquality));
371370
}
372371

373372
//============================================================================================
@@ -901,6 +900,19 @@ namespace fuzzybools
901900
continue;
902901
}
903902

903+
if (isA)
904+
{
905+
#ifdef CSG_DEBUG_OUTPUT
906+
DumpGeometry(geom, L"Initial_A.obj");
907+
#endif
908+
}
909+
else
910+
{
911+
#ifdef CSG_DEBUG_OUTPUT
912+
DumpGeometry(geom, L"Initial_B.obj");
913+
#endif
914+
}
915+
904916
auto a = geom.GetPoint(f.i0);
905917
auto b = geom.GetPoint(f.i1);
906918
auto c = geom.GetPoint(f.i2);
@@ -1196,6 +1208,7 @@ namespace fuzzybools
11961208
//auto contourLoop = FindLargestEdgeLoop(projectedPoints, edges);
11971209

11981210
#ifdef CSG_DEBUG_OUTPUT
1211+
std::vector<std::vector<glm::dvec2>> edges3DTriangles;
11991212
std::set<std::pair<size_t, size_t>> edgesTriangles;
12001213
std::set<std::pair<size_t, size_t>> finalEdgesTriangles;
12011214
#endif
@@ -1249,6 +1262,13 @@ namespace fuzzybools
12491262
// TODO: why is this swapped? winding doesnt matter much, but still
12501263
geom.AddFace(ptB, ptA, ptC);
12511264

1265+
#ifdef CSG_DEBUG_OUTPUT
1266+
edges3DTriangles.push_back({ glm::dvec2(ptA.z+ ptA.x/2, ptA.y+ ptA.x/2), glm::dvec2(ptB.z+ ptB.x/2, ptB.y+ ptB.x/2) });
1267+
edges3DTriangles.push_back({ glm::dvec2(ptA.z+ ptA.x/2, ptA.y+ ptA.x/2), glm::dvec2(ptC.z+ ptC.x/2, ptC.y+ ptC.x/2) });
1268+
edges3DTriangles.push_back({ glm::dvec2(ptB.z+ ptB.x/2, ptB.y+ ptB.x/2), glm::dvec2(ptC.z+ ptC.x/2, ptC.y+ ptC.x/2) });
1269+
DumpSVGLines(edges3DTriangles, L"edges_tri.html");
1270+
#endif
1271+
12521272
#ifdef CSG_DEBUG_OUTPUT
12531273
finalEdgesTriangles.insert(std::make_pair(tri.vertices[0], tri.vertices[1]));
12541274
finalEdgesTriangles.insert(std::make_pair(tri.vertices[1], tri.vertices[2]));

0 commit comments

Comments
 (0)