Skip to content

Commit bfc0858

Browse files
committed
Add test for self intersection
1 parent a0baf4e commit bfc0858

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

samples/models/self_intersectA.glb

317 KB
Binary file not shown.

samples/models/self_intersectB.glb

317 KB
Binary file not shown.

test/samples_test.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,16 @@ TEST(Samples, Sponge4) {
255255
#endif
256256
}
257257
#endif
258+
259+
#ifdef MANIFOLD_EXPORT
260+
TEST(Samples, SelfIntersect) {
261+
manifold::PolygonParams().processOverlaps = true;
262+
std::string file = __FILE__;
263+
std::string dir = file.substr(0, file.rfind('/'));
264+
Manifold m1 = ImportMesh(dir + "/../samples/models/self_intersectA.glb");
265+
Manifold m2 = ImportMesh(dir + "/../samples/models/self_intersectB.glb");
266+
Manifold res = m1 + m2;
267+
res.GetMeshGL(); // test crash
268+
manifold::PolygonParams().processOverlaps = false;
269+
}
270+
#endif

0 commit comments

Comments
 (0)