4 # Copyright 2006 DJ Delorie <dj@delorie.com>
5 # Released under the terms of the GNU General Public License, version 2
8 my ($file, $width, $height, $nbase) = @_;
16 $pscript = "$base.pscript";
17 open(PS, ">$pscript");
18 push(@files_to_remove, "$base.pscript");
20 open(S, $file) || die("$file: $!");
21 $outname = "$base.panel.pcb";
22 $outname =~ s/pnl\.panel\.pcb/pcb/;
25 if (/PCB\[.* (\d+) (\d+)\]/) {
26 s/ (\d+) (\d+)\]/ $width $height\]/;
28 s/Cursor\[.*\]/Cursor[0 0 0.0]/;
29 next if /\b(Via|Pin|Pad|ElementLine|Line|Arc|ElementArc|Text)/;
30 if (/Polygon|Element/) {
51 print PS "LoadFrom(Layout,$outname)\n";
61 open(O, ">temp-panel.$seq");
63 if (/PCB\[.* (\d+) (\d+)\]/) {
67 s/Cursor\[.*\]/Cursor[0 0 0.0]/;
72 print PS "LoadFrom(LayoutToBuffer,temp-panel.$seq)\n";
73 push(@files_to_remove, "temp-panel.$seq");
79 print PS "PasteBuffer(ToLayout,$ox,$oy)\n";
85 print PS "PasteBuffer(ToLayout,$vx,$vy)\n";
90 print PS "SaveTo(LayoutAs,$outname)\n";
95 system "set -x; pcb --action-script $pscript";
96 #system "pcb -x ps $base.panel.pcb";
97 #unlink @files_to_remove;