1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-12-11 12:04:04 +02:00
ben-wpan/ants/cam/pcb.pl

77 lines
945 B
Perl
Raw Normal View History

#!/usr/bin/perl
$PI = atan2(1, 1)*4;
$d = 25.4/1000*35;
sub orig
{
$x0 = $_[0];
$y0 = $_[1];
}
sub mil
{
return $_[0]/1000*25.4;
}
sub cut
{
if (defined $x) {
if ($x == $_[0]+$x0 && $y == $_[1]+$y0) {
shift @_;
shift @_;
} else {
print "\n";
}
}
while (@_) {
$x = shift @_;
$y = shift @_;
# ($x, $y) = (-$y, $x);
$x += $x0;
$y += $y0;
print "$x $y $z\n";
}
}
sub pcb
{
&cut(
&mil( 0), &mil( 0),
&mil( $W), &mil( 0),
&mil( $W), &mil( 490),
&mil( 0), &mil( 490),
&mil( 0), &mil( 0));
}
#
# board width
#
# antenna factor width (mil)
#
# 80% 530
# 90% 565
# 100% 605
# 105% 620
# 110% 640
# 115% 658
# 120% 680
#
$W = 658;
$z = -0.8; # full thickness of board
# x: corner offset, compensation for rotation, array position
# y: corner offet
&orig(20*0+2, 15*3+2);
$r = $d/2-0.1; # compensate deflection of board
&pcb;