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

Function TEST

source/MRTest/MRReducePathTests.cpp:8–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6{
7
8TEST( MRMesh, ShortestPathInQuadrangleTest )
9{
10 Vector3d a;
11 Vector3d b = Vector3d( 0, 1, 0 );
12 Vector3d c = Vector3d( 1, 1, 0 );
13 Vector3d d = Vector3d( 1, 0, 0 );
14 // common case
15 auto x = shortestPathInQuadrangle( a, b, c, d );
16 EXPECT_NEAR( x, 0.5, 1e-15 );
17
18 c.x = c.y = 0.1;
19 // concave case
20 x = shortestPathInQuadrangle( a, b, c, d );
21 EXPECT_TRUE( x == 1 );
22
23 b = Vector3d( 0, 1, 0 );
24 a = c = Vector3d( 0.5, 0.5, 0 );
25 // degenerate needles case
26 x = shortestPathInQuadrangle( a, b, c, d );
27 EXPECT_TRUE( x == 0 );
28
29 a = Vector3d();
30 c = Vector3d( 1, 1, 0 );
31 b = d = Vector3d( 0.5, 0.5, 0 );
32 // degenerate caps case
33 x = shortestPathInQuadrangle( a, b, c, d );
34 EXPECT_NEAR( x, 0.5, 1e-15 );
35}
36
37}

Callers

nothing calls this directly

Calls 1

shortestPathInQuadrangleFunction · 0.85

Tested by

no test coverage detected