Esempio n. 1
0
 def __init__(self, start, end, layer='F.SilkS', width=0.15, board=None):
     line = pcbnew.DRAWSEGMENT(board and board.native_obj)
     line.SetShape(pcbnew.S_SEGMENT)
     line.SetStart(Point.native_from(start))
     line.SetEnd(Point.native_from(end))
     line.SetLayer(pcbnew_layer.get_board_layer(board, layer))
     line.SetWidth(int(width * units.DEFAULT_UNIT_IUS))
     self._obj = line
Esempio n. 2
0
 def __init__(self, start, end, layer='F.SilkS', width=0.15, board=None):
     line = pcbnew.DRAWSEGMENT(board and board.native_obj)
     line.SetShape(pcbnew.S_SEGMENT)
     line.SetStart(Point.native_from(start))
     line.SetEnd(Point.native_from(end))
     line.SetLayer(pcbnew_layer.get_board_layer(board, layer))
     line.SetWidth(int(width * units.DEFAULT_UNIT_IUS))
     self._obj = line
Esempio n. 3
0
 def __init__(self, width, start, end, layer="F.Cu", board=None):
     self._track = pcbnew.TRACK(board and board.native_obj)
     self._track.SetWidth(int(width * units.DEFAULT_UNIT_IUS))
     if board:
         self._track.SetLayer(board.get_layer(layer))
     else:
         self._track.SetLayer(pcbnew_layer.get_std_layer(layer))
     self._track.SetStart(Point.native_from(start))
     self._track.SetEnd(Point.native_from(end))
Esempio n. 4
0
 def __init__(self, width, start, end, layer='F.Cu', board=None):
     self._track = pcbnew.TRACK(board and board.native_obj)
     self._track.SetWidth(int(width * units.DEFAULT_UNIT_IUS))
     if board:
         self._track.SetLayer(board.get_layer(layer))
     else:
         self._track.SetLayer(pcbnew_layer.get_std_layer(layer))
     self._track.SetStart(Point.native_from(start))
     self._track.SetEnd(Point.native_from(end))
Esempio n. 5
0
 def __init__(self, center, radius, layer='F.SilkS', width=0.15,
              board=None):
     circle = pcbnew.DRAWSEGMENT(board and board.native_obj)
     circle.SetShape(pcbnew.S_CIRCLE)
     circle.SetCenter(Point.native_from(center))
     start_coord = Point.native_from(
         (center[0], center[1] + radius))
     circle.SetArcStart(start_coord)
     circle.SetLayer(pcbnew_layer.get_board_layer(board, layer))
     circle.SetWidth(int(width * units.DEFAULT_UNIT_IUS))
     self._obj = circle
Esempio n. 6
0
 def __init__(self, center, radius, layer='F.SilkS', width=0.15,
              board=None):
     circle = pcbnew.DRAWSEGMENT(board and board.native_obj)
     circle.SetShape(pcbnew.S_CIRCLE)
     circle.SetCenter(Point.native_from(center))
     start_coord = Point.native_from(
         (center[0], center[1] + radius))
     circle.SetArcStart(start_coord)
     circle.SetLayer(pcbnew_layer.get_board_layer(board, layer))
     circle.SetWidth(int(width * units.DEFAULT_UNIT_IUS))
     self._obj = circle
Esempio n. 7
0
    def __init__(self, center, radius, start_angle, stop_angle,
                 layer='F.SilkS', width=0.15, board=None):
        start_coord = radius * cmath.exp(math.radians(start_angle - 90) * 1j)
        start_coord = Point.native_from((start_coord.real, start_coord.imag))

        angle = stop_angle - start_angle
        arc = pcbnew.DRAWSEGMENT(board and board.native_obj)
        arc.SetShape(pcbnew.S_ARC)
        arc.SetCenter(Point.native_from(center))
        arc.SetArcStart(start_coord)
        arc.SetAngle(angle * 10)
        arc.SetLayer(pcbnew_layer.get_board_layer(board, layer))
        arc.SetWidth(int(width * units.DEFAULT_UNIT_IUS))
        self._obj = arc
Esempio n. 8
0
 def start(self, value):
     self._obj.SetStart(Point.native_from(value))
Esempio n. 9
0
 def end(self, value):
     self._obj.SetArcEnd(Point.native_from(value))
Esempio n. 10
0
 def center(self, value):
     self._obj.SetCenter(Point.native_from(value))
Esempio n. 11
0
 def position(self, value):
     self._obj.SetPosition(Point.native_from(value))
Esempio n. 12
0
 def position(self, value):
     self._obj.SetPosition(Point.native_from(value))
Esempio n. 13
0
 def __init__(self, width, start, end, layer='F.Cu', board=None):
     self._obj = pcbnew.TRACK(board and board.native_obj)
     self._obj.SetWidth(int(width * units.DEFAULT_UNIT_IUS))
     self.layer = layer
     self._obj.SetStart(Point.native_from(start))
     self._obj.SetEnd(Point.native_from(end))