Skip to content

Commit

Permalink
revert removal
Browse files Browse the repository at this point in the history
  • Loading branch information
elalish committed Oct 8, 2024
1 parent 34fd08d commit aabec2b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
"args": [
"--gtest_break_on_failure",
"--gtest_catch_exceptions=0",
<<<<<<< HEAD
"--gtest_filter=Boolean.Cubes"
=======
>>>>>>> 658d3e037a0a198b605fd99e496e84b1dd674a32
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build/test",
Expand All @@ -29,4 +26,4 @@
"externalConsole": false
}
]
}
}
5 changes: 5 additions & 0 deletions src/edge_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,11 @@ void Manifold::Impl::CollapseEdge(const int edge, std::vector<int>& edges) {
const vec3 pNext = vertPos_[halfedge_[current].endVert];
const mat3x2 projection =
GetAxisAlignedProjection(faceNormal_[current / 3]);
// Don't collapse if the edges separating the faces are not colinear
// (can happen when the two faces are coplanar).
if (CCW(projection * pOld, projection * pLast, projection * pNew,
precision_) != 0)
return;
if (CCW(projection * pNext, projection * pLast, projection * pNew,
precision_) < 0)
return;
Expand Down
4 changes: 4 additions & 0 deletions test/boolean_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ TEST(Boolean, Split) {
EXPECT_FLOAT_EQ(splits.first.GetProperties().volume +
splits.second.GetProperties().volume,
cube.GetProperties().volume);
#ifdef MANIFOLD_EXPORT
if (options.exportModels)
ExportMesh("split.glb", splits.second.GetMeshGL(), {});
#endif
}

TEST(Boolean, SplitByPlane) {
Expand Down

0 comments on commit aabec2b

Please sign in to comment.