Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'utils/post-processing/z-every-line.pl')
-rwxr-xr-xutils/post-processing/z-every-line.pl12
1 files changed, 6 insertions, 6 deletions
diff --git a/utils/post-processing/z-every-line.pl b/utils/post-processing/z-every-line.pl
index 49d5f4502..aaf57e172 100755
--- a/utils/post-processing/z-every-line.pl
+++ b/utils/post-processing/z-every-line.pl
@@ -8,17 +8,17 @@ my $z = 0;
# read stdin and any/all files passed as parameters one line at a time
while (<>) {
# if we find a Z word, save it
- $z = $1 if /Z(\d+(\.\d+)?)/;
+ $z = $1 if /Z\s*(\d+(\.\d+)?)/;
# if we don't have Z, but we do have X and Y
if (!/Z/ && /X/ && /Y/ && $z > 0) {
# chop off the end of the line (incl. comments), saving chopped section in $1
- s/\s*([\r\n\;\(].*)//s;
+ s/\s*([\r\n\;\(].*)/" Z$z $1"/es;
# print start of line, insert our Z value then re-add the chopped end of line
- print "$_ Z$z $1";
+ # print "$_ Z$z $1";
}
- else {
+ #else {
# nothing interesting, print line as-is
- print;
- }
+ print or die $!;
+ #}
}