MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / test_tet_connectivity

Method test_tet_connectivity

python/pymesh/tests/test_mesh.py:6–25  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4
5class MeshTest(TestCase):
6 def test_tet_connectivity(self):
7 vertices = np.array([
8 [0, 0, 0],
9 [1, 0, 0],
10 [0, 1, 0],
11 [1, 1, 0],
12 [0, 0, 1] ])
13 voxels = np.array([
14 [0, 2, 1, 4],
15 [1, 2, 3, 4]
16 ])
17 mesh = pymesh.form_mesh(vertices, np.array([]), voxels)
18 mesh.enable_connectivity()
19
20 self.assertEqual(5, mesh.num_vertices)
21 self.assertEqual(6, mesh.num_faces)
22 self.assertEqual(2, mesh.num_voxels)
23
24 self.assert_array_equal([1], mesh.get_voxel_adjacent_voxels(0))
25 self.assert_array_equal([0], mesh.get_voxel_adjacent_voxels(1))
26
27 def test_hex_connectivity(self):
28 mesh = pymesh.generate_box_mesh([0.0, 0.0, 0.0], [1.0, 1.0, 1.0],

Callers

nothing calls this directly

Calls 4

assert_array_equalMethod · 0.80
form_meshMethod · 0.45
enable_connectivityMethod · 0.45

Tested by

no test coverage detected