Root/ants/cam/pcb.pl

Source at commit 04972bb2f65b1fc70a25b2f1fac96d65c9f0f726 created 8 years 11 months ago.
By Werner Almesberger, ants/cam: update for latest workpiece
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( $W), &mil( 0),
47      &mil( $W), &mil( 490),
48      &mil( 0), &mil( 490),
49      &mil( 0), &mil( 0));
50}
51
52
53#
54# board width
55#
56# antenna factor width (mil)
57#
58# 80% 530
59# 90% 565
60# 100% 605
61# 105% 620
62# 110% 640
63# 115% 658
64# 120% 680
65#
66
67$W = 658;
68
69$z = -0.8; # full thickness of board
70# x: corner offset, compensation for rotation, array position
71# y: corner offet
72
73&orig(20*0+2, 15*3+2);
74
75$r = $d/2-0.1; # compensate deflection of board
76&pcb;
77

Archive Download this file



interactive