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

Function test_segmentation

test_python/test_segmentation.py:7–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6
7def test_segmentation():
8 mesh = mrmesh.makeTorus()
9 metric = mrmesh.edgeLengthMetric(mesh)
10 source = mrmesh.FaceBitSet()
11 sink = mrmesh.FaceBitSet()
12 source.resize(mesh.topology.getValidFaces().size(), False)
13 sink.resize(mesh.topology.getValidFaces().size(), False)
14
15 source.set(mrmesh.FaceId(0), True)
16 sink.set(mrmesh.FaceId(5), True)
17
18 res = mrmesh.segmentByGraphCut(mesh.topology, source, sink, metric)
19
20 assert res.count() != 0
21 assert res.test(mrmesh.FaceId(0))
22 assert not res.test(mrmesh.FaceId(5))

Callers

nothing calls this directly

Calls 5

countMethod · 0.80
resizeMethod · 0.45
sizeMethod · 0.45
setMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected