EPS (styrofoam) can be use for making 3D, and 2D objects
Phoneolic foam (balsa foam) has similar properties but is better for higher temperatures like vacuum forming.
The Roland Mini-mill is used to cut the foam in several passes.
The foam is cut to nearly the height and shape of the largest dims of the object to be machined. This is done either by hand (knife), surfacing with a large tool in the mill, hotwire, or with a saw. A ruffing pass is next to remove a bulk of the foam that is in the way of the the final pass(es). The detail is added by fine passes with tapered tool to ensure relief for molding. Depending on the piece fine sanding, gluing, slicing, painting and other post work are needed.
Here is the Roland how to How To Cut Foam