The most popular Arduino program is Grbl(a g code interpreter on the Arduino that accepts commands from an interface on an a computer) and runs the drivers for the motors. Unfortunately the only way Grbl can run a 4th axis is one in parallel with the Zaxis for something like a 3axis CNC router with two motors driving a long table.
LinuxCNC, which I'm trying to work now is supposed to have a 4axis wirecutter mode in the latest 2.6 or 2.7 version. I haven't got it working yet 'cause I'm pretty far behind the curve on Linux right now.
Profili is a drafting/airfoil/cad program that will produce Gcode. But it's also at least $100.
The actual computer code is pretty simple, if you don't require complex arcs. The heart of it is a loop that arranges the motors in terms of the longest to shortest travel for each increment of the cut. By triggering a step on the next shorter motor after every loop eventually all motors have stepped down to zero. For anything more complex than a few straight cuts the shapes need to be drawn as polylines and then converted into a list of moves for each increment.
The hardest part is figuring out the dfx file format so you can filter out the correct numbers for the polylines and make sure they are in the right order so the number for the foamcutter can be calculated.
TinyG2 can be flashed to an Arduino DUE and it supports up to 6 axis. Linear or rotary.
The only GUI good enough is Chillipeppr but it is web based.
Flashing the DUE with the firmware was no easy task. Not as straight forward as with GRBL.
The config change (acceleration, rapid feed, etc) cannot be stored. It need to be pushed to the controller each time by the GUI or set in the source code, compiled and pushed to the controller. PITA...