1
0
mirror of git://projects.qi-hardware.com/f32xbase.git synced 2024-11-16 22:55:56 +02:00
f32xbase/c2usb/cam/pcb.pl
Werner Almesberger b1d1fcc4ba c2usb/cam/pcb.pl: fix bogus tool parameters
Fixing it lest if gets copied and lives on elsewhere. Note that it may
still be necessary to add a small negative correction (in the order of
-0.1 mm) to compensate for deflection of the workpiece.

- c2usb/cam/pcb.pl ($d): there are 25.4 mm in an inch, not 2.54
- c2usb/cam/pcb.pl ($d): the endmill used has a diameter of 35 mil, not
  8 mil
- c2usb/cam/pcb.p ($r): don't apply correction for imagined mechanical
  issues (now what we're working with correct values)
2010-10-22 04:12:36 -03:00

61 lines
888 B
Perl
Executable File

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