1
0
mirror of git://projects.qi-hardware.com/f32xbase.git synced 2024-12-02 22:35:19 +02:00
f32xbase/c2usb/cam/pcb.pl

61 lines
888 B
Perl
Raw Normal View History

#!/usr/bin/perl
$d = 25.4/1000*35;
$r = $d/2;
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 one
{
&cut(
&mil( 0)-$r, &mil( 0)-$r,
&mil( 0)-$r, &mil( 460),
&mil( -50)-$r, &mil( 510),
&mil( -50)-$r, &mil(1070)+$r,
&mil( 520)+$r, &mil(1070)+$r,
&mil( 520)+$r, &mil( 510),
&mil( 470)+$r, &mil( 460),
&mil( 470)+$r, &mil( 0)-$r,
&mil( 0)-$r, &mil( 0)-$r);
}
$z = -1.6; # full thickness of board
# x: corner offset, compensation for rotation, array position
# y: corner offet
&orig(1+1+17*1, 1)
&one;