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

Function TEST

source/MRTest/MRPolylineTests.cpp:8–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6{
7
8TEST( MRMesh, Polyline2 )
9{
10 Contour2f cont;
11 cont.push_back( Vector2f( 0.f, 0.f ) );
12 cont.push_back( Vector2f( 1.f, 0.f ) );
13 cont.push_back( Vector2f( 0.f, 1.f ) );
14 cont.push_back( Vector2f( 1.f, 1.f ) );
15
16 Contour2f cont2;
17 cont2.push_back( Vector2f( 2.f, 0.f ) );
18 cont2.push_back( Vector2f( 3.f, 0.f ) );
19 cont2.push_back( Vector2f( 2.f, 1.f ) );
20 cont2.push_back( Vector2f( 3.f, 1.f ) );
21
22 Contours2f conts{ cont,cont2 };
23
24 Polyline2 pl( conts );
25 auto conts2 = pl.contours();
26
27 for ( auto i = 0; i < conts.size(); i++ )
28{
29 auto& c1 = conts[i];
30 auto& c2 = conts2[i];
31 for ( auto j = 0; j < c1.size(); j++ )
32{
33 auto v1 = c1[j];
34 auto v2 = c2[j];
35 EXPECT_NEAR( v1[0], v2[0], 1e-8 );
36 EXPECT_NEAR( v1[1], v2[1], 1e-8 );
37 }
38 }
39}
40
41TEST( MRMesh, Polyline2LoopDir )
42{

Callers

nothing calls this directly

Calls 11

push_backMethod · 0.80
contoursMethod · 0.80
loopDirAreaMethod · 0.80
sizeMethod · 0.45
numValidVertsMethod · 0.45
lastNotLoneEdgeMethod · 0.45
findEdgeMethod · 0.45
validMethod · 0.45
splitEdgeMethod · 0.45
orgMethod · 0.45
destMethod · 0.45

Tested by

no test coverage detected