Skip to content

dry rewrite-gcode

Re-emit imported motion while preserving non-motion source G-code lines in place

Optimize rendered preview
Sample: OptimizeResolve through the optimization pipeline and inspect optimized IR.typescript: docs/site/examples/optimize.ts · python: docs/site/examples/optimize.py

Help

text
Re-emit imported motion while preserving non-motion source G-code lines in place

Usage: dry rewrite-gcode [OPTIONS] <FILE>

Arguments:
  <FILE>  

Options:
      --profile <PROFILE>
          Machine/material profile JSON to supply import defaults
      --filament-diameter <FILAMENT_DIAMETER>
          Filament diameter in mm, used to recover deposited volume from E motion
      --line-width <LINE_WIDTH>
          Optional line width in mm to attach to extruding segments
      --layer-height <LAYER_HEIGHT>
          Optional layer height in mm to attach to extruding segments
      --absolute-e
          Emit absolute extrusion (default is relative E)
      --optimize
          Optimise each contiguous source motion span before splicing it back
      --reorder-travel
          Also reorder independent extrusion runs to reduce travel. Changes print order
      --mode <MODE>
          Gated optimisation mode (`safe`|`balanced`|`max`). When set, each motion span is rewritten only if it introduces no new verifier error: `safe` canonicalises geometry, `balanced` adds adaptive-speed shaping, `max` also reorders travel and adds z-hop [possible values: safe, balanced, max]
      --json
          Emit a `RewriteReport` as JSON to stdout (requires `--out` for the rewritten G-code)
  -o, --out <OUT>
          Write rewritten G-code to a file instead of stdout
  -h, --help
          Print help