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

Function decimate_2

test_python/test_decimate.py:28–55  ·  view source on GitHub ↗
(size, pos1, pos2, pos3)

Source from the content-addressed store, hash-verified

26
27# TEST 2
28def 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
58def test_decimate():

Callers 1

test_decimateFunction · 0.85

Calls 8

is_equal_vector_3Function · 0.85
BooleanResultMapperMethod · 0.80
countMethod · 0.80
validMethod · 0.45
computeBoundingBoxMethod · 0.45
sizeMethod · 0.45
packMethod · 0.45

Tested by

no test coverage detected