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

Function TEST

source/MRTest/MRMeshDecimateTests.cpp:14–38  ·  view source on GitHub ↗

check if Decimator updates region

Source from the content-addressed store, hash-verified

12
13// check if Decimator updates region
14TEST( 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 = &regionForDecimation;
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
40TEST( MRMesh, MeshDecimateParallel )
41{

Callers

nothing calls this directly

Calls 12

makeCylinderAdvancedFunction · 0.85
decimateMeshFunction · 0.85
makeSphereFunction · 0.85
fromTrianglesFunction · 0.85
testResolveDegenFunction · 0.85
packOptimallyMethod · 0.80
numValidFacesMethod · 0.80
leftMethod · 0.80
rightMethod · 0.80
swapFunction · 0.50
checkValidityMethod · 0.45
numValidVertsMethod · 0.45

Tested by

no test coverage detected