Are you talking about machining shapes in flexible foam, like Ethafoam? That's a very difficult material to work with, because it won't stand still while you're trying to cut it. You might be better off either machining a positive shape, molding it, and casting flexible foam in the mold, or machining the mold directly.