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

Function test_make_cube

test_python/test_makeCube.py:5–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4
5def test_make_cube():
6 size = mrmesh.Vector3f.diagonal(2)
7 pos1 = mrmesh.Vector3f.diagonal(1)
8 pos2 = mrmesh.Vector3f.diagonal(3)
9
10 cube = mrmesh.makeCube(size, pos1)
11 assert cube.topology.numValidVerts() == 8
12 assert cube.topology.numValidFaces() == 12
13
14 cube2 = mrmesh.makeCube(size, pos2)
15
16 transVector = mrmesh.Vector3f()
17 transVector.x = 0.5
18 transVector.y = 1
19 transVector.z = 1
20 diffXf = mrmesh.AffineXf3f.translation(transVector)
21 cube2.transform(diffXf)
22
23 xf = mrmesh.AffineXf3f()
24 cube1 = cube
25 pairs = mrmesh.findCollidingTriangles(cube1, cube2, None, False)
26 assert len(pairs) == 0
27
28 cube.topology.flipOrientation()

Callers

nothing calls this directly

Calls 6

numValidFacesMethod · 0.80
translationMethod · 0.80
diagonalMethod · 0.45
numValidVertsMethod · 0.45
transformMethod · 0.45
flipOrientationMethod · 0.45

Tested by

no test coverage detected