(size, pos1, pos2, pos3)
| 26 | |
| 27 | # TEST 2 |
| 28 | def decimate_2(size, pos1, pos2, pos3): |
| 29 | meshA = mrmesh.makeCube(size, pos1) |
| 30 | meshB = mrmesh.makeCube(size, pos2) |
| 31 | |
| 32 | bOperation = mrmesh.BooleanOperation.Intersection |
| 33 | bResMapper = mrmesh.BooleanResultMapper() |
| 34 | bResult = mrmesh.boolean(meshA, meshB, bOperation, None, bResMapper) |
| 35 | assert bResult.valid(), bResult.errorString |
| 36 | |
| 37 | mesh = bResult.mesh |
| 38 | settings = mrmesh.DecimateSettings() |
| 39 | settings.maxError = 0.001 |
| 40 | result = mrmesh.decimateMesh(mesh, settings) |
| 41 | |
| 42 | assert is_equal_vector_3( |
| 43 | mesh.computeBoundingBox(mesh.topology.getValidFaces(), mrmesh.AffineXf3f()).min, |
| 44 | pos1, |
| 45 | ) |
| 46 | assert is_equal_vector_3( |
| 47 | mesh.computeBoundingBox(mesh.topology.getValidFaces(), mrmesh.AffineXf3f()).max, |
| 48 | pos3, |
| 49 | ) |
| 50 | |
| 51 | assert result.vertsDeleted == 6 |
| 52 | assert result.facesDeleted == 12 |
| 53 | assert mesh.topology.getValidVerts().count() == 8 |
| 54 | assert mesh.topology.findHoleRepresentiveEdges().size() == 0 |
| 55 | mesh.pack() |
| 56 | |
| 57 | |
| 58 | def test_decimate(): |
no test coverage detected