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

Method test_point_cloud

python/pymesh/tests/test_tetgen.py:8–29  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6
7class TetgenTest(TestCase):
8 def test_point_cloud(self):
9 tetgen = pymesh.tetgen()
10 tetgen.points = np.array([
11 [0.0, 0.0, 0.0],
12 [1.0, 0.0, 0.0],
13 [1.0, 1.0, 0.0],
14 [0.0, 1.0, 0.0],
15 [0.0, 0.0, 1.0],
16 [1.0, 0.0, 1.0],
17 [1.0, 1.0, 1.0],
18 [0.0, 1.0, 1.0] ])
19 tetgen.verbosity = 0
20 tetgen.keep_convex_hull = True
21 tetgen.split_boundary = False
22 tetgen.run()
23
24 mesh = tetgen.mesh
25 mesh.add_attribute("voxel_volume")
26 volumes = mesh.get_attribute("voxel_volume")
27
28 self.assertEqual(8, len(tetgen.vertices))
29 self.assertAlmostEqual(1.0, np.sum(volumes))
30
31 def test_cube_refine(self):
32 vertices = np.array([

Callers

nothing calls this directly

Calls 3

runMethod · 0.45
add_attributeMethod · 0.45
get_attributeMethod · 0.45

Tested by

no test coverage detected