2 # Copyright 2008 by Bdale Garbee <bdale@gag.com>. GPLv2
4 # Program to emit PCB footprint for
5 # Molex 1.25mm PicoBlade, vertical through-hole header 53047-XX10, 2-15 pins
7 # Needs pin count on command line, in range of 2..15
10 # dimensions in mm from 530470410_sd.pdf datasheet
20 # we're going to use the 1/100 of a mil fundamental unit form
22 return int( mm / 25.4 * 1000.0 * 100.0 + 0.5 )
24 pins = int(sys.argv[1])
26 sys.stderr.write('Must be at least 2 pins\n')
29 sys.stderr.write('Must be no more than 15 pins\n')
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 "PicoBlade%i"' % pins,'"" "" 0 0 0 0 0 100 0x0]'
39 for pin in range (1,pins+1):
40 pinnum = pins + 1 - pin
46 mm2mils100((pins-1)*PinSpacing - (pin-1)*PinSpacing), \
51 mm2mils100(PinDiam), \
52 '"pin%i"' % pinnum, '"%i"' % pinnum, Flags, ']'
54 BoxWidth = (BoxEnd * 2) + ((pins - 1) * PinSpacing);
56 print ' ElementLine[', \
57 mm2mils100(-BoxEnd), \
58 mm2mils100(-BoxOffset), \
59 mm2mils100(-BoxEnd), \
60 mm2mils100(BoxHeight-BoxOffset), \
63 print ' ElementLine[', \
64 mm2mils100(-BoxEnd), \
65 mm2mils100(BoxHeight-BoxOffset), \
66 mm2mils100(BoxWidth-BoxEnd), \
67 mm2mils100(BoxHeight-BoxOffset), \
70 print ' ElementLine[', \
71 mm2mils100(BoxWidth-BoxEnd), \
72 mm2mils100(BoxHeight-BoxOffset), \
73 mm2mils100(BoxWidth-BoxEnd), \
74 mm2mils100(-BoxOffset), \
77 print ' ElementLine[', \
78 mm2mils100(BoxWidth-BoxEnd), \
79 mm2mils100(-BoxOffset), \
80 mm2mils100(-BoxEnd), \
81 mm2mils100(-BoxOffset), \