--- /dev/null
+#!/usr/bin/python3
+# Copyright 2022 by Bdale Garbee <bdale@gag.com>. GPLv3
+#
+# Program to emit PCB footprint for Onion Omega2S Linux SOM
+#
+
+# dimensions in mm from:
+# onion/Omega2S_Datasheet.pdf
+
+BodyLength = 34.0
+BodyWidth = 20.0
+
+OuterPitch = 1.27
+OuterWidth = 0.86
+OuterHeight = 1.50
+
+LeftOffset = 1.76
+
+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 )
+
+print('# author: Bdale Garbee')
+print('# email: bdale@gag.com')
+print('# dist-license: GPL 3')
+print('# use-license: unlimited')
+
+print('Element[0x0 "Omega2S" "" "" 0 0 11000 0 0 100 0x0]')
+print("(")
+
+# outer 2 long rows
+for pin in range (0,25):
+ print(' Pad[',\
+ mm2mils100(-BodyLength/2 + LeftOffset + pin*OuterPitch), \
+ mm2mils100(-BodyWidth/2 + OuterHeight/2 - OuterWidth/2), \
+ mm2mils100(-BodyLength/2 + LeftOffset + pin*OuterPitch), \
+ mm2mils100(-BodyWidth/2 - OuterHeight/2 + OuterWidth/2), \
+ mm2mils100(OuterWidth), \
+ mm2mils100(OuterPitch - OuterWidth), \
+ mm2mils100(OuterWidth)+600, \
+ '"pin%i"' % (63 - pin), '"%i"' % (63 - pin), '"square"]')
+
+ print(' Pad[',\
+ mm2mils100(-BodyLength/2 + LeftOffset + pin*OuterPitch), \
+ mm2mils100(BodyWidth/2 + OuterHeight/2 - OuterWidth/2), \
+ mm2mils100(-BodyLength/2 + LeftOffset + pin*OuterPitch), \
+ mm2mils100(BodyWidth/2 - OuterHeight/2 + OuterWidth/2), \
+ mm2mils100(OuterWidth), \
+ mm2mils100(OuterPitch - OuterWidth), \
+ mm2mils100(OuterWidth)+600, \
+ '"pin%i"' % (1 + pin), '"%i"' % (1 + pin), '"square"]')
+
+# right side row
+for pin in range (0,13):
+ print(' Pad[',\
+ mm2mils100(BodyLength/2 + OuterHeight/2 - OuterWidth/2), \
+ mm2mils100((pin-6) * OuterPitch), \
+ mm2mils100(BodyLength/2 - OuterHeight/2 + OuterWidth/2), \
+ mm2mils100((pin-6) * OuterPitch), \
+ mm2mils100(OuterWidth), \
+ mm2mils100(OuterPitch - OuterWidth), \
+ mm2mils100(OuterWidth)+600, \
+ '"pin%i"' % (38 - pin), '"%i"' % (38 - pin), '"square"]')
+
+print(' ElementLine[',\
+ mm2mils100(-BodyLength/2), \
+ mm2mils100(-BodyWidth/2), \
+ mm2mils100(-BodyLength/2), \
+ mm2mils100( BodyWidth/2), \
+ '1000 ]')
+
+print(' ElementLine[',\
+ mm2mils100(-BodyLength/2), \
+ mm2mils100( BodyWidth/2), \
+ mm2mils100( BodyLength/2), \
+ mm2mils100( BodyWidth/2), \
+ '1000 ]')
+
+print(' ElementLine[',\
+ mm2mils100( BodyLength/2), \
+ mm2mils100( BodyWidth/2), \
+ mm2mils100( BodyLength/2), \
+ mm2mils100(-BodyWidth/2), \
+ '1000 ]')
+
+print(' ElementLine[',\
+ mm2mils100( BodyLength/2), \
+ mm2mils100(-BodyWidth/2), \
+ mm2mils100(-BodyLength/2), \
+ mm2mils100(-BodyWidth/2), \
+ '1000 ]')
+
+print(")")