diff --git a/pcb/.gitignore b/pcb/.gitignore index 8cdd505..051ae0b 100644 --- a/pcb/.gitignore +++ b/pcb/.gitignore @@ -1,6 +1,7 @@ *_v*.*.sch *_v*.*.pcb *.pdf +*.png *~ \#*\# attribs @@ -13,4 +14,3 @@ notes.txt *.pcb.bak *.gbr *.cnc - diff --git a/pcb/Rakefile b/pcb/Rakefile index 2b30af7..032d31c 100644 --- a/pcb/Rakefile +++ b/pcb/Rakefile @@ -27,7 +27,7 @@ vpcb = "#{target}_v#{version}.#{pcb_rev.to_s.rjust(3,'0')}.pcb" # main tasks # ========== -task :default => [:version,:print,:notes] +task :default => [:version,:print,:notes,:photo] desc "set version in schematic and layout" task :version => [vsch,vpcb] @@ -63,6 +63,11 @@ task :verify => vsch do |t| puts "not all refdes numbered" unless numbered end +desc "render layout" +task :photo => ["#{target}_layout-top.png","#{target}_layout-bottom.png"] +CLOBBER.include("#{target}_layout-top.png") +CLOBBER.include("#{target}_layout-bottom.png") + # ================ # helper functions # ================ @@ -148,3 +153,11 @@ file "notes.txt" => vsch do |t| end end end + +file "#{target}_layout-top.png" => vpcb do |t| + sh "pcb -x png --dpi 600 --format PNG --photo-mode --outfile #{target}_layout-top.png #{t.prerequisites.join(' ')}" +end + +file "#{target}_layout-top.png" => vpcb do |t| + sh "pcb -x png --dpi 600 --format PNG --photo-mode --photo-flip-x --outfile #{target}_layout-bottom.png #{t.prerequisites.join(' ')}" +end