369f5a42ddfd63dfbea37058a5e0d7c3b66eefa0
Stefan Schuermans script to ensure minimum dr...

Stefan Schuermans authored 9 years ago

1) #! /usr/bin/perl
2) 
3) use strict;
4) use warnings;
5) 
6) if (@ARGV < 1) {
Stefan Schuermans minimum drill diameter scri...

Stefan Schuermans authored 9 years ago

7)   print ("usage: pcb_move.pl <new min drill> [<new min copper>]\n");
Stefan Schuermans script to ensure minimum dr...

Stefan Schuermans authored 9 years ago

8)   exit (1);
9) }
10) 
Stefan Schuermans minimum drill diameter scri...

Stefan Schuermans authored 9 years ago

11) my $mindrill = int($ARGV[0]);
12) my $mincopper = 0;
13) if (@ARGV >= 2) {
14)   $mincopper = int($ARGV[1]);
15) }
Stefan Schuermans script to ensure minimum dr...

Stefan Schuermans authored 9 years ago

16) 
17) my $line;
18) while ($line = <STDIN>) {
19)   chomp ($line);
20)   chomp ($line);
21) 
Stefan Schuermans minimum drill diameter scri...

Stefan Schuermans authored 9 years ago

22)   if ($line =~ /^([ \t]*(?:Via|Pin)[ \t]*\[(?:-?[0-9]+[ \t]+){2})([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)(.*)$/) {
23)     my $begin = $1;
24)     my $copper = int ($2);
25)     my $clearance = int ($3);
26)     my $solderstop = int ($4);
27)     my $drill = int ($5);
28)     my $end = $6;
29)     if ($copper < $mincopper) {
30)       if ($solderstop > $copper) {
31)         $solderstop += $mincopper - $copper;
32)       }
33)       $copper = $mincopper;
34)     }
35)     if ($drill < $mindrill) {
36)       $drill = $mindrill;
Stefan Schuermans script to ensure minimum dr...

Stefan Schuermans authored 9 years ago

37)     }
Stefan Schuermans minimum drill diameter scri...

Stefan Schuermans authored 9 years ago

38)     $line = "$begin$copper $clearance $solderstop $drill$end";