Are you saying in a roundabout way that the cutting wheel rotates around the Z axis in a manner dictated by the program?Or is it free to swivel as the machine moves?LinuxCNC can certainly handle the number of axes although configuring the Z and rotation might be a challenge.Have you asked the dedicated LinuxCNC forum at https://forum.linuxcnc.org/ ?There is a lot of knowledge there and somebody may have experience of something similar.