You might also wanna try cutting the foam with an electric carving knife. The same kind you use on a Thanksgiving turkey.
My wife refinished a sofa and used one of these to cut the foam for the cushions. Worked like a champ. Not sure how it will do on the ridgid foam you're talking about, but worth a try.
Randy