mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-21 12:08:20 +08:00
22 lines
229 B
Perl
Executable File
22 lines
229 B
Perl
Executable File
#!/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;
|
|
}
|
|
}
|
|
}
|