Skip to content

Script pygcode crop

Peter Boin edited this page Jul 28, 2017 · 4 revisions

Cropping Script

This script cuts out a portion of a gcode file so it may be executed independently of the rest of the file.

==================
TODO
==================

Example Uses

Cut specific lines

cut out from line 100 to line 200 of the part.gcode file

$ pygcode-crop part.gcode 100:200

Resume from depth

Let's say you have a pocket operation, but you had to stop it half way through (at a depth of 3.2mm). you can resume it by cropping out everything before Z reached -3.2mm

$ pygcode-crop pocket.gcode "z<=-3.2:"

Only middle part

Or you're engraving 3 words stacked on top of each other, but you only want to engrave the middle word. The space between the top 2 words centres at y=3mm, and between the bottom 2 words is at y=6mm.

$ pygcode-crop engraving.gcode "y>3:y>6"

Clone this wiki locally