Beispiel #1
0
 def test_equally_split_points(self):
     a = Point(0, 0)
     b = Point(3, 4)
     c = Point(6, 0)
     vector1 = Vector(a, b)
     vector2 = Vector(b, c)
     pc = PolygonalChain([vector1, vector2])
     self.assertEqual(pc.get_split_points(3), [a, b, c])
Beispiel #2
0
 def test_waged_split_points(self):
     a = Point(0, 0)
     b = Point(0, 10)
     c = Point(10, 10)
     vector1 = Vector(a, b)
     vector2 = Vector(b, c)
     pc = PolygonalChain([vector1, vector2])
     self.assertEqual(
         pc.get_split_points(5, [0, 0.4, 0.5, 0.6, 1]),
         [a, Point(0, 8), b, Point(2, 10), c])
Beispiel #3
0
 def test_equally_split_points2(self):
     a = Point(0, 0)
     b = Point(0, 10)
     c = Point(10, 10)
     vector1 = Vector(a, b)
     vector2 = Vector(b, c)
     pc = PolygonalChain([vector1, vector2])
     self.assertEqual(
         pc.get_split_points(5),
         [a, Point(0, 5), b, Point(5, 10), c])