You can do it, but be warned. Polystyrene can easily survive boiling water temperatures and even middling oven temperatures; polystyrene melts at about 460 degrees. That leaves you some overhead if you're just shooting for that ubiquitous oven temperature of 350.
But plastics get soft as they heat up. If you're going to count on the foam to also hold weight, like a spit with a roasting hen on it, or a rack with muffins, the weight could overwhelm what little strength remains in the foam as it heats up, and then the support sags, the oven warps, a little gap opens and poof, there goes all the heat.
Let me instead recommend to you that you build your oven from something more substantial. Wood doesn't melt and can easily survive 350 degrees for 40 minutes - longer, if you line the oven with a couple layers of foil. So build your oven out of Sitka Spruce (other species of wood can't tolerate such higher temperatures for as long) and then apply layers of foam insulation around THAT.
For greater confidence at higher temperatures, build the box large enough that you can line it with a couple of layers of Hardiboard tile backer. This cementitious product will tolerate much higher temperatures than any piece of wood. And again, wrap the exterior of the oven with layers of foam to keep the heat in.
NOTE: for a cheap, easy high temperature piece of glass for the door, use a large Pyrex baking dish. Not big enough? Easy: use two!
Answers & Comments
You can do it, but be warned. Polystyrene can easily survive boiling water temperatures and even middling oven temperatures; polystyrene melts at about 460 degrees. That leaves you some overhead if you're just shooting for that ubiquitous oven temperature of 350.
But plastics get soft as they heat up. If you're going to count on the foam to also hold weight, like a spit with a roasting hen on it, or a rack with muffins, the weight could overwhelm what little strength remains in the foam as it heats up, and then the support sags, the oven warps, a little gap opens and poof, there goes all the heat.
Let me instead recommend to you that you build your oven from something more substantial. Wood doesn't melt and can easily survive 350 degrees for 40 minutes - longer, if you line the oven with a couple layers of foil. So build your oven out of Sitka Spruce (other species of wood can't tolerate such higher temperatures for as long) and then apply layers of foam insulation around THAT.
For greater confidence at higher temperatures, build the box large enough that you can line it with a couple of layers of Hardiboard tile backer. This cementitious product will tolerate much higher temperatures than any piece of wood. And again, wrap the exterior of the oven with layers of foam to keep the heat in.
NOTE: for a cheap, easy high temperature piece of glass for the door, use a large Pyrex baking dish. Not big enough? Easy: use two!
Good luck with it.
The foam will MELT at oven temperature
Update to comment: POLYSTYRENE IS NOT FOAM. Your answer is for A DIFFERENT PRODUCT.