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

Function test_mesh_projections

test_python/test_meshProjections.py:5–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4
5def test_mesh_projections():
6 torusRef = mrmesh.makeTorus(2, 1, 10, 10, None)
7 torus = mrmesh.makeTorus(2, 1, 10, 10, None)
8 torus.transform(mrmesh.AffineXf3f.translation(mrmesh.Vector3f(0.5, 1, 1)))
9
10 unsignedDist = mrmesh.findProjection(mrmesh.Vector3f(0, 0, 0), torusRef)
11 assert unsignedDist.distSq < 10.0
12 signedDist = mrmesh.findSignedDistance(mrmesh.Vector3f(1.5, 0, 0), torusRef)
13 assert signedDist.dist < 0.0
14
15 allProjRes = mrmesh.projectAllMeshVertices(torusRef, torus)
16 assert allProjRes.vec.size() == torus.points.vec.size()
17 for i in allProjRes.vec:
18 assert i < 10

Callers

nothing calls this directly

Calls 3

translationMethod · 0.80
transformMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected