Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Trickey <howard.trickey@gmail.com>2020-09-05 03:59:36 +0300
committerHoward Trickey <howard.trickey@gmail.com>2020-09-05 03:59:36 +0300
commitda6e6e04321da428a74e720fcd5c0f7e081b801c (patch)
tree01bb86ffd0a82d9cbad8a5573dfada69d6b4db54 /source/blender/blenlib/tests/BLI_mesh_intersect_test.cc
parentcf0ba59e311b7a5aa61aef2d13ed3c5205657d7a (diff)
New boolean: Fix second example in T79404.
The code to detect non-trivial coplanar intersection sometimes falsely said there wasn't one. This caused some coplanar intersections to be missed. Also added a test for this case.
Diffstat (limited to 'source/blender/blenlib/tests/BLI_mesh_intersect_test.cc')
-rw-r--r--source/blender/blenlib/tests/BLI_mesh_intersect_test.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/blenlib/tests/BLI_mesh_intersect_test.cc b/source/blender/blenlib/tests/BLI_mesh_intersect_test.cc
index a8f05eedaaa..7b0f05444e2 100644
--- a/source/blender/blenlib/tests/BLI_mesh_intersect_test.cc
+++ b/source/blender/blenlib/tests/BLI_mesh_intersect_test.cc
@@ -703,6 +703,33 @@ TEST(mesh_intersect, CubeCubeStep)
write_obj_mesh(out2, "test_cubecubestep_nary");
}
}
+
+TEST(mesh_intersect, RectCross)
+{
+ const char *spec = R"(8 4
+ 3/2 0 1
+ -3/2 0 1
+ -3/2 0 -1
+ 3/2 0 -1
+ 1 0 -5
+ -1 0 -5
+ 1 0 5
+ -1 0 5
+ 1 0 3
+ 1 3 2
+ 5 4 6
+ 5 6 7
+ )";
+
+ IMeshBuilder mb(spec);
+ IMesh out = trimesh_self_intersect(mb.imesh, &mb.arena);
+ out.populate_vert();
+ EXPECT_EQ(out.vert_size(), 17);
+ EXPECT_EQ(out.face_size(), 28);
+ if (DO_OBJ) {
+ write_obj_mesh(out, "test_rectcross");
+ }
+}
# endif
# if DO_PERF_TESTS