mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-07 21:39:19 +08:00
add z-every-line script, first attempt
This commit is contained in:
parent
c957c27367
commit
359d4073df
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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user