mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 22:54:08 -06:00
add z-every-line script, first attempt
This commit is contained in:
parent
c957c27367
commit
359d4073df
1 changed files with 21 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue