mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 11:23:42 +00:00
add z-every-line script, first attempt
This commit is contained in:
21
post-processing/z-every-line.pl
Executable file
21
post-processing/z-every-line.pl
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my $z = 0;
|
||||||
|
|
||||||
|
for (<>) {
|
||||||
|
if (/Z(\d+(\.\d+)?)/) {
|
||||||
|
$z = $1;
|
||||||
|
print;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (!/Z/ && /X/ && /Y/ && $z > 0) {
|
||||||
|
s/\s*([\r\n\;\(].*)//gs;
|
||||||
|
print "$_ Z$z $1";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user