Check out these bits for foam. You don’t have to have a CNC machine. Just draw what you want and carve it out with a router. There’s much less resistance than cutting wood, so this can be done with a low-powered trim router. Draw it, set the bit depth, and carve!
Foam bits mentioned in the video:
→ 1/8″ x 1″ LOC foam cutter https://bitsbits.com/product/425-st125/
→ 1/4″ x 1″ LOC foam cutter https://bitsbits.com/product/425-st250c/
→ 1/4″ x 2″ LOC foam cutter https://bitsbits.com/product/430-st250-foam/