X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=packages%2Fte-connectivity%2Fmicromatch-smt-v.py;h=db08740639f6e63e03150a2b2b8a7d992cb6afae;hb=3034dc83f6095f1df20523b07cdba7f252341c3f;hp=b9baf242c294ff025b8941fc8b788472154b42bf;hpb=14289403c8e193e10a174fde02030028b6f7bbb1;p=hw%2Faltusmetrum diff --git a/packages/te-connectivity/micromatch-smt-v.py b/packages/te-connectivity/micromatch-smt-v.py index b9baf24..db08740 100755 --- a/packages/te-connectivity/micromatch-smt-v.py +++ b/packages/te-connectivity/micromatch-smt-v.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/python3 # Copyright 2015 by Bdale Garbee . GPLv2 # # Program to emit PCB footprint for @@ -11,9 +11,9 @@ PadWidth = 1.50 PadHeight = 3.00 PadSpacing = 1.27 -RowGap = 1.50 # space between rows +RowGap = 1.50 # space between rows -Clearance = 0.006 # in mils +Clearance = 0.006 # in mils BoxY = 5.2 BoxXbase = 4.55 @@ -25,81 +25,81 @@ import sys # we're going to use the 1/100 of a mil fundamental unit form def mm2mils100( mm ): - return int( mm / 25.4 * 1000.0 * 100.0 + 0.5 ) + return int( mm / 25.4 * 1000.0 * 100.0 + 0.5 ) pins = int(sys.argv[1]) if pins < 4: - sys.stderr.write('Must be at least 4 pins\n') - sys.exit(1) + sys.stderr.write('Must be at least 4 pins\n') + sys.exit(1) if pins > 20: - sys.stderr.write('Must be no more than 20 pins\n') - sys.exit(1) + sys.stderr.write('Must be no more than 20 pins\n') + sys.exit(1) if len(sys.argv) > 2: if sys.argv[2] == "latch": - BoxXbase = 7.15 + BoxXbase = 7.15 BoxXOffset = -((pins - 1) * PadSpacing)/2 -print '# author: Bdale Garbee' -print '# email: bdale@gag.com' -print '# dist-license: GPL 2' -print '# use-license: unlimited' +print('# author: Bdale Garbee') +print('# email: bdale@gag.com') +print('# dist-license: GPL 2') +print('# use-license: unlimited') -print 'Element[0x0 "MicroMatch%i"' % pins,'"" "" 0 0 0 0 0 100 0x0]' -print "(" -for col in range ((pins+1)/2): +print('Element[0x0 "MicroMatch%i"' % pins,'"" "" 0 0 0 0 0 100 0x0]') +print("(") +for col in range (int((pins+1)/2)): for row in range (2): - if row == 1: - origin= (RowGap + PadHeight)/2 - else: - origin= -(RowGap + PadHeight)/2 + if row == 1: + origin= (RowGap + PadHeight)/2 + else: + origin= -(RowGap + PadHeight)/2 pinnum = (col * 2) + row + 1 - Flags = '"square,nopaste"' - - print ' Pad[', \ - mm2mils100((pinnum-1)*PadSpacing + BoxXOffset), \ - mm2mils100(origin + PadHeight/2 - PadWidth/2), \ - mm2mils100((pinnum-1)*PadSpacing + BoxXOffset), \ - mm2mils100(origin - PadHeight/2 + PadWidth/2), \ - mm2mils100(PadWidth), \ - 0, \ - mm2mils100(PadWidth)+Clearance*2, \ - '"pin%i"' % pinnum, '"%i"' % pinnum, Flags, ']' - + Flags = '"square,nopaste"' + + print(' Pad[', \ + mm2mils100((pinnum-1)*PadSpacing + BoxXOffset), \ + mm2mils100(origin + PadHeight/2 - PadWidth/2), \ + mm2mils100((pinnum-1)*PadSpacing + BoxXOffset), \ + mm2mils100(origin - PadHeight/2 + PadWidth/2), \ + mm2mils100(PadWidth), \ + 0, \ + mm2mils100(PadWidth)+Clearance*2, \ + '"pin%i"' % pinnum, '"%i"' % pinnum, Flags, ']') + BoxX = BoxXbase + pins/2 * BoxXstep BoxX1 = -BoxX/2 BoxX2 = BoxX/2 BoxY1 = -BoxY/2 BoxY2 = BoxY/2 -print ' ElementLine[', \ - mm2mils100(BoxX1), \ - mm2mils100(BoxY1), \ - mm2mils100(BoxX1), \ - mm2mils100(BoxY2), \ - LineWidth, ']' - -print ' ElementLine[', \ - mm2mils100(BoxX1), \ - mm2mils100(BoxY2), \ - mm2mils100(BoxX2), \ - mm2mils100(BoxY2), \ - LineWidth, ']' - -print ' ElementLine[', \ - mm2mils100(BoxX2), \ - mm2mils100(BoxY2), \ - mm2mils100(BoxX2), \ - mm2mils100(BoxY1), \ - LineWidth, ']' - -print ' ElementLine[', \ - mm2mils100(BoxX2), \ - mm2mils100(BoxY1), \ - mm2mils100(BoxX1), \ - mm2mils100(BoxY1), \ - LineWidth, ']' +print(' ElementLine[', \ + mm2mils100(BoxX1), \ + mm2mils100(BoxY1), \ + mm2mils100(BoxX1), \ + mm2mils100(BoxY2), \ + LineWidth, ']') + +print(' ElementLine[', \ + mm2mils100(BoxX1), \ + mm2mils100(BoxY2), \ + mm2mils100(BoxX2), \ + mm2mils100(BoxY2), \ + LineWidth, ']') + +print(' ElementLine[', \ + mm2mils100(BoxX2), \ + mm2mils100(BoxY2), \ + mm2mils100(BoxX2), \ + mm2mils100(BoxY1), \ + LineWidth, ']') + +print(' ElementLine[', \ + mm2mils100(BoxX2), \ + mm2mils100(BoxY1), \ + mm2mils100(BoxX1), \ + mm2mils100(BoxY1), \ + LineWidth, ']') -print ")" +print(")")