24 lines
517 B
Python
24 lines
517 B
Python
|
import unittest
|
||
|
|
||
|
from surf.geometry import Vertex, Edge
|
||
|
|
||
|
|
||
|
class TestEdge(unittest.TestCase):
|
||
|
|
||
|
def setUp(self):
|
||
|
self.origin = Vertex(0, 0, 0)
|
||
|
self.v1 = Vertex(-1, -1, -1)
|
||
|
self.v2 = Vertex(1, 1, 1)
|
||
|
|
||
|
self.v3 = Vertex(5, 4, 3)
|
||
|
self.v4 = Vertex(10, -2, 13)
|
||
|
self.v5 = Vertex(-4, 15.3, 100)
|
||
|
|
||
|
def test_centroid(self):
|
||
|
e = Edge(self.v1, self.v3)
|
||
|
self.assertEqual(e.centroid, Vertex(2, 1.5, 1))
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
unittest.main(verbosity=3)
|