From 033d55c8ad475e1282f0c5f198766c142ed07f34 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 6 Nov 2013 20:28:47 -0300 Subject: [PATCH] cameo/zstack.pl: output one point at (x, y, z0) to set reference level Otherwise, gp2rml will eliminate any offset. (x, y) is an arbitrary point from the toolpaths. --- cameo/zstack.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cameo/zstack.pl b/cameo/zstack.pl index f27597e..345b9ff 100755 --- a/cameo/zstack.pl +++ b/cameo/zstack.pl @@ -54,7 +54,11 @@ while (<>) { $z{$z} .= "$s\n"; undef $s; } - $z = $3 if /^-?\d+(\.\d*)?\s+-?\d+(\.\d*)?\s+(-?\d+(\.\d*)?)/; + if (/^-?\d+(\.\d*)?\s+-?\d+(\.\d*)?\s+(-?\d+(\.\d*)?)/) { + $x = $1 unless defined $x; + $y = $2 unless defined $y; + $z = $3; + } $s .= $_; $zmax = $z if $z > $zmax || !defined $zmax; } @@ -68,6 +72,8 @@ if ($reverse) { %z = %t; } +print "$x $y $z0\n\n"; + $z = $z0; for $c (sort { $b <=> $a } keys %z) { while ($z > $c+$zs) {