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

Function TEST

source/MRTest/MRDistanceMapTests.cpp:39–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 return c;
38}
39TEST( MRMesh, DistanceMapBoolean2D )
40{
41 auto c1 = getTestCont1();
42 auto c2 = getTestCont2();
43 Vector2f middlePoint{ 2.5f,2.5f };
44 const ContourToDistanceMapParams params( { 16,16 }, Vector2f( 0.5f, 0.5f ), Vector2f( 4.f, 4.f ), true );
45
46 auto unionContours = contourUnion( Polyline2( c1 ), Polyline2( c2 ), params ).contours();
47 for ( const auto& cont : unionContours )
48 {
49 for ( const auto& p : cont )
50 {
51 EXPECT_GE( ( middlePoint - p ).lengthSq(), 0.5f );
52 }
53 }
54
55 auto intersectContours = contourIntersection( Polyline2( c1 ), Polyline2( c2 ), params ).contours();
56 for ( const auto& cont : intersectContours )
57 {
58 for ( const auto& p : cont )
59 {
60 EXPECT_LE( ( middlePoint - p ).lengthSq(), 0.5f );
61 }
62 }
63
64 auto subContours = contourSubtract( Polyline2( c1 ), Polyline2( c2 ), params ).contours();
65 EXPECT_EQ( subContours.size(), 2 );
66}
67
68TEST( MRMesh, DistanceMapContours )
69{

Callers

nothing calls this directly

Calls 15

getTestCont1Function · 0.85
getTestCont2Function · 0.85
contourUnionFunction · 0.85
contourIntersectionFunction · 0.85
contourSubtractFunction · 0.85
diagonalFunction · 0.85
minFunction · 0.85
makeUVSphereFunction · 0.85
computeDistanceMapDFunction · 0.85
distanceMapToMeshFunction · 0.85

Tested by

no test coverage detected