2 # Copyright 2015 by Bdale Garbee <bdale@gag.com>. GPLv2
4 # Program to emit PCB footprint for
5 # Tyco/AMP Micro-MaTch vertical surface-mount female connectors
7 # Needs pin count on command line, in range of 4..20 even numbers only
10 # dimensions in mm from ENG_CD_188275_S3_c-188275_drw.pdf
14 RowGap = 1.50 # space between rows
16 Clearance = 0.006 # in mils
26 # we're going to use the 1/100 of a mil fundamental unit form
28 return int( mm / 25.4 * 1000.0 * 100.0 + 0.5 )
30 pins = int(sys.argv[1])
33 sys.stderr.write('Must be at least 4 pins\n')
36 sys.stderr.write('Must be no more than 20 pins\n')
40 if sys.argv[2] == "latch":
43 BoxXOffset = -((pins - 1) * PadSpacing)/2
45 print('# author: Bdale Garbee')
46 print('# email: bdale@gag.com')
47 print('# dist-license: GPL 2')
48 print('# use-license: unlimited')
50 print('Element[0x0 "MicroMatch%i"' % pins,'"" "" 0 0 0 0 0 100 0x0]')
52 for col in range (int((pins+1)/2)):
55 origin= (RowGap + PadHeight)/2
57 origin= -(RowGap + PadHeight)/2
58 pinnum = (col * 2) + row + 1
59 Flags = '"square,nopaste"'
62 mm2mils100((pinnum-1)*PadSpacing + BoxXOffset), \
63 mm2mils100(origin + PadHeight/2 - PadWidth/2), \
64 mm2mils100((pinnum-1)*PadSpacing + BoxXOffset), \
65 mm2mils100(origin - PadHeight/2 + PadWidth/2), \
66 mm2mils100(PadWidth), \
68 mm2mils100(PadWidth)+Clearance*2, \
69 '"pin%i"' % pinnum, '"%i"' % pinnum, Flags, ']')
71 BoxX = BoxXbase + pins/2 * BoxXstep
77 print(' ElementLine[', \
84 print(' ElementLine[', \
91 print(' ElementLine[', \
98 print(' ElementLine[', \