mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2024-12-23 04:23:55 +02:00
cameo/fped2d2z.pl: new option -t Zmax to set the height of the workpiece
This is similar to -r, except that we don't swap X and Y, and we use the specified value instead of searching for the maximum in the input data.
This commit is contained in:
parent
53fe70950d
commit
c73509dacc
@ -14,8 +14,10 @@
|
|||||||
|
|
||||||
sub usage
|
sub usage
|
||||||
{
|
{
|
||||||
print STDERR "usage: $0 [-r] [Zin=Zout ...] prefix [file ...]\n\n";
|
print STDERR "usage: $0 [-r|-t Zmax] [Zin=Zout ...] prefix ".
|
||||||
|
"[file ...]\n\n";
|
||||||
print STDERR " Zin=Zout replace Zin with Zout\n";
|
print STDERR " Zin=Zout replace Zin with Zout\n";
|
||||||
|
print STDERR " -t Zmax set the top of the piece\n";
|
||||||
print STDERR " -r reverse Z stacking. Also swaps X and Y.\n";
|
print STDERR " -r reverse Z stacking. Also swaps X and Y.\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -25,6 +27,10 @@ if ($ARGV[0] eq "-r") {
|
|||||||
shift @ARGV;
|
shift @ARGV;
|
||||||
$reverse = 1;
|
$reverse = 1;
|
||||||
}
|
}
|
||||||
|
if ($ARGV[0] eq "-t") {
|
||||||
|
shift @ARGV;
|
||||||
|
$top = shift @ARGV;
|
||||||
|
}
|
||||||
&usage if $ARGV[0] =~ /^-[^0-9]/;
|
&usage if $ARGV[0] =~ /^-[^0-9]/;
|
||||||
|
|
||||||
while ($ARGV[0] =~ /=/) {
|
while ($ARGV[0] =~ /=/) {
|
||||||
@ -55,6 +61,12 @@ if ($reverse) {
|
|||||||
}
|
}
|
||||||
%z = %t;
|
%z = %t;
|
||||||
print "0 0 $zmax\n\n";
|
print "0 0 $zmax\n\n";
|
||||||
|
} elsif (defined $top) {
|
||||||
|
for (keys %z) {
|
||||||
|
($t{$top-$_} = $z{$_}) =~
|
||||||
|
s/^(-?\d+(\.\d*)?)\s+(-?\d+(\.\d*)?)/$1 $3/mg;
|
||||||
|
}
|
||||||
|
%z = %t;
|
||||||
} else {
|
} else {
|
||||||
print "0 0 0\n\n";
|
print "0 0 0\n\n";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user