| 8 | { |
| 9 | |
| 10 | TEST( MRMesh, FixSelfIntersections ) |
| 11 | { |
| 12 | Mesh mesh = makeTorusWithSelfIntersections( 1.0f, 0.2f, 32, 16 ); |
| 13 | EXPECT_EQ( mesh.topology.getValidFaces().count(), 1024 ); |
| 14 | |
| 15 | auto intersections = SelfIntersections::getFaces( mesh, false ); |
| 16 | EXPECT_TRUE( intersections.has_value() ); |
| 17 | EXPECT_EQ( intersections->count(), 128 ); |
| 18 | |
| 19 | SelfIntersections::Settings settings; |
| 20 | settings.method = SelfIntersections::Settings::Method::CutAndFill; |
| 21 | settings.touchIsIntersection = false; |
| 22 | EXPECT_TRUE( SelfIntersections::fix( mesh, settings ).has_value() ); |
| 23 | |
| 24 | EXPECT_TRUE( mesh.topology.getValidFaces().count() == 1194 |
| 25 | || mesh.topology.getValidFaces().count() == 1196 ); //on some macOS Arm runners in Debug mode |
| 26 | |
| 27 | intersections = SelfIntersections::getFaces( mesh, false ); |
| 28 | EXPECT_TRUE( intersections.has_value() ); |
| 29 | EXPECT_EQ( intersections->count(), 0 ); |
| 30 | } |
| 31 | |
| 32 | } //namespace MR |
nothing calls this directly
no test coverage detected