2 # Copyright 2007 by Bdale Garbee <bdale@gag.com>. GPLv2
4 # Program to emit PCB footprint for Samtec BTE connectors
8 # dimensions in mm from BTE-XXX-XX-X-D-XX-FOOTPRINT.pdf and BSE.pdf
13 RowSpacing = 6.172 - PinHeight
17 # Needs pin count per row on command line, 20/40/60/80/100/120 are valid
18 positions = int(sys.argv[1])
19 ordinal = positions / 20.0
20 if (ordinal < 1) or (ordinal > 6) or (positions%20 != 0):
21 sys.stderr.write('Invalid number of positions, must be 20|40|60|80|100|120.\n')
24 BodyWidth = (positions * PinSpacing) + 4.00
26 HoleSpacing = (positions * PinSpacing) + 2.477
28 # we're going to use the 1/100 of a mil fundamental unit form
30 return int( mm / 25.4 * 1000.0 * 100.0 + 0.5 )
32 print '# author: Bdale Garbee'
33 print '# email: bdale@gag.com'
34 print '# dist-license: GPL 2'
35 print '# use-license: unlimited'
37 print 'Element[0x0 "BSE" "" "" 0 0 -10161 -12011 0 100 0x0]'
39 for pin in range (0,positions):
41 mm2mils100((pin-(positions/2 - 0.5)) * PinSpacing), \
42 mm2mils100(-(RowSpacing/2 + PinWidth/2)), \
43 mm2mils100((pin-(positions/2 - 0.5)) * PinSpacing), \
44 mm2mils100(-(RowSpacing/2 + PinHeight - PinWidth/2)), \
45 mm2mils100(PinWidth), \
46 mm2mils100(PinSpacing - PinWidth), \
47 mm2mils100(PinWidth)+600, \
48 '"pin%i"' % (1 + pin*2), '"%i"' % (1 + pin*2), '0x0100]'
51 mm2mils100((pin-(positions/2 - 0.5)) * PinSpacing), \
52 mm2mils100(RowSpacing/2 + PinWidth/2), \
53 mm2mils100((pin-(positions/2 - 0.5)) * PinSpacing), \
54 mm2mils100(RowSpacing/2 + PinHeight - PinWidth/2), \
55 mm2mils100(PinWidth), \
56 mm2mils100(PinSpacing - PinWidth), \
57 mm2mils100(PinWidth)+600, \
58 '"pin%i"' % (2 + pin*2), '"%i"' % (2 + pin*2), '0x0100]'
61 mm2mils100(HoleSpacing/2), \
62 mm2mils100(-HoleOffset), \
63 mm2mils100(HoleDiam), \
65 mm2mils100(HoleDiam), \
66 mm2mils100(HoleDiam), \
67 '"mnt" "0"', '0x0008', ']'
70 mm2mils100(-HoleSpacing/2), \
71 mm2mils100(-HoleOffset), \
72 mm2mils100(HoleDiam), \
74 mm2mils100(HoleDiam), \
75 mm2mils100(HoleDiam), \
76 '"mnt" "0"', '0x0008', ']'
78 print ' ElementLine[',\
79 mm2mils100(-BodyWidth/2), \
80 mm2mils100(-BodyHeight/2), \
81 mm2mils100(-BodyWidth/2), \
82 mm2mils100( BodyHeight/2), \
85 print ' ElementLine[',\
86 mm2mils100(-BodyWidth/2), \
87 mm2mils100( BodyHeight/2), \
88 mm2mils100( BodyWidth/2), \
89 mm2mils100( BodyHeight/2), \
92 print ' ElementLine[',\
93 mm2mils100( BodyWidth/2), \
94 mm2mils100( BodyHeight/2), \
95 mm2mils100( BodyWidth/2), \
96 mm2mils100(-BodyHeight/2), \
99 print ' ElementLine[',\
100 mm2mils100( BodyWidth/2), \
101 mm2mils100(-BodyHeight/2), \
102 mm2mils100(-BodyWidth/2), \
103 mm2mils100(-BodyHeight/2), \
106 print ' ElementArc[',\
107 mm2mils100(-(positions/2 + 0.5) * PinSpacing), \
108 mm2mils100(-(RowSpacing/2+PinHeight*5/4)), \
109 '500 500 0 360 1000 ]'