C8051F32x firmware infrastructure

Sign in or create your account | Project List | Help

C8051F32x firmware infrastructure Git Source Tree

Root/c2usb/cam/pcb.pl

1#!/usr/bin/perl
2
3$d = 25.4/1000*35;
4$r = $d/2;
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( 460),
46      &mil( -50)-$r, &mil( 510),
47      &mil( -50)-$r, &mil(1070)+$r,
48      &mil( 520)+$r, &mil(1070)+$r,
49      &mil( 520)+$r, &mil( 510),
50      &mil( 470)+$r, &mil( 460),
51      &mil( 470)+$r, &mil( 0)-$r,
52      &mil( 0)-$r, &mil( 0)-$r);
53}
54
55
56$z = -1.6; # full thickness of board
57# x: corner offset, compensation for rotation, array position
58# y: corner offet
59&orig(1+1+17*1, 1)
60&one;
61

Archive Download this file

Branches:
master



interactive