Root/atusb/cam/pcb.pl

Source at commit b493f093636595a76b3d1be612df018fa77c7474 created 9 years 1 month ago.
By Werner Almesberger, Great renaming: atrf/wpan-atrf* becomes atusb/atusb*
1#!/usr/bin/perl
2
3$d = 2.54/1000*12;
4$r = $d/2+0.1;
5
6
7sub orig
8{
9    $x0 = $_[0];
10    $y0 = $_[1];
11}
12
13
14sub mil
15{
16    return $_[0]/1000*25.4;
17}
18
19
20sub cut
21{
22    if (defined $x) {
23    if ($x == $_[0]+$x0 && $y == $_[1]+$y0) {
24        shift @_;
25        shift @_;
26    } else {
27        print "\n";
28    }
29    }
30    while (@_) {
31    $x = shift @_;
32    $y = shift @_;
33    ($x, $y) = (-$y, $x);
34    $x += $x0;
35    $y += $y0;
36    print "$x $y $z\n";
37    }
38}
39
40
41sub one
42{
43    &cut(
44      &mil( 0)-$r, &mil( 0)-$r,
45      &mil( 0)-$r, &mil(620)+$r,
46      &mil( 810)+$r, &mil(620)+$r,
47      &mil( 850) , &mil(580)+$r,
48      &mil( 890)-$r, &mil(620)+$r,
49      &mil(1300)+$r, &mil(620)+$r,
50      &mil(1490)+$r, &mil(430)+$r,
51      &mil(1630)+$r, &mil(430)+$r,
52      &mil(1630)+$r, &mil(360)+$r,
53      &mil(1850)-$r, &mil(360)+$r,
54      &mil(1850)-$r, &mil(430)+$r,
55      &mil(2150)+$r, &mil(430)+$r,
56      &mil(2150)+$r, &mil(-70)-$r,
57      &mil( 890)-$r, &mil(-70)-$r,
58      &mil( 890)-$r, &mil( 0)-$r,
59      &mil( 850) , &mil( 40)-$r,
60      &mil( 810)+$r, &mil( 0)-$r,
61      &mil( 0)-$r, &mil( 0)-$r);
62}
63
64
65$z = -0.8;
66# x: corner offset, compensation for rotation, array position
67# y: corner offet
68&orig(5+16+22*3, 5)
69&one;
70

Archive Download this file



interactive