コード例 #1
0
    def test_arc(self):
        """
        Arcs are output correctly.
        """

        writer = KiCAD()
        arc = Arc(0, 0, -0.5, 0.5, 1)
        line = writer.get_shape_line(arc)
        self.assertEqual(line, 'A 0 0 11 900 -900 %(unit)d %(convert)d 0 N\n')
コード例 #2
0
    def test_rectangle(self):
        """
        Rectangles are output correctly.
        """

        writer = KiCAD()
        rect = Rectangle(10, 20, 5, 10)
        line = writer.get_shape_line(rect)
        self.assertEqual(line, 'S 111 222 167 111 %(unit)d %(convert)d 0 N\n')
コード例 #3
0
    def test_polygon(self):
        """
        Polygons are output correctly.
        """

        writer = KiCAD()
        poly = Polygon()
        poly.add_point(0, 0)
        poly.add_point(0, 10)
        poly.add_point(10, 10)
        poly.add_point(10, 0)
        line = writer.get_shape_line(poly)
        self.assertEqual(line, 'P 5 %(unit)d %(convert)d 0 0 0 0 111 111 111 111 0 0 0 N\n')