2.8. ADVANCED TOPICS
Post-Processing Scripts
There may be times when the G-Code generated by Slic3r has to be tweaked
or modified after it has been created. For this reason there exists the ability
to run arbitrary scripts as part of the final steps in the slicing process
18
.
In the
Output options
subsection of the
Print Settings
tab lies the
Post-processing scripts
option. The absolute path to each script can
be added, separated by semicolons. Each scripts should be recognised by
the host system, and be executable.
Figure 2.61: Post-processing script option.
Each script will be passed the absolute path of the G-Code file that
Slic3r generates. All Slic3r configuration options are made available to the
scripts by way of environment variables. These all begin with
SLIC3R_
.
The following script would write out all Slic3r options to standard output:
#!/bin/sh
echo "Post-processing G-code file: $*"
env | grep ^SLIC3R
Figure 2.62: Example post-processing script to display Slic3r environment
variables.
Example scripts can be found in the GitHub repository
19
.
Perl’s in-place mode (
perl -i
) makes it easy to modify the contents
of the G-Code file, without having to copy, edit, then replace the original.
The following example will simply output the contents to standard output:
18
exttthttps://github.com/alexrj/Slic3r/wiki/Writing-post-processing-scripts
19
exttthttps://github.com/alexrj/Slic3r/tree/master/utils/post-processing
91
PROOF
Summary of Contents for TAZ 4
Page 1: ...Content Type Standard Color Paper Type STCO19 Page Count 130 File type Internal PROOF...
Page 2: ...P R O O F...
Page 3: ...TAZ 4 User Manual Aleph Objects Inc P R O O F...
Page 10: ...P R O O F...
Page 11: ...WARNINGS Safety Information P R O O F...
Page 14: ...P R O O F...
Page 15: ...3D Printer Software P R O O F...
Page 25: ...Slic3r P R O O F...
Page 98: ...P R O O F...
Page 99: ...Printing with the Graphic LCD P R O O F...
Page 107: ...Maintaining Your 3D Printer P R O O F...
Page 111: ...Advanced Usage P R O O F...
Page 116: ...P R O O F...
Page 117: ...Hardware and Software Source Code P R O O F...
Page 119: ...3D Printer Support P R O O F...
Page 121: ...Contact Information P R O O F...
Page 129: ...P R O O F...
Page 130: ...Colophon Created with 100 Free Libre Software GNU Linux L A TEX Memoir P R O O F...
Page 131: ...P R O O F...
Page 132: ...7IA9I9 dhiefb P R O O F...
Page 133: ...P R O O F...