Пример #1
0
    def testTwoTerminalChip(self):
        # Chip-ish device
        A = ipc.Dimension.from_nominal(10, 0)
        B = ipc.Dimension.from_nominal(5, 0)
        L = ipc.Dimension.from_nominal(10, 0)
        T = ipc.Dimension.from_nominal(1, 0)
        W = ipc.Dimension.from_nominal(5, 0)
        spec = ipc.LandPatternSize(toe=0, heel=0, side=0, courtyard=0)

        expected = '''
PAD 1 (-4.50 0.00) (1.15 5.15)
PAD 2 (4.50 0.00) (1.15 5.15)

LINE Silkscreen 0.15 (-3.72 -2.57) (3.72 -2.57)
LINE Silkscreen 0.15 (-3.72 2.57) (3.72 2.57)

LINE Assembly 0.07 (-5.00 2.50) (-5.00 -2.50) (5.00 -2.50) (5.00 2.50) (-5.00 2.50)

LINE Documentation 0.15 (-1.96 0.00) (1.96 0.00)
LINE Documentation 0.15 (0.00 -1.96) (0.00 1.96)

LINE Courtyard 0.15 (-5.08 -2.65) (5.08 -2.65) (5.08 2.65) (-5.08 2.65) (-5.08 -2.65)
'''
        self._check_drawing(
            ipc.two_terminal_symmetric_device(A,
                                              B,
                                              L,
                                              T,
                                              W,
                                              spec,
                                              polarized=False), expected)

        expected = '''
PAD 1 (-4.50 0.00) (1.15 5.15)
PAD 2 (4.50 0.00) (1.15 5.15)

LINE Silkscreen 0.15 (-3.72 -2.57) (3.72 -2.57)
LINE Silkscreen 0.15 (-3.72 2.57) (-3.72 -2.57)
LINE Silkscreen 0.15 (-3.72 2.57) (3.72 2.57)
CIRCLE Silkscreen (-5.28 0.00) 0.10

LINE Assembly 0.07 (-5.00 2.50) (-5.00 -2.50) (5.00 -2.50) (5.00 2.50) (-5.00 2.50)

LINE Documentation 0.15 (-1.96 0.00) (1.96 0.00)
LINE Documentation 0.15 (0.00 -1.96) (0.00 1.96)

LINE Courtyard 0.15 (-5.38 -2.65) (5.08 -2.65) (5.08 2.65) (-5.38 2.65) (-5.38 -2.65)
'''
        self._check_drawing(
            ipc.two_terminal_symmetric_device(A,
                                              B,
                                              L,
                                              T,
                                              W,
                                              spec,
                                              polarized=True), expected)
