mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2024-11-15 08:34:05 +02:00
bacon/case/: various bits and pieces for parametrization and correct positioning
This commit is contained in:
parent
b54f4a52e2
commit
3e39ae0d66
@ -4,12 +4,18 @@ SPOOL = $(CAE_TOOLS)/spool/spool
|
||||
CNGT = $(CAE_TOOLS)/cngt/cngt
|
||||
GP2RML = $(CAE_TOOLS)/gp2rml/gp2rml
|
||||
|
||||
X0 = 5
|
||||
Y0 = 5
|
||||
Z1 = -44
|
||||
PIECE = -5 -5 30 55
|
||||
PIECE_Z = 5.5
|
||||
Z_STEP = 2
|
||||
CLEARANCE = 5
|
||||
SPEED_XY = 1
|
||||
SPEED_Z = 1
|
||||
OVERSHOOT = 0.2
|
||||
|
||||
PARAMS = X0=$(X0)mm Y0=$(Y0)mm Z1=$(Z1)mm PIECE_Z=$(PIECE_Z)mm
|
||||
|
||||
.PHONY: all plot mill pos cng clean
|
||||
|
||||
@ -19,19 +25,21 @@ case.gp:
|
||||
fped -g case.fpd || { rm -f $@; exit 1; }
|
||||
|
||||
top.gp: case.gp
|
||||
$(CAMEO)/fped2d2z.pl top $^ >$@ || { rm -f $@; exit 1; }
|
||||
|
||||
top-piece.gp: top.gp
|
||||
./genpiece.pl $(PIECE) $< >$@ || { rm -f $@; exit 1; }
|
||||
|
||||
top-area.gp: top-piece.gp top.gp
|
||||
$(CAMEO)/cameo top.cam || { rm -f $@; exit 1; }
|
||||
|
||||
mill.gp: top-area.gp
|
||||
$(CAMEO)/zstack.pl -r $(PIECE_Z) $(Z_STEP) $< >$@ || \
|
||||
$(CAMEO)/fped2d2z.pl -r 0=-$(OVERSHOOT) top $^ >$@ || \
|
||||
{ rm -f $@; exit 1; }
|
||||
|
||||
mill.rml: mill.gp
|
||||
top-piece.gp: top.gp
|
||||
./genpiece.pl -r $(PIECE) $< >$@ || { rm -f $@; exit 1; }
|
||||
|
||||
top-area.gp: top-piece.gp top.gp cam.sh Makefile
|
||||
./cam.sh PART=top CAMEO=$(CAMEO)/cameo $(PARAMS) >$@ || \
|
||||
{ rm -f $@; exit 1; }
|
||||
|
||||
mill.gp: top-area.gp Makefile
|
||||
$(CAMEO)/zstack.pl $(Z1) $(Z_STEP) $< >$@ || \
|
||||
{ rm -f $@; exit 1; }
|
||||
|
||||
mill.rml: mill.gp Makefile
|
||||
$(GP2RML) $(CLEARANCE) $(SPEED_XY) $(SPEED_Z) $< >$@ || \
|
||||
{ rm -f $@; exit 1; }
|
||||
|
||||
|
25
bacon/case/cam.sh
Executable file
25
bacon/case/cam.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
while [ "$1" ]; do
|
||||
eval "$1"
|
||||
shift
|
||||
done
|
||||
|
||||
: ${MILL:=125mil}
|
||||
: ${OVERLAP:=0.3mm}
|
||||
: ${X0:=0mm}
|
||||
: ${Y0:=0mm}
|
||||
: ${Z1:=0mm}
|
||||
: ${PIECE_Z:=0mm}
|
||||
: ${CAMEO:=cameo}
|
||||
|
||||
echo Z1 is $Z1 1>&2
|
||||
|
||||
$CAMEO <<EOF
|
||||
gnuplot $MILL $PART-piece.gp
|
||||
gnuplot $MILL $PART.gp
|
||||
align 1 $X0 $Y0
|
||||
z 0 ${Z1}
|
||||
z -${PIECE_Z}
|
||||
area $OVERLAP
|
||||
write $PART-area.gp
|
||||
EOF
|
@ -1,5 +1,10 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
if ($ARGV[0] eq "-r") {
|
||||
shift @ARGV;
|
||||
$reverse = 1;
|
||||
}
|
||||
|
||||
$x0 = shift @ARGV;
|
||||
$y0 = shift @ARGV;
|
||||
$x1 = shift @ARGV;
|
||||
@ -7,6 +12,12 @@ $y1 = shift @ARGV;
|
||||
|
||||
while (<>) {
|
||||
$z{$1} = 1 if /\s+(-?\d+(\.\d*)?)\s*$/;
|
||||
$zmax = $1 if $1 > $zmax || !defined $zmax;
|
||||
}
|
||||
|
||||
if ($reverse) {
|
||||
($x0, $y0) = ($y0, $x0);
|
||||
($x1, $y1) = ($y1, $x1);
|
||||
}
|
||||
|
||||
for (keys %z) {
|
||||
|
@ -1,4 +0,0 @@
|
||||
gnuplot 125mil top-piece.gp
|
||||
gnuplot 125mil top.gp
|
||||
area 0.3mm
|
||||
write top-area.gp
|
Loading…
Reference in New Issue
Block a user