1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-12-28 19:44:35 +02:00
ben-wpan/ants/cam/pcb.pl
Werner Almesberger 04972bb2f6 ants/cam: update for latest workpiece
- ants/cam/doit: coordinates for new workpiece
- ants/cam/pcb.pl: new margins (specific to workpiece)
- ants/cam/pcb.pl: changed width and slot (specific to board being cut)
2010-12-01 10:44:17 -03:00

77 lines
945 B
Perl
Executable File

#!/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;