Date:2010-09-12 17:37:40 (9 years 3 months ago)
Author:Werner Almesberger
Commit:f8ae351347fc05dca712b2d680997f6f99df3ae1
Message:Moved cam/ to atrf/cam/

Files: atrf/cam/Makefile (1 diff)
atrf/cam/doit (1 diff)
atrf/cam/pcb.pl (1 diff)
cam/Makefile (1 diff)
cam/doit (1 diff)
cam/pcb.pl (1 diff)

Change Details

atrf/cam/Makefile
1.PHONY: pcb
2
3pcb:
4        ./doit >job
atrf/cam/doit
1#!/bin/sh -e
2DIR=/home/moko/svn.openmoko.org/developers/werner/cncmap
3RECT=$DIR/rect/rect
4ALIGN=$DIR/align/align
5ZMAP=$DIR/zmap/zmap
6GP2RML=$DIR/gp2rml/gp2rml
7
8GEN=${1:-./pcb.pl}
9
10rdata="12.10 8.90 -55.90 12.30 81.50 -55.80 111.70 11.30 -55.60"
11# we need quite a large Z adjustment due to the table's vertical flexibility
12Z=-56.30
13
14rect=`$RECT $rdata | awk '{$3 = ""; print}'`
15
16$GEN |
17  awk '{ if ($3 != "") $3 += '$Z'; print $0; }' |
18  $ALIGN 0 1 $rect |
19    # angle, reference (lower left corner), rect
20  $GP2RML 1.5 0.1 0.1
21    # clearance, xy speed, z speed
atrf/cam/pcb.pl
1#!/usr/bin/perl
2
3$d = 2.54/1000*12;
4$r = $d/2+0.1;
5
6
7sub orig
8{
9    $x0 = $_[0];
10    $y0 = $_[1];
11}
12
13
14sub mil
15{
16    return $_[0]/1000*25.4;
17}
18
19
20sub cut
21{
22    if (defined $x) {
23    if ($x == $_[0]+$x0 && $y == $_[1]+$y0) {
24        shift @_;
25        shift @_;
26    } else {
27        print "\n";
28    }
29    }
30    while (@_) {
31    $x = shift @_;
32    $y = shift @_;
33    ($x, $y) = (-$y, $x);
34    $x += $x0;
35    $y += $y0;
36    print "$x $y $z\n";
37    }
38}
39
40
41sub one
42{
43    &cut(
44      &mil( 0)-$r, &mil( 0)-$r,
45      &mil( 0)-$r, &mil(620)+$r,
46      &mil( 810)+$r, &mil(620)+$r,
47      &mil( 850) , &mil(580)+$r,
48      &mil( 890)-$r, &mil(620)+$r,
49      &mil(1300)+$r, &mil(620)+$r,
50      &mil(1490)+$r, &mil(430)+$r,
51      &mil(1630)+$r, &mil(430)+$r,
52      &mil(1630)+$r, &mil(360)+$r,
53      &mil(1850)-$r, &mil(360)+$r,
54      &mil(1850)-$r, &mil(430)+$r,
55      &mil(2150)+$r, &mil(430)+$r,
56      &mil(2150)+$r, &mil(-70)-$r,
57      &mil( 890)-$r, &mil(-70)-$r,
58      &mil( 890)-$r, &mil( 0)-$r,
59      &mil( 850) , &mil( 40)-$r,
60      &mil( 810)+$r, &mil( 0)-$r,
61      &mil( 0)-$r, &mil( 0)-$r);
62}
63
64
65$z = -0.8;
66# x: corner offset, compensation for rotation, array position
67# y: corner offet
68&orig(5+16+22*3, 5)
69&one;
cam/Makefile
1.PHONY: pcb
2
3pcb:
4        ./doit >job
cam/doit
1#!/bin/sh -e
2DIR=/home/moko/svn.openmoko.org/developers/werner/cncmap
3RECT=$DIR/rect/rect
4ALIGN=$DIR/align/align
5ZMAP=$DIR/zmap/zmap
6GP2RML=$DIR/gp2rml/gp2rml
7
8GEN=${1:-./pcb.pl}
9
10rdata="12.10 8.90 -55.90 12.30 81.50 -55.80 111.70 11.30 -55.60"
11# we need quite a large Z adjustment due to the table's vertical flexibility
12Z=-56.30
13
14rect=`$RECT $rdata | awk '{$3 = ""; print}'`
15
16$GEN |
17  awk '{ if ($3 != "") $3 += '$Z'; print $0; }' |
18  $ALIGN 0 1 $rect |
19    # angle, reference (lower left corner), rect
20  $GP2RML 1.5 0.1 0.1
21    # clearance, xy speed, z speed
cam/pcb.pl
1#!/usr/bin/perl
2
3$d = 2.54/1000*12;
4$r = $d/2+0.1;
5
6
7sub orig
8{
9    $x0 = $_[0];
10    $y0 = $_[1];
11}
12
13
14sub mil
15{
16    return $_[0]/1000*25.4;
17}
18
19
20sub cut
21{
22    if (defined $x) {
23    if ($x == $_[0]+$x0 && $y == $_[1]+$y0) {
24        shift @_;
25        shift @_;
26    } else {
27        print "\n";
28    }
29    }
30    while (@_) {
31    $x = shift @_;
32    $y = shift @_;
33    ($x, $y) = (-$y, $x);
34    $x += $x0;
35    $y += $y0;
36    print "$x $y $z\n";
37    }
38}
39
40
41sub one
42{
43    &cut(
44      &mil( 0)-$r, &mil( 0)-$r,
45      &mil( 0)-$r, &mil(620)+$r,
46      &mil( 810)+$r, &mil(620)+$r,
47      &mil( 850) , &mil(580)+$r,
48      &mil( 890)-$r, &mil(620)+$r,
49      &mil(1300)+$r, &mil(620)+$r,
50      &mil(1490)+$r, &mil(430)+$r,
51      &mil(1630)+$r, &mil(430)+$r,
52      &mil(1630)+$r, &mil(360)+$r,
53      &mil(1850)-$r, &mil(360)+$r,
54      &mil(1850)-$r, &mil(430)+$r,
55      &mil(2150)+$r, &mil(430)+$r,
56      &mil(2150)+$r, &mil(-70)-$r,
57      &mil( 890)-$r, &mil(-70)-$r,
58      &mil( 890)-$r, &mil( 0)-$r,
59      &mil( 850) , &mil( 40)-$r,
60      &mil( 810)+$r, &mil( 0)-$r,
61      &mil( 0)-$r, &mil( 0)-$r);
62}
63
64
65$z = -0.8;
66# x: corner offset, compensation for rotation, array position
67# y: corner offet
68&orig(5+16+22*3, 5)
69&one;

Archive Download the corresponding diff file



interactive