MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / TEST

Function TEST

source/MRTest/MRFixSelfIntersectionsTests.cpp:10–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8{
9
10TEST( 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

Callers

nothing calls this directly

Calls 4

getFacesFunction · 0.85
countMethod · 0.80
fixFunction · 0.50

Tested by

no test coverage detected