summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-11-30 20:51:02 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2017-11-30 20:51:02 +0100
commitefa60d73f8912f518a89072653efbceeeac28385 (patch)
tree62228f27165c3538d6c4cb1cec099fe1c840f520
downloadIPC-7351-footprints-generator-efa60d73f8912f518a89072653efbceeeac28385.tar.gz
IPC-7351-footprints-generator-efa60d73f8912f518a89072653efbceeeac28385.tar.bz2
IPC-7351-footprints-generator-efa60d73f8912f518a89072653efbceeeac28385.tar.xz
IPC-7351-footprints-generator-efa60d73f8912f518a89072653efbceeeac28385.zip
o Initial import.
-rw-r--r--.gitignore1
-rw-r--r--RESC1005X15.kicad_mod31
-rw-r--r--RESC1005X35.kicad_mod31
-rw-r--r--RESC1005X37.kicad_mod31
-rw-r--r--RESC1005X40.kicad_mod31
-rw-r--r--RESC1608X40.kicad_mod31
-rw-r--r--RESC2012X40.kicad_mod31
-rw-r--r--RESC3216X40.kicad_mod31
-rw-r--r--RESC3225X40.kicad_mod31
-rw-r--r--RESC5025X40.kicad_mod31
-rw-r--r--RESC6332X40.kicad_mod31
-rwxr-xr-xgen35
-rw-r--r--requirements.txt2
-rw-r--r--script.cadquery.py82
-rw-r--r--templates/CHIP.j231
15 files changed, 461 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0a764a4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+env
diff --git a/RESC1005X15.kicad_mod b/RESC1005X15.kicad_mod
new file mode 100644
index 0000000..1df9060
--- /dev/null
+++ b/RESC1005X15.kicad_mod
@@ -0,0 +1,31 @@
+(module RESC1005X15 (layer F.Cu) (tedit 5A2018AF)
+ (attr smd)
+ (fp_text reference REF** (at 0 -0.125) (layer F.Fab)
+ (effects (font (size 0.1 0.1) (thickness 0.015)))
+ )
+ (fp_text value VAL** (at 0 0.125) (layer F.Fab)
+ (effects (font (size 0.1 0.1) (thickness 0.015)))
+ )
+
+ (fp_text user %R (at 0 -0.125) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+ (fp_text user %V (at 0 0.125) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+
+
+ (fp_line (start -0.5 -0.25) (end 0.5 -0.25) (layer F.Fab) (width 0.05))
+ (fp_line (start 0.5 -0.25) (end 0.5 0.25) (layer F.Fab) (width 0.05))
+ (fp_line (start 0.5 0.25) (end -0.5 0.25) (layer F.Fab) (width 0.05))
+ (fp_line (start -0.5 0.25) (end -0.5 -0.25) (layer F.Fab) (width 0.05))
+
+
+ (fp_line (start -1.5 -0.5) (end 1.5 -0.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 1.5 -0.5) (end 1.5 0.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 1.5 0.5) (end -1.5 0.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start -1.5 0.5) (end -1.5 -0.5) (layer F.CrtYd) (width 0.05))
+
+ (pad 1 smd rect (at -0.65 0) (size 0.9 0.7) (layers F.Cu F.Paste F.Mask))
+ (pad 2 smd rect (at 0.65 0) (size 0.9 0.7) (layers F.Cu F.Paste F.Mask))
+) \ No newline at end of file
diff --git a/RESC1005X35.kicad_mod b/RESC1005X35.kicad_mod
new file mode 100644
index 0000000..9f7f408
--- /dev/null
+++ b/RESC1005X35.kicad_mod
@@ -0,0 +1,31 @@
+(module RESC1005X35 (layer F.Cu) (tedit 5A2018AF)
+ (attr smd)
+ (fp_text reference REF** (at 0 -0.125) (layer F.Fab)
+ (effects (font (size 0.1 0.1) (thickness 0.015)))
+ )
+ (fp_text value VAL** (at 0 0.125) (layer F.Fab)
+ (effects (font (size 0.1 0.1) (thickness 0.015)))
+ )
+
+ (fp_text user %R (at 0 -0.125) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+ (fp_text user %V (at 0 0.125) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+
+
+ (fp_line (start -0.5 -0.25) (end 0.5 -0.25) (layer F.Fab) (width 0.05))
+ (fp_line (start 0.5 -0.25) (end 0.5 0.25) (layer F.Fab) (width 0.05))
+ (fp_line (start 0.5 0.25) (end -0.5 0.25) (layer F.Fab) (width 0.05))
+ (fp_line (start -0.5 0.25) (end -0.5 -0.25) (layer F.Fab) (width 0.05))
+
+
+ (fp_line (start -1.5 -0.5) (end 1.5 -0.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 1.5 -0.5) (end 1.5 0.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 1.5 0.5) (end -1.5 0.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start -1.5 0.5) (end -1.5 -0.5) (layer F.CrtYd) (width 0.05))
+
+ (pad 1 smd rect (at -0.65 0) (size 0.9 0.7) (layers F.Cu F.Paste F.Mask))
+ (pad 2 smd rect (at 0.65 0) (size 0.9 0.7) (layers F.Cu F.Paste F.Mask))
+) \ No newline at end of file
diff --git a/RESC1005X37.kicad_mod b/RESC1005X37.kicad_mod
new file mode 100644
index 0000000..ecdeec8
--- /dev/null
+++ b/RESC1005X37.kicad_mod
@@ -0,0 +1,31 @@
+(module RESC1005X37 (layer F.Cu) (tedit 5A2018AF)
+ (attr smd)
+ (fp_text reference REF** (at 0 -0.125) (layer F.Fab)
+ (effects (font (size 0.1 0.1) (thickness 0.015)))
+ )
+ (fp_text value VAL** (at 0 0.125) (layer F.Fab)
+ (effects (font (size 0.1 0.1) (thickness 0.015)))
+ )
+
+ (fp_text user %R (at 0 -0.125) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+ (fp_text user %V (at 0 0.125) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+
+
+ (fp_line (start -0.5 -0.25) (end 0.5 -0.25) (layer F.Fab) (width 0.05))
+ (fp_line (start 0.5 -0.25) (end 0.5 0.25) (layer F.Fab) (width 0.05))
+ (fp_line (start 0.5 0.25) (end -0.5 0.25) (layer F.Fab) (width 0.05))
+ (fp_line (start -0.5 0.25) (end -0.5 -0.25) (layer F.Fab) (width 0.05))
+
+
+ (fp_line (start -1.5 -0.5) (end 1.5 -0.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 1.5 -0.5) (end 1.5 0.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 1.5 0.5) (end -1.5 0.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start -1.5 0.5) (end -1.5 -0.5) (layer F.CrtYd) (width 0.05))
+
+ (pad 1 smd rect (at -0.65 0) (size 0.9 0.7) (layers F.Cu F.Paste F.Mask))
+ (pad 2 smd rect (at 0.65 0) (size 0.9 0.7) (layers F.Cu F.Paste F.Mask))
+) \ No newline at end of file
diff --git a/RESC1005X40.kicad_mod b/RESC1005X40.kicad_mod
new file mode 100644
index 0000000..d24ab93
--- /dev/null
+++ b/RESC1005X40.kicad_mod
@@ -0,0 +1,31 @@
+(module RESC1005X40 (layer F.Cu) (tedit 5A2018AF)
+ (attr smd)
+ (fp_text reference REF** (at 0 -0.125) (layer F.Fab)
+ (effects (font (size 0.1 0.1) (thickness 0.015)))
+ )
+ (fp_text value VAL** (at 0 0.125) (layer F.Fab)
+ (effects (font (size 0.1 0.1) (thickness 0.015)))
+ )
+
+ (fp_text user %R (at 0 -0.125) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+ (fp_text user %V (at 0 0.125) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+
+
+ (fp_line (start -0.5 -0.25) (end 0.5 -0.25) (layer F.Fab) (width 0.05))
+ (fp_line (start 0.5 -0.25) (end 0.5 0.25) (layer F.Fab) (width 0.05))
+ (fp_line (start 0.5 0.25) (end -0.5 0.25) (layer F.Fab) (width 0.05))
+ (fp_line (start -0.5 0.25) (end -0.5 -0.25) (layer F.Fab) (width 0.05))
+
+
+ (fp_line (start -1.5 -0.5) (end 1.5 -0.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 1.5 -0.5) (end 1.5 0.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 1.5 0.5) (end -1.5 0.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start -1.5 0.5) (end -1.5 -0.5) (layer F.CrtYd) (width 0.05))
+
+ (pad 1 smd rect (at -0.65 0) (size 0.9 0.7) (layers F.Cu F.Paste F.Mask))
+ (pad 2 smd rect (at 0.65 0) (size 0.9 0.7) (layers F.Cu F.Paste F.Mask))
+) \ No newline at end of file
diff --git a/RESC1608X40.kicad_mod b/RESC1608X40.kicad_mod
new file mode 100644
index 0000000..50fd742
--- /dev/null
+++ b/RESC1608X40.kicad_mod
@@ -0,0 +1,31 @@
+(module RESC1608X40 (layer F.Cu) (tedit 5A2018AF)
+ (attr smd)
+ (fp_text reference REF** (at 0 -0.2) (layer F.Fab)
+ (effects (font (size 0.16000000000000003 0.16000000000000003) (thickness 0.024)))
+ )
+ (fp_text value VAL** (at 0 0.2) (layer F.Fab)
+ (effects (font (size 0.16000000000000003 0.16000000000000003) (thickness 0.024)))
+ )
+
+ (fp_text user %R (at 0 -0.2) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+ (fp_text user %V (at 0 0.2) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+
+
+ (fp_line (start -0.8 -0.4) (end 0.8 -0.4) (layer F.Fab) (width 0.05))
+ (fp_line (start 0.8 -0.4) (end 0.8 0.4) (layer F.Fab) (width 0.05))
+ (fp_line (start 0.8 0.4) (end -0.8 0.4) (layer F.Fab) (width 0.05))
+ (fp_line (start -0.8 0.4) (end -0.8 -0.4) (layer F.Fab) (width 0.05))
+
+
+ (fp_line (start -1.5 -1.0) (end 1.5 -1.0) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 1.5 -1.0) (end 1.5 1.0) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 1.5 1.0) (end -1.5 1.0) (layer F.CrtYd) (width 0.05))
+ (fp_line (start -1.5 1.0) (end -1.5 -1.0) (layer F.CrtYd) (width 0.05))
+
+ (pad 1 smd rect (at -0.85 0) (size 1.1 1.0) (layers F.Cu F.Paste F.Mask))
+ (pad 2 smd rect (at 0.85 0) (size 1.1 1.0) (layers F.Cu F.Paste F.Mask))
+) \ No newline at end of file
diff --git a/RESC2012X40.kicad_mod b/RESC2012X40.kicad_mod
new file mode 100644
index 0000000..874699a
--- /dev/null
+++ b/RESC2012X40.kicad_mod
@@ -0,0 +1,31 @@
+(module RESC2012X40 (layer F.Cu) (tedit 5A2018AF)
+ (attr smd)
+ (fp_text reference REF** (at 0 -0.30000000000000004) (layer F.Fab)
+ (effects (font (size 0.24 0.24) (thickness 0.036)))
+ )
+ (fp_text value VAL** (at 0 0.30000000000000004) (layer F.Fab)
+ (effects (font (size 0.24 0.24) (thickness 0.036)))
+ )
+
+ (fp_text user %R (at 0 -0.30000000000000004) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+ (fp_text user %V (at 0 0.30000000000000004) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+
+
+ (fp_line (start -1.0 -0.6) (end 1.0 -0.6) (layer F.Fab) (width 0.05))
+ (fp_line (start 1.0 -0.6) (end 1.0 0.6) (layer F.Fab) (width 0.05))
+ (fp_line (start 1.0 0.6) (end -1.0 0.6) (layer F.Fab) (width 0.05))
+ (fp_line (start -1.0 0.6) (end -1.0 -0.6) (layer F.Fab) (width 0.05))
+
+
+ (fp_line (start -2.0 -1.0) (end 2.0 -1.0) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 2.0 -1.0) (end 2.0 1.0) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 2.0 1.0) (end -2.0 1.0) (layer F.CrtYd) (width 0.05))
+ (fp_line (start -2.0 1.0) (end -2.0 -1.0) (layer F.CrtYd) (width 0.05))
+
+ (pad 1 smd rect (at -0.95 0) (size 1.3 1.5) (layers F.Cu F.Paste F.Mask))
+ (pad 2 smd rect (at 0.95 0) (size 1.3 1.5) (layers F.Cu F.Paste F.Mask))
+) \ No newline at end of file
diff --git a/RESC3216X40.kicad_mod b/RESC3216X40.kicad_mod
new file mode 100644
index 0000000..0b74dd3
--- /dev/null
+++ b/RESC3216X40.kicad_mod
@@ -0,0 +1,31 @@
+(module RESC3216X40 (layer F.Cu) (tedit 5A2018AF)
+ (attr smd)
+ (fp_text reference REF** (at 0 -0.4) (layer F.Fab)
+ (effects (font (size 0.32000000000000006 0.32000000000000006) (thickness 0.048)))
+ )
+ (fp_text value VAL** (at 0 0.4) (layer F.Fab)
+ (effects (font (size 0.32000000000000006 0.32000000000000006) (thickness 0.048)))
+ )
+
+ (fp_text user %R (at 0 -0.4) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+ (fp_text user %V (at 0 0.4) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+
+
+ (fp_line (start -1.6 -0.8) (end 1.6 -0.8) (layer F.Fab) (width 0.05))
+ (fp_line (start 1.6 -0.8) (end 1.6 0.8) (layer F.Fab) (width 0.05))
+ (fp_line (start 1.6 0.8) (end -1.6 0.8) (layer F.Fab) (width 0.05))
+ (fp_line (start -1.6 0.8) (end -1.6 -0.8) (layer F.Fab) (width 0.05))
+
+
+ (fp_line (start -2.5 -1.0) (end 2.5 -1.0) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 2.5 -1.0) (end 2.5 1.0) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 2.5 1.0) (end -2.5 1.0) (layer F.CrtYd) (width 0.05))
+ (fp_line (start -2.5 1.0) (end -2.5 -1.0) (layer F.CrtYd) (width 0.05))
+
+ (pad 1 smd rect (at -1.4 0) (size 1.6 1.8) (layers F.Cu F.Paste F.Mask))
+ (pad 2 smd rect (at 1.4 0) (size 1.6 1.8) (layers F.Cu F.Paste F.Mask))
+) \ No newline at end of file
diff --git a/RESC3225X40.kicad_mod b/RESC3225X40.kicad_mod
new file mode 100644
index 0000000..56b08a0
--- /dev/null
+++ b/RESC3225X40.kicad_mod
@@ -0,0 +1,31 @@
+(module RESC3225X40 (layer F.Cu) (tedit 5A2018AF)
+ (attr smd)
+ (fp_text reference REF** (at 0 -0.625) (layer F.Fab)
+ (effects (font (size 0.5 0.5) (thickness 0.075)))
+ )
+ (fp_text value VAL** (at 0 0.625) (layer F.Fab)
+ (effects (font (size 0.5 0.5) (thickness 0.075)))
+ )
+
+ (fp_text user %R (at 0 -0.625) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+ (fp_text user %V (at 0 0.625) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+
+
+ (fp_line (start -1.6 -1.25) (end 1.6 -1.25) (layer F.Fab) (width 0.05))
+ (fp_line (start 1.6 -1.25) (end 1.6 1.25) (layer F.Fab) (width 0.05))
+ (fp_line (start 1.6 1.25) (end -1.6 1.25) (layer F.Fab) (width 0.05))
+ (fp_line (start -1.6 1.25) (end -1.6 -1.25) (layer F.Fab) (width 0.05))
+
+
+ (fp_line (start -2.5 -1.5) (end 2.5 -1.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 2.5 -1.5) (end 2.5 1.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 2.5 1.5) (end -2.5 1.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start -2.5 1.5) (end -2.5 -1.5) (layer F.CrtYd) (width 0.05))
+
+ (pad 1 smd rect (at -1.4 0) (size 1.6 2.7) (layers F.Cu F.Paste F.Mask))
+ (pad 2 smd rect (at 1.4 0) (size 1.6 2.7) (layers F.Cu F.Paste F.Mask))
+) \ No newline at end of file
diff --git a/RESC5025X40.kicad_mod b/RESC5025X40.kicad_mod
new file mode 100644
index 0000000..56e45a0
--- /dev/null
+++ b/RESC5025X40.kicad_mod
@@ -0,0 +1,31 @@
+(module RESC5025X40 (layer F.Cu) (tedit 5A2018AF)
+ (attr smd)
+ (fp_text reference REF** (at 0 -0.625) (layer F.Fab)
+ (effects (font (size 0.5 0.5) (thickness 0.075)))
+ )
+ (fp_text value VAL** (at 0 0.625) (layer F.Fab)
+ (effects (font (size 0.5 0.5) (thickness 0.075)))
+ )
+
+ (fp_text user %R (at 0 -0.625) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+ (fp_text user %V (at 0 0.625) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+
+
+ (fp_line (start -2.5 -1.25) (end 2.5 -1.25) (layer F.Fab) (width 0.05))
+ (fp_line (start 2.5 -1.25) (end 2.5 1.25) (layer F.Fab) (width 0.05))
+ (fp_line (start 2.5 1.25) (end -2.5 1.25) (layer F.Fab) (width 0.05))
+ (fp_line (start -2.5 1.25) (end -2.5 -1.25) (layer F.Fab) (width 0.05))
+
+
+ (fp_line (start -3.5 -1.5) (end 3.5 -1.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 3.5 -1.5) (end 3.5 1.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 3.5 1.5) (end -3.5 1.5) (layer F.CrtYd) (width 0.05))
+ (fp_line (start -3.5 1.5) (end -3.5 -1.5) (layer F.CrtYd) (width 0.05))
+
+ (pad 1 smd rect (at -2.2 0) (size 1.8 2.7) (layers F.Cu F.Paste F.Mask))
+ (pad 2 smd rect (at 2.2 0) (size 1.8 2.7) (layers F.Cu F.Paste F.Mask))
+) \ No newline at end of file
diff --git a/RESC6332X40.kicad_mod b/RESC6332X40.kicad_mod
new file mode 100644
index 0000000..079df58
--- /dev/null
+++ b/RESC6332X40.kicad_mod
@@ -0,0 +1,31 @@
+(module RESC6332X40 (layer F.Cu) (tedit 5A2018AF)
+ (attr smd)
+ (fp_text reference REF** (at 0 -0.8) (layer F.Fab)
+ (effects (font (size 0.6400000000000001 0.6400000000000001) (thickness 0.096)))
+ )
+ (fp_text value VAL** (at 0 0.8) (layer F.Fab)
+ (effects (font (size 0.6400000000000001 0.6400000000000001) (thickness 0.096)))
+ )
+
+ (fp_text user %R (at 0 -0.8) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+ (fp_text user %V (at 0 0.8) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+
+
+ (fp_line (start -3.15 -1.6) (end 3.15 -1.6) (layer F.Fab) (width 0.05))
+ (fp_line (start 3.15 -1.6) (end 3.15 1.6) (layer F.Fab) (width 0.05))
+ (fp_line (start 3.15 1.6) (end -3.15 1.6) (layer F.Fab) (width 0.05))
+ (fp_line (start -3.15 1.6) (end -3.15 -1.6) (layer F.Fab) (width 0.05))
+
+
+ (fp_line (start -4.0 -2.0) (end 4.0 -2.0) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 4.0 -2.0) (end 4.0 2.0) (layer F.CrtYd) (width 0.05))
+ (fp_line (start 4.0 2.0) (end -4.0 2.0) (layer F.CrtYd) (width 0.05))
+ (fp_line (start -4.0 2.0) (end -4.0 -2.0) (layer F.CrtYd) (width 0.05))
+
+ (pad 1 smd rect (at -2.8 0) (size 1.8 3.2) (layers F.Cu F.Paste F.Mask))
+ (pad 2 smd rect (at 2.8 0) (size 1.8 3.2) (layers F.Cu F.Paste F.Mask))
+) \ No newline at end of file
diff --git a/gen b/gen
new file mode 100755
index 0000000..6e850f6
--- /dev/null
+++ b/gen
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+
+from jinja2 import Environment, FileSystemLoader, select_autoescape
+import os.path
+
+basedir=os.path.dirname(__file__)
+
+env = Environment(
+ loader=FileSystemLoader(os.path.join(basedir, 'templates'))
+)
+
+chip = env.get_template('CHIP.j2')
+
+resc_parameters = [
+ # size x, size y, pad x, pad y, pad center-center, grid x, grid y, terminal x, heights
+ (10, 5, 0.90, 0.70, 1.30, 6, 2, (0.10, 0.30), [15, 35, 37, 40]),
+ (16, 8, 1.10, 1.00, 1.70, 6, 4, (0.15, 0.40), [40]),
+ (20, 12, 1.30, 1.50, 1.90, 8, 4, (0.15, 0.65), [40]),
+ (32, 16, 1.60, 1.80, 2.80, 10, 4, (0.25, 0.75), [40]),
+ (32, 25, 1.60, 2.70, 2.80, 10, 6, (0.25, 0.75), [40]),
+ (50, 25, 1.80, 2.70, 4.40, 14, 6, (0.35, 0.85), [40]),
+ (63, 32, 1.80, 3.20, 5.60, 16, 8, (0.35, 0.85), [40]),
+]
+
+for (sx, sy, px, py, pcc, gx, gy, tx, heights) in resc_parameters:
+ tx = (tx[0] + tx[1]) / 2
+ print("RESC{:02}{:02}".format(sx, sy))
+ gx = gx*0.5
+ gy = gy*0.5
+ for h in heights:
+ key = "RESC{:02}{:02}X{:02}".format(sx, sy, h)
+ print(" " + key)
+ kicad_mod = chip.render({"key": key, "sx": sx, "sy": sy, "px": px, "py": py, "pcc": pcc, "gx": gx, "gy": gy, "h": h})
+ with open("{}.kicad_mod".format(key), "w") as f:
+ f.write(kicad_mod)
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..4949adb
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,2 @@
+jinja2
+cadquery
diff --git a/script.cadquery.py b/script.cadquery.py
new file mode 100644
index 0000000..d05e92f
--- /dev/null
+++ b/script.cadquery.py
@@ -0,0 +1,82 @@
+import cadquery as cq
+from cadquery import exporters
+import math
+
+
+resc_parameters = [
+ # size x, size y, pad x, pad y, pad center-center, grid x, grid y, terminal x, heights
+ (10, 5, 0.90, 0.70, 1.30, 6, 2, (0.10, 0.30), [15, 35, 37, 40]),
+ (16, 8, 1.10, 1.00, 1.70, 6, 4, (0.15, 0.40), [40]),
+ (20, 12, 1.30, 1.50, 1.90, 8, 4, (0.15, 0.65), [40]),
+ (32, 16, 1.60, 1.80, 2.80, 10, 4, (0.25, 0.75), [40]),
+ (32, 25, 1.60, 2.70, 2.80, 10, 6, (0.25, 0.75), [40]),
+ (50, 25, 1.80, 2.70, 4.40, 14, 6, (0.35, 0.85), [40]),
+ (63, 32, 1.80, 3.20, 5.60, 16, 8, (0.35, 0.85), [40]),
+]
+
+(sx, sy, px, py, pcc, gx, gy, tx, heights) = resc_parameters[0]
+
+sx = float(sx)/10
+sy = float(sy)/10
+
+tx = (tx[0] + tx[1]) / 2
+
+h = heights[1]
+h = float(h) / 100
+
+th = h * 0.05
+
+body = cq.Workplane("XZ").\
+ moveTo(-sx/2 + th, th).\
+ lineTo(-sx/2 + th, h - th).\
+ lineTo(sx/2 - th, h - th).\
+ lineTo(sx/2 - th, th).\
+ close().\
+ extrude(sy).\
+ translate((0, sy/2, 0))
+
+show_object(body)
+
+top = cq.Workplane("XZ").\
+ moveTo(-sx/2 + tx, h - th).\
+ lineTo(-sx/2 + tx, h).\
+ lineTo(sx/2 - tx, h).\
+ lineTo(sx/2 - tx, h - th).\
+ close().\
+ extrude(sy).\
+ translate((0, sy/2, 0))
+
+show_object(top)
+
+f = math.sqrt(2)/2 * th
+
+def terminal():
+ return cq.Workplane("XZ").\
+ moveTo(-sx/2 + tx, 0).\
+ lineTo(-sx/2 + th, 0).\
+ threePointArc((-sx/2 + th - f, th - f), (-sx/2, th)).\
+ lineTo(-sx/2, h - th).\
+ threePointArc((-sx/2 + th - f, h - th + f), (-sx/2 + th, h)).\
+ lineTo(-sx/2 + tx, h).\
+ lineTo(-sx/2 + tx, h - th).\
+ lineTo(-sx/2 + th, h - th).\
+ lineTo(-sx/2 + th, th).\
+ lineTo(-sx/2 + tx, th).\
+ close().\
+ extrude(sy).\
+ translate((0, sy/2, 0))
+
+end = terminal()
+show_object(end)
+
+start = terminal().\
+ rotate((0, 0, -1), (0, 0, 1), 180)
+
+show_object(start)
+
+if False:
+ with open("/tmp/wat.step", "w") as f:
+ objects = [body, top, end, start]
+ # objects = cq.Workplane("XY").union([body, top, end, start])
+ o = body.union(top)
+ cq.exporters.exportShape(o, "STEP", f)
diff --git a/templates/CHIP.j2 b/templates/CHIP.j2
new file mode 100644
index 0000000..13ee398
--- /dev/null
+++ b/templates/CHIP.j2
@@ -0,0 +1,31 @@
+(module {{key}} (layer F.Cu) (tedit 5A2018AF)
+ (attr smd)
+ (fp_text reference REF** (at 0 {{sy/-4 * 0.1}}) (layer F.Fab)
+ (effects (font (size {{sy/5 * 0.1}} {{sy/5 * 0.1}}) (thickness {{sy/5 * 0.015}})))
+ )
+ (fp_text value VAL** (at 0 {{sy/4 * 0.1}}) (layer F.Fab)
+ (effects (font (size {{sy/5 * 0.1}} {{sy/5 * 0.1}}) (thickness {{sy/5 * 0.015}})))
+ )
+
+ (fp_text user %R (at 0 {{sy/-4 * 0.1}}) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+ (fp_text user %V (at 0 {{sy/4 * 0.1}}) (layer "F.SilkS")
+ (effects (font (size 0.7 0.7) (thickness 0.1)))
+ )
+
+ {# Outline #}
+ (fp_line (start {{sx/-20}} {{sy/-20}}) (end {{sx/ 20}} {{sy/-20}}) (layer F.Fab) (width 0.05))
+ (fp_line (start {{sx/ 20}} {{sy/-20}}) (end {{sx/ 20}} {{sy/ 20}}) (layer F.Fab) (width 0.05))
+ (fp_line (start {{sx/ 20}} {{sy/ 20}}) (end {{sx/-20}} {{sy/ 20}}) (layer F.Fab) (width 0.05))
+ (fp_line (start {{sx/-20}} {{sy/ 20}}) (end {{sx/-20}} {{sy/-20}}) (layer F.Fab) (width 0.05))
+
+ {# Courtyard #}
+ (fp_line (start {{gx/-2}} {{gy/-2}}) (end {{gx/2}} {{gy/-2}}) (layer F.CrtYd) (width 0.05))
+ (fp_line (start {{gx/2}} {{gy/-2}}) (end {{gx/2}} {{gy/2}}) (layer F.CrtYd) (width 0.05))
+ (fp_line (start {{gx/2}} {{gy/2}}) (end {{gx/-2}} {{gy/2}}) (layer F.CrtYd) (width 0.05))
+ (fp_line (start {{gx/-2}} {{gy/2}}) (end {{gx/-2}} {{gy/-2}}) (layer F.CrtYd) (width 0.05))
+
+ (pad 1 smd rect (at {{pcc/-2}} 0) (size {{px}} {{py}}) (layers F.Cu F.Paste F.Mask))
+ (pad 2 smd rect (at {{pcc/2}} 0) (size {{px}} {{py}}) (layers F.Cu F.Paste F.Mask))
+)