4 # Copyright 2006 DJ Delorie <dj@delorie.com>
5 # Released under the terms of the GNU General Public License, version 2
8 print "Usage: pcb2panel board1.pcb board2.pcb board3.pcb > boards.pcb";
9 print "Then edit boards.pcb, putting each outline where you want it\n";
10 print "and sizing the board. Then:\n";
11 print "panel2pcb boards.pcb\n";
12 print "and edit/print boards.panel.pcb\n";
22 require "$mydir/panel.pl";
28 if (/PCB\[.* (\d+) (\d+)\]/) {
32 if (/Element\[\"[^\"]*\" \"([^\"]*)\" \"([^\"]*)\" \"([^\"]*)\" (\d+) (\d+)/) {
41 if (/Pin\[([\d-]+) ([\d-]+) \d+ \d+ \d+ \d+ \"(\d)\"/) {
46 if ($pinx{'1'} < $pinx{'2'}) {
48 } elsif ($pinx{'1'} > $pinx{'2'}) {
50 } elsif ($piny{'1'} < $piny{'2'}) {
52 } elsif ($piny{'1'} > $piny{'2'}) {
55 push (@paste, "$pcb\0$rot\0$mx\0$my");
59 push (@panelvias, $_);
61 if (/^Layer\([^)]*\)$/) {
62 $junk = <P>; # The opening '('
64 last if $junk =~ /^\)/;
65 push (@panelcopper, $junk);
70 $tmp = "/tmp/panel$$.pcb";
76 &baseboard($start, $panel_width, $panel_height, $panel);
79 for $paste (sort @paste) {
80 ($pcb, $rot, $mx, $my) = split(/\0/, $paste);
81 if ($lastboard ne $pcb) {
86 while ($lastrot != $rot) {
87 print PS "PasteBuffer(Rotate,1)\n";
88 $lastrot = ($lastrot+1) % 4;
90 print PS "PasteBuffer(ToLayout,$mx,$my)\n";