Root/ants/cam/pcb.pl

Source at commit 3f28b92c4fff20effa67c75c9fa01cb494ad8083 created 8 years 8 months ago.
By Werner Almesberger, CAM process for the antenna test boards.
1#!/usr/bin/perl
2
3$PI = atan2(1, 1)*4;
4
5$d = 25.4/1000*35;
6
7
8sub orig
9{
10    $x0 = $_[0];
11    $y0 = $_[1];
12}
13
14
15sub mil
16{
17    return $_[0]/1000*25.4;
18}
19
20
21sub cut
22{
23    if (defined $x) {
24    if ($x == $_[0]+$x0 && $y == $_[1]+$y0) {
25        shift @_;
26        shift @_;
27    } else {
28        print "\n";
29    }
30    }
31    while (@_) {
32    $x = shift @_;
33    $y = shift @_;
34# ($x, $y) = (-$y, $x);
35    $x += $x0;
36    $y += $y0;
37    print "$x $y $z\n";
38    }
39}
40
41
42sub pcb
43{
44    &cut(
45      &mil( 0), &mil( 0),
46      &mil( 680), &mil( 0),
47      &mil( 680), &mil( 490),
48      &mil( 0), &mil( 490),
49      &mil( 0), &mil( 0));
50}
51
52
53$z = -0.8; # full thickness of board
54# x: corner offset, compensation for rotation, array position
55# y: corner offet
56
57&orig(20*0+3, 15*2+23);
58
59$r = $d/2-0.1; # compensate deflection of board
60&pcb;
61

Archive Download this file



interactive