mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-27 03:32:49 +02:00
61 lines
792 B
Perl
61 lines
792 B
Perl
|
#!/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( 680), &mil( 0),
|
||
|
&mil( 680), &mil( 490),
|
||
|
&mil( 0), &mil( 490),
|
||
|
&mil( 0), &mil( 0));
|
||
|
}
|
||
|
|
||
|
|
||
|
$z = -0.8; # full thickness of board
|
||
|
# x: corner offset, compensation for rotation, array position
|
||
|
# y: corner offet
|
||
|
|
||
|
&orig(20*0+3, 15*2+23);
|
||
|
|
||
|
$r = $d/2-0.1; # compensate deflection of board
|
||
|
&pcb;
|