Root/doit

1#!/bin/sh -e
2#
3# doit - Generate RML-1 job from gnuplot toolpath
4#
5
6DIR=/home/moko/svn.openmoko.org/developers/werner/cncmap
7G2GP=$DIR/g2gp/g2gp
8RECT=$DIR/rect/rect
9ALIGN=$DIR/align/align
10ZMAP=$DIR/zmap/zmap
11GP2RML=$DIR/gp2rml/gp2rml
12
13# 1st mold. 1/2"x2" pine. Did't have space for the battery cover's tongue.
14rdata="10.50 8.40 -33.40 138.30 8.00 -34.00 10.50 50.10 -33.40"
15rdata="14.50 5.90 -33.40 138.30 5.50 -34.00 14.50 50.10 -33.40"
16Z=-34
17
18# 2nd mold. 1/2"x2" pine. Six air outlets.
19# correction: x+2.5, y-3, z-0.2
20rdata="11.8 10 -33.9 137 10 -33.6 11.8 51.5 -33.6"
21rdata="14.3 7 -33.9 137 7 -33.6 14.3 51.5 -33.6"
22Z=-33.8
23
24# 3nd mold. 1/2"x2" pine. Seven air outlets.
25# correction x+2.5, y-2, z-0.2; z is very uneven
26rdata="12.1 8.1 -33.2 139.4 8.1 -33.3 12.1 50.2 -33.9"
27rdata="15.6 6.1 -33.2 139.4 6.1 -33.3 15.6 50.2 -33.9"
28Z=-33.5
29
30# 4th mold. 1"x3" pine. (Shop changed wood sizes. 1/2"x2" is now too small.)
31# correction: x+3.5, y-1.5, z-0.0
32# rotation: compensate for piece misalignment, y0 is 1 mm larger than y1
33rdata="11.8 8.5 -23.4 11.8 73.3 -23.5 137.3 8.5 -23.2"
34rdata="15.3 7.0 -23.4 15.8 73.3 -23.5 137.3 6.0 -23.2"
35Z=-23.5
36
37# cast*.g is HeeksCAD's NC output.
38
39rect=`$RECT $rdata | awk '{$3 = ""; print}'`
40
41$G2GP cast4.g |
42  awk '{ if ($3 != "") $3 += '$Z'; print $0; }' |
43  $ALIGN 0 1 $rect |
44    # angle, reference (lower left), rect
45  $GP2RML 20 5 5
46    # clearance, xy speed, z speed
47

Archive Download this file

Branches:
master



interactive