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

Method test_2D

python/pymesh/tests/test_compression.py:27–44  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

25 self.assert_array_almost_equal(mesh.bbox, mesh2.bbox)
26
27 def test_2D(self):
28 vertices = numpy.array([
29 [0.0, 0.0],
30 [1.0, 0.0],
31 [1.0, 1.0],
32 [0.0, 1.0],
33 ])
34 faces = np.array([
35 [0, 1, 2],
36 [0, 2, 3]
37 ])
38 mesh = pymesh.form_mesh(vertices, faces)
39 data = pymesh.compress(mesh)
40 mesh2 = pymesh.decompress(data)
41
42 self.assertEqual(mesh.num_vertices, mesh2.num_vertices)
43 self.assertEqual(mesh.num_faces, mesh2.num_faces)
44 self.assert_array_almost_equal(mesh.bbox, mesh2.bbox)
45
46 def test_quad(self):
47 vertices = numpy.array([

Callers

nothing calls this directly

Calls 4

form_meshMethod · 0.45
compressMethod · 0.45
decompressMethod · 0.45

Tested by

no test coverage detected