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

Function TEST

source/MRTest/MRMeshMeshDistanceTests.cpp:13–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11{
12
13TEST(MRMesh, MeshDistance)
14{
15 Mesh sphere1 = makeUVSphere( 1, 8, 8 );
16
17 auto d11 = findDistance( sphere1, sphere1, nullptr, FLT_MAX );
18 EXPECT_EQ( d11.distSq, 0 );
19
20 auto zShift = AffineXf3f::translation( Vector3f( 0, 0, 3 ) );
21 auto d1z = findDistance( sphere1, sphere1, &zShift, FLT_MAX );
22 EXPECT_EQ( d1z.distSq, 1 );
23
24 Mesh sphere2 = makeUVSphere( 2, 8, 8 );
25
26 auto d12 = findDistance( sphere1, sphere2, nullptr, FLT_MAX );
27 float dist12 = std::sqrt( d12.distSq );
28 EXPECT_TRUE( dist12 > 0.9f && dist12 < 1.0f );
29}
30
31TEST( MRMesh, MeshMeshClosestPoint )
32{

Callers

nothing calls this directly

Calls 5

makeUVSphereFunction · 0.85
findDistanceFunction · 0.85
makeCubeFunction · 0.85
findProjectionFunction · 0.85
findSignedDistanceFunction · 0.50

Tested by

no test coverage detected