surfaces/surf/test/polymesh.py

27 lines
706 B
Python
Raw Normal View History

2012-05-07 22:17:46 -07:00
import json
import os
import unittest
from surf.geometry import PolygonMesh
class TestPM(unittest.TestCase):
def setUp(self):
path, file_name = os.path.split(__file__)
self.samples_dir = os.path.join(path, os.pardir, os.pardir,
'blender', 'samples')
self.cube_file_name = os.path.join(self.samples_dir, 'cube.json')
self.cube = json.load(open(self.cube_file_name, 'r'))
def test_cube_load(self):
p = PolygonMesh(**self.cube)
v = p.vertices[0]
self.assertAlmostEqual(v.x, -1.0)
self.assertAlmostEqual(v.y, -1.0)
self.assertAlmostEqual(v.z, -1.0)
2012-05-07 22:17:46 -07:00
if __name__ == '__main__':
unittest.main(verbosity=3)