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

Function TEST

source/MRTest/MRFillContours2DTests.cpp:13–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11{
12
13TEST( MRMesh, fillContours2D )
14{
15 Mesh sphereBig = makeUVSphere( 1.0f, 32, 32 );
16 Mesh sphereSmall = makeUVSphere( 0.7f, 16, 16 );
17
18 sphereSmall.topology.flipOrientation();
19 sphereBig.addMesh( sphereSmall );
20
21 trimWithPlane( sphereBig, TrimWithPlaneParams{ .plane = Plane3f::fromDirAndPt( Vector3f::plusZ(), Vector3f() ) } );
22 sphereBig.pack();
23
24 auto firstNewFace = sphereBig.topology.lastValidFace() + 1;
25 auto v = fillContours2D( sphereBig, sphereBig.topology.findHoleRepresentiveEdges() );
26 EXPECT_TRUE( v.has_value() );
27 for ( FaceId f = firstNewFace; f <= sphereBig.topology.lastValidFace(); ++f )
28 {
29 EXPECT_TRUE( std::abs( dot( sphereBig.dirDblArea( f ).normalized(), Vector3f::minusZ() ) - 1.0f ) < std::numeric_limits<float>::epsilon() );
30 }
31}
32
33// Characterizes fillContours2D on a hole lying in a plane tilted off all axes (so the projection /
34// dominant-axis path is exercised). Pins the observable result so the upcoming mesh-space rewrite

Callers

nothing calls this directly

Calls 15

makeUVSphereFunction · 0.85
fillContours2DFunction · 0.85
absFunction · 0.85
addMeshMethod · 0.80
lastValidFaceMethod · 0.80
dirDblAreaMethod · 0.80
normalMethod · 0.80
trimWithPlaneFunction · 0.50
dotFunction · 0.50
flipOrientationMethod · 0.45
packMethod · 0.45

Tested by

no test coverage detected