add custom footprint for capacitor

This commit is contained in:
King Kévin 2014-04-23 22:50:23 -07:00
parent a7943b9376
commit 9ec3d115ac
5 changed files with 102 additions and 1 deletions

View File

@ -0,0 +1,56 @@
#!/usr/bin/env ruby
# encoding: utf-8
# written for ruby 2.1.0
# generate a footprint (see script for more information)
require_relative 'element'
# global dimensions
UNIT = "mm"
SILKSCREEN = 0.2
SOLDERMASK = 0.1
# class properties, for radial leads and perpendicular parts
classes = []
classes << {:class => "least", :hole => 0.15, :ring => 0.3, :clearance => 0.5}
classes << {:class => "nominal", :hole => 0.2, :ring => 0.35, :clearance => 0.7}
classes << {:class => "maximum", :hole => 0.25, :ring => 0.5, :clearance => 1.0}
# size code dimensions
D = 6.3
p = 2.5
d = 0.5
classes.each do |cla|
base = File.basename(__FILE__,".rb")
name = "#{base}_#{cla[:class][0,1].upcase}.fp"
File.open(name,"w") do |fp|
# put some information
fp.puts "# footprint for an aluminum electronlytic capacitor"
fp.puts "# manufacturer: Kemet"
fp.puts "# series: ESK"
fp.puts "# size code: E3"
fp.puts "# datasheet: http://www.kemet.com/docfinder?Partnumber=ESK477M6R3AE3AA"
fp.puts "# class: #{cla[:class]}"
# define element
# center is pin 3
fp.puts element("Element",["","capacitor","","Kemet ESK E3 #{cla[:class]}",:"0",:"0",:"0",:"0",:"0",:"100",""])
fp.puts "("
# outline
#ElementArc [X Y Width Height StartAngle DeltaAngle Thickness]
fp.puts element("ElementArc",[0,0,D/2,D/2,:"0",:"360",SILKSCREEN])
#ElementLine [X1 Y1 X2 Y2 Thickness]
fp.puts element("ElementLine",[-D/2-1,0,-D/2-0.5,0,SILKSCREEN])
fp.puts element("ElementLine",[-D/2-0.75,-0.25,-D/2-0.75,0.25,SILKSCREEN])
fp.puts element("ElementLine",[D/2+1,0,D/2+0.5,0,SILKSCREEN])
# pins
# Pin [rX rY Thickness Clearance Mask Drill "Name" "Number" SFlags]
fp.puts element("Pin",[-p/2,0,d+cla[:hole]+cla[:ring],d+cla[:hole]+cla[:clearance],d+cla[:hole]+cla[:ring]+SOLDERMASK,d+cla[:hole],"+","1","square"])
fp.puts element("Pin",[p/2,0,d+cla[:hole]+cla[:ring],d+cla[:hole]+cla[:clearance],d+cla[:hole]+cla[:ring]+SOLDERMASK,d+cla[:hole],"-","2",""])
# end of element
fp.puts ")"
end
end

View File

@ -0,0 +1,15 @@
# footprint for an aluminum electronlytic capacitor
# manufacturer: Kemet
# series: ESK
# size code: E3
# datasheet: http://www.kemet.com/docfinder?Partnumber=ESK477M6R3AE3AA
# class: least
Element["" "capacitor" "" "Kemet ESK E3 least" 0 0 0 0 0 100 ""]
(
ElementArc[0.0mm 0.0mm 3.15mm 3.15mm 0 360 0.2mm]
ElementLine[-4.15mm 0.0mm -3.65mm 0.0mm 0.2mm]
ElementLine[-3.9mm -0.25mm -3.9mm 0.25mm 0.2mm]
ElementLine[4.15mm 0.0mm 3.65mm 0.0mm 0.2mm]
Pin[-1.25mm 0.0mm 0.95mm 1.15mm 1.05mm 0.65mm "+" "1" "square"]
Pin[1.25mm 0.0mm 0.95mm 1.15mm 1.05mm 0.65mm "-" "2" ""]
)

View File

@ -0,0 +1,15 @@
# footprint for an aluminum electronlytic capacitor
# manufacturer: Kemet
# series: ESK
# size code: E3
# datasheet: http://www.kemet.com/docfinder?Partnumber=ESK477M6R3AE3AA
# class: maximum
Element["" "capacitor" "" "Kemet ESK E3 maximum" 0 0 0 0 0 100 ""]
(
ElementArc[0.0mm 0.0mm 3.15mm 3.15mm 0 360 0.2mm]
ElementLine[-4.15mm 0.0mm -3.65mm 0.0mm 0.2mm]
ElementLine[-3.9mm -0.25mm -3.9mm 0.25mm 0.2mm]
ElementLine[4.15mm 0.0mm 3.65mm 0.0mm 0.2mm]
Pin[-1.25mm 0.0mm 1.25mm 1.75mm 1.35mm 0.75mm "+" "1" "square"]
Pin[1.25mm 0.0mm 1.25mm 1.75mm 1.35mm 0.75mm "-" "2" ""]
)

View File

@ -0,0 +1,15 @@
# footprint for an aluminum electronlytic capacitor
# manufacturer: Kemet
# series: ESK
# size code: E3
# datasheet: http://www.kemet.com/docfinder?Partnumber=ESK477M6R3AE3AA
# class: nominal
Element["" "capacitor" "" "Kemet ESK E3 nominal" 0 0 0 0 0 100 ""]
(
ElementArc[0.0mm 0.0mm 3.15mm 3.15mm 0 360 0.2mm]
ElementLine[-4.15mm 0.0mm -3.65mm 0.0mm 0.2mm]
ElementLine[-3.9mm -0.25mm -3.9mm 0.25mm 0.2mm]
ElementLine[4.15mm 0.0mm 3.65mm 0.0mm 0.2mm]
Pin[-1.25mm 0.0mm 1.05mm 1.4mm 1.15mm 0.7mm "+" "1" "square"]
Pin[1.25mm 0.0mm 1.05mm 1.4mm 1.15mm 0.7mm "-" "2" ""]
)

View File

@ -46,7 +46,7 @@ datasheet=http://www.kemet.com/docfinder?Partnumber=ESK477M6R3AE3AA
T 0 1900 8 10 0 0 0 0 1
farnell-id=2068936
T 0 2500 8 10 0 0 0 0 1
footprint=RCY250P
footprint=capacitor_470uF-electrolytic_kemet_ESK-E3_N.fp
T 0 2100 8 10 0 0 0 0 1
digikey-id=399-6611-ND
T 0 2300 8 10 0 0 0 0 1