Пример #2
0
    def testTwoTerminalMolded(self):
        # Molded-ish device
        A = ipc.Dimension.from_nominal(10, 0)
        B = ipc.Dimension.from_nominal(7, 0)
        L = ipc.Dimension.from_nominal(10, 0)
        T = ipc.Dimension.from_nominal(1, 0)
        W = ipc.Dimension.from_nominal(5, 0)
        spec = ipc.LandPatternSize(toe=0, heel=0, side=0, courtyard=0)

        expected = '''
PAD 1 (-4.50 0.00) (1.15 5.15)
PAD 2 (4.50 0.00) (1.15 5.15)

LINE Silkscreen 0.15 (-5.00 -2.77) (-5.00 -3.50)
LINE Silkscreen 0.15 (-5.00 -3.50) (5.00 -3.50)
LINE Silkscreen 0.15 (-5.00 2.77) (-5.00 3.50)
LINE Silkscreen 0.15 (-5.00 3.50) (5.00 3.50)
LINE Silkscreen 0.15 (5.00 -2.77) (5.00 -3.50)
LINE Silkscreen 0.15 (5.00 2.77) (5.00 3.50)

LINE Assembly 0.07 (-5.00 3.50) (-5.00 -3.50) (5.00 -3.50) (5.00 3.50) (-5.00 3.50)

LINE Documentation 0.15 (-1.96 0.00) (1.96 0.00)
LINE Documentation 0.15 (0.00 -1.96) (0.00 1.96)

LINE Courtyard 0.15 (-5.08 -3.58) (5.08 -3.58) (5.08 3.58) (-5.08 3.58) (-5.08 -3.58)
'''
        self._check_drawing(
            ipc.two_terminal_symmetric_device(
                A, B, L, T, W, spec, polarized=False), expected)

        expected = '''
PAD 1 (-4.50 0.00) (1.15 5.15)
PAD 2 (4.50 0.00) (1.15 5.15)

LINE Silkscreen 0.15 (-5.00 -2.77) (-5.00 -3.50)
LINE Silkscreen 0.15 (-5.00 -3.50) (5.00 -3.50)
LINE Silkscreen 0.15 (-5.00 2.77) (-5.00 3.50)
LINE Silkscreen 0.15 (-5.00 3.50) (5.00 3.50)
LINE Silkscreen 0.15 (5.00 -2.77) (5.00 -3.50)
LINE Silkscreen 0.15 (5.00 2.77) (5.00 3.50)
CIRCLE Silkscreen (-5.30 3.50) 0.10

LINE Assembly 0.07 (-5.00 3.50) (-5.00 -3.50) (5.00 -3.50) (5.00 3.50) (-5.00 3.50)

LINE Documentation 0.15 (-1.96 0.00) (1.96 0.00)
LINE Documentation 0.15 (0.00 -1.96) (0.00 1.96)

LINE Courtyard 0.15 (-5.40 -3.58) (5.08 -3.58) (5.08 3.60) (-5.40 3.60) (-5.40 -3.58)
'''
        self._check_drawing(
            ipc.two_terminal_symmetric_device(
                A, B, L, T, W, spec, polarized=True), expected)
Пример #3
0
def MELF(profile, polarized):
    A = ipc.Dimension(4.7, 5.2)
    B = ipc.Dimension(2.41, 2.67)
    T = ipc.Dimension(0.46, 0.56)
    return ipc.two_terminal_symmetric_device(
        A=A, B=B, L=A, T=T, W=B,
        spec=ipc.LandPatternSize.MELF(profile),
        polarized=polarized)
Пример #4
0
def Molded(profile, polarized):
    A = ipc.Dimension.from_nominal(3.5, 0.2)
    B = ipc.Dimension.from_nominal(2.8, 0.2)
    T = ipc.Dimension.from_nominal(0.8, 0.3)
    W = ipc.Dimension.from_nominal(2.2, 0.1)
    return ipc.two_terminal_symmetric_device(
        A=A, B=B, L=A, T=T, W=W,
        spec=ipc.LandPatternSize.inward_L_leads(profile),
        polarized=polarized)
Пример #5
0
def chip(profile, size, polarized=False):
    """Construct a land pattern for chip devices.

    >>> chip(Most, metric('2012'), polarized=True)

    >>> chip(Most, metric('0402'), polarized=True)
    """
    A, B, T = size
    return ipc.two_terminal_symmetric_device(
        A, B, A, T, B, ipc.LandPatternSize.chip(profile, A), polarized)
Пример #6
0
def chip(profile, size, polarized=False):
    """Construct a land pattern for chip devices.

    >>> chip(Most, metric('2012'), polarized=True)

    >>> chip(Most, metric('0402'), polarized=True)
    """
    A, B, T = size
    return ipc.two_terminal_symmetric_device(
        A, B, A, T, B, ipc.LandPatternSize.chip(profile, A), polarized)
Пример #7
0
def SOD(profile, polarized):
    A = ipc.Dimension(2.55, 2.85)
    B = ipc.Dimension(1.4, 1.7)
    L = ipc.Dimension(3.55, 3.85)
    T = ipc.Dimension(0.25, 0.4)
    W = ipc.Dimension.from_nominal(0.55, 0.1)
    return ipc.two_terminal_symmetric_device(
        A=A, B=B, L=L, T=T, W=W,
        spec=ipc.LandPatternSize.SOD(
            profile, A=A, L=L, T=T),
        polarized=polarized)