check if Decimator updates region
| 12 | |
| 13 | // check if Decimator updates region |
| 14 | TEST( MRMesh, MeshDecimate ) |
| 15 | { |
| 16 | Mesh meshCylinder = makeCylinderAdvanced(0.5f, 0.5f, 0.0f, 20.0f / 180.0f * PI_F, 1.0f, 16); |
| 17 | |
| 18 | // select all faces |
| 19 | MR::FaceBitSet regionForDecimation = meshCylinder.topology.getValidFaces(); |
| 20 | MR::FaceBitSet regionSaved(regionForDecimation); |
| 21 | |
| 22 | // setup and run decimator |
| 23 | DecimateSettings decimateSettings; |
| 24 | decimateSettings.maxError = 0.001f; |
| 25 | decimateSettings.region = ®ionForDecimation; |
| 26 | decimateSettings.maxTriangleAspectRatio = 80.0f; |
| 27 | |
| 28 | auto decimateResults = decimateMesh(meshCylinder, decimateSettings); |
| 29 | |
| 30 | // compare regions and deleted vertices and faces |
| 31 | ASSERT_NE(regionSaved, regionForDecimation); |
| 32 | ASSERT_GT(decimateResults.vertsDeleted, 0); |
| 33 | ASSERT_GT(decimateResults.facesDeleted, 0); |
| 34 | |
| 35 | ASSERT_TRUE(meshCylinder.topology.checkValidity()); |
| 36 | meshCylinder.packOptimally(); |
| 37 | ASSERT_TRUE(meshCylinder.topology.checkValidity()); |
| 38 | } |
| 39 | |
| 40 | TEST( MRMesh, MeshDecimateParallel ) |
| 41 | { |
nothing calls this directly
no test coverage detected