How to shift gcode?

Is there any way to shift the x and y coordinates of a gcode so you’d be able to cut multiples of one program at once?

there is a standard way to do it, but the maslow does not implement tht yet.

right now with the maslow, you would need to define your multiple copies at the
CAM stage.

you can redefine where home is and run it once, redefine home, run it again,
etc.

David Lang

1 Like

yeah that’s what I’ve been doing but having g code do it seemed easier. that sucks that it isn’t implemented yet. Maybe in a future update :crossed_fingers:

contributions welcome :slight_smile:

I’d love for someone to implement a ‘bug bounty’ or ‘feature bounty’ where
people could ask for features to be implemented, then whoever implements the
features gets paid for doing so. This would let people who don’t have
time/expertise to contribute code to encourage things they want.

David Lang

did you come up with that? seems like a great way to speed along some advancements that may not come otherwise

the idea is not new, but we don’t have anything like that setup yet.

David Lang

For reference:
On Linux you can shift g-code with a 1 line command with an awkward thing called awk.
I had a set of 3 g-code for 3 sheets for a desktop-cnc and wanted them on one sheet next to each other for the Maslow. 20 minutes after asking in a Linux forum, the answer was awk.

awk '{where=match($0, /(.*X)([[:digit:]]+)(.*)/, a) ; if (where) {print a[1](a[2]+375)a[3]} else print}' cnc2.nc > cnc2shift.nc
awk '{where=match($0, /(.*X)([[:digit:]]+)(.*)/, a) ; if (where) {print a[1](a[2]+700)a[3]} else print}' cnc3.nc > cnc3shift.nc

The first g-code untouched, the second shifted 375 to +X, the second shifted 700 to +X.
Don’t ask me how it works, it just did. All I understand is X and could any time replace that with Y , the numbers that can be adjusted and the filenames in- and out. The rest looks like witchcraft to me.

Kind regards, Gero

+1 for appropriate use of “witchcraft”

1 Like

You know about the “define home” button and that doesn’t work here? Define home will move the gcode 0,0 to where the machine is now

1 Like

Yes, I just wanted the 3 gcodes in one file to save some time :slight_smile:

1 Like

Just copy paste the object in the CAD/CAM software before creating gcode?