Skip to content

vertexbz/gcode-postprocessor

Repository files navigation

G-Code Postprocessor

Modular G-Code postprocessor for Prusa/SuperSlicer

Installation

Clone this repository git clone https://github.com/vertexbz/gcode-postprocessor.git

Provide path to ./run.sh file of the cloned repository in Print Settings > Output options > Post-processing scripts of your slicer

Configuration

Log level

Log level / verbosity can be used by providing -v (or --verbose) CLI flag, multiple use increases verbosity

Levels

  • Default: Error
  • v: Info
  • vv: Info, long format
  • vvv: Debug
  • vvvv: Debug, long format

Config files

Default configuration is available in and loaded from ./config.default.yaml
User defaults can be provided via ./config.yaml (or ./config.yml) this file is not part of this repository, default one can be used as template
Defaults are overriden by file provided via -c (or --config) CLI parameter

Dry run

Dry run mode fully processes the input but doesn't save the output to file

CLIYAML

-d
--dry
--dry-run

dry_run: True
dry-run: False
dryRun: true
dryrun: false

Macros

Features look for popular custom macros which names may vary
Default configuration file contains full list of used macros

CLIYAML

-m print_start=HELLO_THERE
--macro print_end=BYE_BYE

macro:
  print_start: MY_CUSTOM_START_PRINT
  print_end: MY_CUSTOM_END_PRINT

Features

To have actual benefit from using postprocessor, desired features have to be enabled, via configuration file or with CLI flag

  • Features can be specified multiple times, with same or different configurations
  • Features are applied in the order provided, first config files, then cli
  • Configuration file features configuration overrides previous ones, CLI specified features are appended
CLI

-f start-xy -f pa-extruder-fixer
--feature start-xy --feature feature-with-config=option1=value,other_option={options_option=1}

YAML
feature:
  - pa-extruder-fixer
  - start-xy
  - feature-with-config:
      option1: value
      other_option: 
        options_option: 1

to clear all prior features

feature: []

Built-in features

Detects first coordinate in g-code and sets X and Y coordinates to START_X and START_Y params of print start macro respectively

Removes final filament unload procedure for multi-material prints

Fixes SET_PRESSURE_ADVANCE gcode for clipper and multi-material prints (removes EXTRUDER parameter)

Removes Z axis movements prior to moving to initial XY position