From bcee0681a4f4a43c0a3377981e7dbe137a733ddd Mon Sep 17 00:00:00 2001 From: Tony Grosinger Date: Wed, 20 Apr 2022 20:06:13 -0700 Subject: [PATCH] Add footprint for mounting hole and battery pads --- chrysemys/footprints/battery_pads.js | 95 +++++++++++++++++++++ chrysemys/footprints/chocmini_with_diode.js | 12 ++- chrysemys/footprints/m2_mounting_hole.js | 16 ++++ 3 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 chrysemys/footprints/battery_pads.js create mode 100644 chrysemys/footprints/m2_mounting_hole.js diff --git a/chrysemys/footprints/battery_pads.js b/chrysemys/footprints/battery_pads.js new file mode 100644 index 0000000..127586c --- /dev/null +++ b/chrysemys/footprints/battery_pads.js @@ -0,0 +1,95 @@ +module.exports = { + nets: { + neg: undefined, + pos: undefined, + }, + body: p => ` + (module BatteryPads + (layer "F.Cu") + + ${p.at /* parametric position */} + + ${'' /* TODO: Does not yet support rotation */} + + + (fp_text reference "BT1" (at 0 0.5) (layer "F.SilkS") hide (effects (font (size 1 1) (thickness 0.15)))) + (fp_text value "Battery_Cell" (at 0 -0.5) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15)))) + (fp_text user "Battery_Cell" (at 0 -0.5) (layer "B.Fab") (effects (font (size 1 1) (thickness 0.15)) (justify mirror))) + (fp_text user "BT01" (at 0 0.5) (layer "B.SilkS") hide (effects (font (size 1 1) (thickness 0.15)) (justify mirror))) + (fp_text user "Battery" (at 3.175 0.79375 90) (layer "F.SilkS") hide (effects (font (size 0.8 0.8) (thickness 0.1)))) + (fp_text user "Battery" (at 3.175 0.79375 90) (layer "B.SilkS") hide (effects (font (size 0.8 0.8) (thickness 0.1)) (justify mirror))) + (fp_text user "(+)" (at -1.1 -2.286) (layer "F.SilkS") (effects (font (size 0.8 0.8) (thickness 0.1)))) + (fp_text user "(+)" (at -1.1 -2.286) (layer "B.SilkS") (effects (font (size 0.8 0.8) (thickness 0.1)) (justify mirror))) + (fp_text user "(-)" (at 1.1 -2.286) (layer "F.SilkS") (effects (font (size 0.8 0.8) (thickness 0.1)))) + (fp_text user "(-)" (at 1.1 -2.286) (layer "B.SilkS") (effects (font (size 0.8 0.8) (thickness 0.1)) (justify mirror))) + + (fp_poly (pts + (xy 0.4 -1) + (xy 0.4 1) + (xy 1.8 1) + (xy 1.8 -1) + ) (layer "B.Mask") (width 0.1) (fill solid)) + (fp_poly (pts + (xy -1.8 -1) + (xy -1.8 1) + (xy -0.4 1) + (xy -0.4 -1) + ) (layer "B.Mask") (width 0.1) (fill solid)) + (fp_poly (pts + (xy -0.401442 -1) + (xy -0.401442 1) + (xy -1.801442 1) + (xy -1.801442 -1) + ) (layer "F.Mask") (width 0.1) (fill solid)) + (fp_poly (pts + (xy 1.8 -1) + (xy 1.8 1) + (xy 0.4 1) + (xy 0.4 -1) + ) (layer "F.Mask") (width 0.1) (fill solid)) + + (pad "1" thru_hole circle (at -1.1004 -1.3416) (size 0.4572 0.4572) (drill 0.3048) (layers *.Cu) ${p.net.pos.str}) + (pad "1" smd custom (at -1.1 0 180) (size 1.5 2.1) (layers "F.Cu") + (options (clearance outline) (anchor rect)) + (primitives + (gr_poly (pts + (xy 0.179 1.3352) + (xy -0.1766 1.3352) + (xy -0.1766 0.762) + (xy 0.179 0.762) + ) (width 0.1) (fill yes)) + )) + (pad "1" smd custom (at -1.1 0) (size 1.5 2.1) (layers "B.Cu") + (options (clearance outline) (anchor rect)) + (primitives + (gr_poly (pts + (xy 0.176556 -0.7618) + (xy -0.179044 -0.7618) + (xy -0.179044 -1.335) + (xy 0.176556 -1.335) + ) (width 0.1) (fill yes)) + )) + (pad "2" thru_hole circle (at 1.1 -1.3416) (size 0.4572 0.4572) (drill 0.3048) (layers *.Cu) ${p.net.neg.str}) + (pad "2" smd custom (at 1.1 0 180) (size 1.5 2.1) (layers "F.Cu") + (options (clearance outline) (anchor rect)) + (primitives + (gr_poly (pts + (xy 0.1786 1.3352) + (xy -0.177 1.3352) + (xy -0.177 0.762) + (xy 0.1786 0.762) + ) (width 0.1) (fill yes)) + )) + (pad "2" smd custom (at 1.1 0) (size 1.5 2.1) (layers "B.Cu") + (options (clearance outline) (anchor rect)) + (primitives + (gr_poly (pts + (xy 0.1766 -0.7618) + (xy -0.179 -0.7618) + (xy -0.179 -1.335) + (xy 0.1766 -1.335) + ) (width 0.1) (fill yes)) + )) + ) + ` +} diff --git a/chrysemys/footprints/chocmini_with_diode.js b/chrysemys/footprints/chocmini_with_diode.js index 2d77bf4..4f2b9d7 100644 --- a/chrysemys/footprints/chocmini_with_diode.js +++ b/chrysemys/footprints/chocmini_with_diode.js @@ -40,11 +40,21 @@ module.exports = { (fp_line (start 7.25 6.75) (end 6.25 6.75) (layer Dwgs.User) (width 0.15)) (fp_line (start 7.25 6.75) (end 7.25 5.75) (layer Dwgs.User) (width 0.15)) - + ${''/* diode box marker */} (fp_line (start 2.8 -5.35) (end -2.8 -5.35) (layer Dwgs.User) (width 0.15)) (fp_line (start -2.8 -3.2) (end 2.8 -3.2) (layer Dwgs.User) (width 0.15)) (fp_line (start 2.8 -3.2) (end 2.8 -5.35) (layer Dwgs.User) (width 0.15)) (fp_line (start -2.8 -3.2) (end -2.8 -5.35) (layer Dwgs.User) (width 0.15)) + + ${''/* diode direction marker */} + (fp_line (start 0.35 -4.3) (end 0.35 -3.75) (layer "F.SilkS") (width 0.1)) + (fp_line (start -0.25 -3.9) (end -0.25 -4.7) (layer "F.SilkS") (width 0.1)) + (fp_line (start -0.25 -4.3) (end -0.75 -4.3) (layer "F.SilkS") (width 0.1)) + (fp_line (start 0.35 -4.3) (end 0.35 -4.85) (layer "F.SilkS") (width 0.1)) + (fp_line (start 0.75 -4.3) (end 0.35 -4.3) (layer "F.SilkS") (width 0.1)) + (fp_line (start 0.35 -4.3) (end -0.25 -3.9) (layer "F.SilkS") (width 0.1)) + (fp_line (start -0.25 -4.7) (end 0.35 -4.3) (layer "F.SilkS") (width 0.1)) + ${''/* middle shaft */} (fp_line (start 2.25 2.6) (end 5.8 2.6) (layer Edge.Cuts) (width 0.12)) diff --git a/chrysemys/footprints/m2_mounting_hole.js b/chrysemys/footprints/m2_mounting_hole.js new file mode 100644 index 0000000..6b14502 --- /dev/null +++ b/chrysemys/footprints/m2_mounting_hole.js @@ -0,0 +1,16 @@ +module.exports = { + body: p => ` + (module M2MountingHole + (layer "F.Cu") + + ${p.at /* parametric position */} + + (fp_text reference "HOLE1" (at 0 -3.2 22) (layer "F.SilkS") hide + (effects (font (size 1 1) (thickness 0.15)))) + (fp_text value "Val**" (at 0 0) (layer "F.SilkS") hide + (effects (font (size 1.27 1.27) (thickness 0.15)))) + (fp_circle (center 0 0) (end 2 0) (layer "F.CrtYd") (width 0.05) (fill none)) + (pad "1" thru_hole circle (at 0 0 22) (size 3.6 3.6) (drill 2.2) (layers *.Cu *.Mask)) + ) + ` +}