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

Function TEST

source/MRTest/MRPrecisePredicatesTests.cpp:11–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9{
10
11TEST( MRMesh, doSegmentSegmentIntersect )
12{
13 std::array<PreciseVertCoords2, 4> vs =
14 {
15 PreciseVertCoords2{ 0_v, Vector2i( -1, 0 ) }, //a
16 PreciseVertCoords2{ 1_v, Vector2i{ 1, 0 } }, //b
17
18 PreciseVertCoords2{ 2_v, Vector2i( 0, 1 ) }, //c
19 PreciseVertCoords2{ 3_v, Vector2i{ 0, -1 } } //d
20 };
21
22 auto res = doSegmentSegmentIntersect( vs );
23 EXPECT_TRUE( res.doIntersect );
24 EXPECT_TRUE( res.cIsLeftFromAB );
25
26 std::swap( vs[2], vs[3] );
27 res = doSegmentSegmentIntersect( vs );
28 EXPECT_TRUE( res.doIntersect );
29 EXPECT_TRUE( !res.cIsLeftFromAB );
30
31 vs[3].pt.y = -5;
32 res = doSegmentSegmentIntersect( vs );
33 EXPECT_FALSE( res.doIntersect );
34}
35
36TEST( MRMesh, sosCCW )
37{

Callers

nothing calls this directly

Calls 12

smaller2Function · 0.85
inCircleFunction · 0.85
getToIntConverterFunction · 0.85
swapFunction · 0.50
ccwFunction · 0.50
segmentIntersectionOrderFunction · 0.50
orientParaboloid3dFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected