本文整理匯總了Python中upconvert.writer.kicad.KiCAD.get_shape_line方法的典型用法代碼示例。如果您正苦於以下問題:Python KiCAD.get_shape_line方法的具體用法?Python KiCAD.get_shape_line怎麽用?Python KiCAD.get_shape_line使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類upconvert.writer.kicad.KiCAD
的用法示例。
在下文中一共展示了KiCAD.get_shape_line方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_arc
# 需要導入模塊: from upconvert.writer.kicad import KiCAD [as 別名]
# 或者: from upconvert.writer.kicad.KiCAD import get_shape_line [as 別名]
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: test_bezier_curve
# 需要導入模塊: from upconvert.writer.kicad import KiCAD [as 別名]
# 或者: from upconvert.writer.kicad.KiCAD import get_shape_line [as 別名]
def test_bezier_curve(self):
"""
BezierCurves are output correctly.
"""
writer = KiCAD()
bezier = BezierCurve((0, 0), (1, 1), (2, 2), (3, 3))
line = writer.get_shape_line(bezier)
self.assertEqual(line, 'P 2 %(unit)d %(convert)d 0 22 22 33 33 N\n')
示例3: test_rectangle
# 需要導入模塊: from upconvert.writer.kicad import KiCAD [as 別名]
# 或者: from upconvert.writer.kicad.KiCAD import get_shape_line [as 別名]
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')
示例4: test_polygon
# 需要導入模塊: from upconvert.writer.kicad import KiCAD [as 別名]
# 或者: from upconvert.writer.kicad.KiCAD import get_shape_line [as 別名]
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')
示例5: test_rectangle
# 需要導入模塊: from upconvert.writer.kicad import KiCAD [as 別名]
# 或者: from upconvert.writer.kicad.KiCAD import get_shape_line [as 別名]
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 ' + str(int(10 / MULT)) + ' '
+ str(int(20 / MULT)) + ' '
+ str(int(15 / MULT)) + ' '
+ str(int(10 / MULT)) + ' '
+ '%(unit)d %(convert)d 0 N\n')