| 123 | } |
| 124 | |
| 125 | static void testResolveDegen( const char * offMesh, float maxError, int vertsDeleted, int facesDeleted ) |
| 126 | { |
| 127 | std::istringstream s( offMesh ); |
| 128 | auto maybeMesh = MeshLoad::fromOff( s ); |
| 129 | EXPECT_TRUE( maybeMesh ); |
| 130 | |
| 131 | DecimateSettings dsettings |
| 132 | { |
| 133 | .strategy = DecimateStrategy::ShortestEdgeFirst, |
| 134 | .maxError = maxError, |
| 135 | .criticalTriAspectRatio = 1000, |
| 136 | .tinyEdgeLength = 0.1f * maxError, |
| 137 | .stabilizer = 1e-6f, |
| 138 | .optimizeVertexPos = false, |
| 139 | .maxAngleChange = PI_F / 3 |
| 140 | }; |
| 141 | |
| 142 | auto res = decimateMesh( *maybeMesh, dsettings ); |
| 143 | EXPECT_EQ( res.vertsDeleted, vertsDeleted ); |
| 144 | EXPECT_EQ( res.facesDeleted, facesDeleted ); |
| 145 | } |
| 146 | |
| 147 | TEST( MRMesh, MeshDecimateResolveDegen ) |
| 148 | { |
no test coverage detected