File: strip-toolchange.pl

package info (click to toggle)
slic3r 1.3.0%2Bdfsg1-5.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,552 kB
  • sloc: cpp: 63,126; perl: 21,512; ansic: 6,312; sh: 591; xml: 201; makefile: 37; python: 11
file content (15 lines) | stat: -rw-r--r-- 283 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl -i
#
# Remove all toolchange commands (and T# arguments) from gcode.

use strict;
use warnings;

# read stdin and any/all files passed as parameters one line at a time
while (<>) {
    if (not /^T[0-9]/) {
        s/\s*(T[0-9])//;
        print;
    } else {
    }
}