Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking on a potential bug #933

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
cmakeFlags = [
"-DMANIFOLD_PYBIND=ON"
"-DMANIFOLD_CBIND=ON"
"-DMANIFOLD_DEBUG=ON"
"-DMANIFOLD_EXPORT=ON"
"-DBUILD_SHARED_LIBS=ON"
"-DMANIFOLD_PAR=${pkgs.lib.strings.toUpper parallel-backend}"
Expand Down
86 changes: 86 additions & 0 deletions test/boolean_complex_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,92 @@ TEST(BooleanComplex, Spiral) {
EXPECT_EQ(result.Genus(), -120);
}

TEST(BooleanComplex, TriangulationFail) {
// clang-format off
MeshGL m;
m.vertProperties = {
0.75, -1, -1, //
0.75, -1, -0.25, //
0.75, -0.667, 0.083, //
0.75, -0.25, -1, //
0.75, 0.083, -0.667, //
0.833, 0.5, -0.167, //
0.75, 0.0417, 0.0417, //
0.75, 0.5, 0.25, //
0.75, 0.25, 0.5, //
1.25, -1, -1, //
1.25, -1, -0.75, //
1.25, -1, -0.75, //
1.25, -0.75, -1, //
1, -0.5, 0, //
1, -0.25, -0.25, //
1, 0, -0.5, //
1.25, 0.5, 0.25, //
1.25, 0.5, 0.75};
m.triVerts = {
1, 6, 0, //
3, 0, 6, //
0, 10, 1, //
0, 3, 12, //
1, 13, 2, //
6, 1, 2, //
13, 8, 2, //
15, 3, 4, //
4, 3, 6, //
15, 4, 7, //
5, 15, 7, //
6, 2, 8, //
6, 14, 7, //
8, 14, 6, //
7, 4, 6, //
13, 14, 8, //
5, 7, 16, //
0, 9, 10, //
9, 0, 12, //
1, 10, 13, //
12, 3, 15, //
13, 10, 14, //
11, 7, 12, //
12, 14, 10, //
10, 9, 12, //
17, 11, 12, //
14, 12, 7, //
15, 5, 16, //
16, 12, 15, //
7, 11, 17, //
7, 17, 16, //
12, 16, 17};
MeshGL m2;
m2.vertProperties = {
0.75, 0, 0.75, //
0.75, 0.25, 0.5, //
1.25, -1, -0.75, //
1.25, -0.75, -1, //
1, 0.5, 0.5, //
1.25, 0.5, 0.25, //
1.25, 0.5, 0.75};
m2.triVerts = {
4, 1, 0, //
3, 0, 1, //
0, 3, 2, //
3, 6, 2, //
0, 2, 6, //
3, 1, 5, //
1, 4, 5, //
4, 0, 6, //
3, 5, 6, //
4, 6, 5};
// clang-format on

#ifdef MANIFOLD_EXPORT
if (options.exportModels)
ExportMesh("trifail.glb",
Manifold::Compose({Manifold(m), Manifold(m2)}).GetMeshGL(), {});
#endif

auto gl = (Manifold(m) + Manifold(m2)).GetMeshGL();
}

#ifdef MANIFOLD_CROSS_SECTION
TEST(BooleanComplex, Sweep) {
PolygonParams().processOverlaps = true;
Expand Down
Loading