1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-29 10:01:53 +02:00

Make toolpath cameo-friendly and use cameo for tool size compensation.

- cntr/cam/doit: use cameo
- cntr/cam/pcb.pl (cut): use exact value of pi, to make sure arcs meet
  with lines connecting to them
- cntr/cam/pcb.pl (hhole): force cut to be continuous
- cntr/cam/pcb.pl (arc, hhole, pcb): don't compensate for the tool size.
  Cameo now does this for us.
- cntr/cam/pcb.pl: switch to 2nd piece position
This commit is contained in:
Werner Almesberger 2010-11-01 20:14:43 -03:00
parent 1702234db6
commit 9103ae0aec
2 changed files with 18 additions and 13 deletions

View File

@ -4,6 +4,7 @@ RECT=$DIR/rect/rect
ALIGN=$DIR/align/align ALIGN=$DIR/align/align
ZMAP=$DIR/zmap/zmap ZMAP=$DIR/zmap/zmap
GP2RML=$DIR/gp2rml/gp2rml GP2RML=$DIR/gp2rml/gp2rml
CAMEO=../../../cae-tools/cameo/cameo
GEN=${1:-./pcb.pl} GEN=${1:-./pcb.pl}
@ -16,6 +17,7 @@ rect=`$RECT $rdata | awk '{$3 = ""; print}'`
$GEN | $GEN |
awk '{ if ($3 != "") $3 += '$Z'; print $0; }' | awk '{ if ($3 != "") $3 += '$Z'; print $0; }' |
$CAMEO -d 0.4445 |
$ALIGN 0 1 $rect | $ALIGN 0 1 $rect |
# angle, reference (lower left corner), rect # angle, reference (lower left corner), rect
$GP2RML 2 0.5 0.5 $GP2RML 2 0.5 0.5

View File

@ -1,5 +1,7 @@
#!/usr/bin/perl #!/usr/bin/perl
$PI = atan2(1, 1)*4;
$d = 25.4/1000*35; $d = 25.4/1000*35;
$r = $d/2-0.1; # compensate deflection of board $r = $d/2-0.1; # compensate deflection of board
$steps = 24; $steps = 24;
@ -44,12 +46,12 @@ sub cut
sub arc sub arc
{ {
local ($xc, $yc, $d, $a0, $a1) = @_; local ($xc, $yc, $d, $a0, $a1) = @_;
local ($rr) = $d/2-$r; local ($rr) = $d/2;
local $n = int(abs($a1-$a0)/360*$steps+0.5); local $n = int(abs($a1-$a0)/360*$steps+0.5);
$rr = 0 if $rr < 0; $rr = 0 if $rr < 0;
for ($i = 0; $i <= $n; $i++) { for ($i = 0; $i <= $n; $i++) {
my $a = ($a0+($a1-$a0)/$n*$i)*3.1415926/180; my $a = ($a0+($a1-$a0)/$n*$i)*$PI/180;
$x = $x0+$xc-$rr*sin($a); $x = $x0+$xc-$rr*sin($a);
$y = $y0+$yc+$rr*cos($a); $y = $y0+$yc+$rr*cos($a);
print "$x $y $z\n"; print "$x $y $z\n";
@ -70,10 +72,11 @@ sub circ
sub hhole sub hhole
{ {
local ($xc0, $xc1, $yc, $d) = @_; local ($xc0, $xc1, $yc, $d) = @_;
local ($rr) = $d/2-$r; local ($rr) = $d/2;
&cut($xc0, $yc+$rr, $xc1, $yc+$rr); &cut($xc0, $yc+$rr, $xc1, $yc+$rr);
&arc($xc1, $yc, $d, 0, -180); &arc($xc1, $yc, $d, 0, -180);
undef $x;
&cut($xc1, $yc-$rr, $xc0, $yc-$rr); &cut($xc1, $yc-$rr, $xc0, $yc-$rr);
&arc($xc0, $yc, $d, 180, 0); &arc($xc0, $yc, $d, 180, 0);
} }
@ -82,15 +85,15 @@ sub hhole
sub pcb sub pcb
{ {
&cut( &cut(
&mil( 0)-$r, &mil( 0)-$r, &mil( 0), &mil( 0),
&mil(1180)+$r, &mil( 0)-$r, &mil(1180), &mil( 0),
&mil(1180)+$r, &mil( 240)+$r, &mil(1180), &mil( 240),
&mil(1000)+$r, &mil( 240)+$r, &mil(1000), &mil( 240),
&mil(1000)+$r, &mil( 380)-$r, &mil(1000), &mil( 380),
&mil(1180)+$r, &mil( 380)-$r, &mil(1180), &mil( 380),
&mil(1180)+$r, &mil( 620)+$r, &mil(1180), &mil( 620),
&mil( 0)-$r, &mil( 620)+$r, &mil( 0), &mil( 620),
&mil( 0)-$r, &mil( 0)-$r); &mil( 0), &mil( 0));
} }
@ -111,7 +114,7 @@ $z = -0.8; # full thickness of board
# x: corner offset, compensation for rotation, array position # x: corner offset, compensation for rotation, array position
# y: corner offet # y: corner offet
&orig(35*0, 45); &orig(35*1, 45);
$r = $d/2; # no compensation. don't wanna risk making holes too big. $r = $d/2; # no compensation. don't wanna risk making holes too big.
&holes; &holes;