Exemplo n.º 1
0
 def test_check_values(self):
     test_points = [(0.0, 0.0), (1., 2.), (3., 1.), (5., 3.)]
     spline = CubicSpline(test_points)
     result = spline.approximate(50)
     for p1, p2 in zip(result, expected):
         self.assertAlmostEqual(p1[0], p2[0], places=6)
         self.assertAlmostEqual(p1[1], p2[1], places=6)
Exemplo n.º 2
0
Arquivo: curves.py Projeto: msarch/py
 def __dxftags__(self):
     spline = CubicSpline(self.points)
     polyline = Polyline(spline.approximate(self.segments),
                         layer=self.layer,
                         color=self.color,
                         linetype=self.linetype)
     return polyline.__dxftags__()
Exemplo n.º 3
0
 def __dxftags__(self):
     spline = CubicSpline(self.points)
     polyline = Polyline(spline.approximate(self.segments),
                         layer = self.layer,
                         color=self.color,
                         linetype = self.linetype)
     return polyline.__dxftags__()
Exemplo n.º 4
0
 def test_check_values(self):
     test_points = [(0.0, 0.0), (1., 2.), (3., 1.), (5., 3.)]
     spline = CubicSpline(test_points)
     result = spline.approximate(50)
     for p1, p2 in zip(result, expected):
         self.assertAlmostEqual(p1[0], p2[0], places=6)
         self.assertAlmostEqual(p1[1], p2[1], places=6)
Exemplo n.º 5
0
 def _build_curve(self):
     spline = CubicSpline(self.points)
     polyline = Polyline(
         spline.approximate(self.segments), layer=self.layer, color=self.color, linetype=self.linetype
     )
     return polyline