| 11 | { |
| 12 | |
| 13 | TEST( 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 |
nothing calls this directly
no test coverage detected