Occassionaly some jobs require unusual or rounded foam shapes. Cutting foam by hand often leave the foam with rough shapes. Some foam companies will cut your foam to the shape want. Sometime you want a specific shape OR you may not want to go through all the trouble to order the foam to a particular shape. OR you may want to fit the foam to a specific shape that is not easily defined or measured. You may only need one piece.
For whatever reason, you may decide to shape the foam yourself. This is done fairly easily by gluing layers of foam together into the desired shape. Although the thickness can vary according to the size needed, I generally use combinations of 1", 2", or 3", etc. to get the shapes.
While these are not exactly what you have, it will give you some ideas. Here a wing chair that I glued foam together .....
(Click on pictures to enlarge)
... to get the top of the headrest to be rounded...
Click on pictures to enlarge
Here is another example
Depending upon the shape I want, will also cut the edge of the bottom layers of foam at a slant, as in this picture.
Depending upon the application, I either leave the slanted edge on the top side, OR I put the slanted sides on the bottom, as in this picture:
By putting the slanted edges on the bottom, this increase both the top curve and makes for a smoother top edge, such as in this picture:
Then finish it off with wrapping a layer of 1" to 1 1/2" around and over the top, as in this picture.
This top layer of foam smooths everything out and makes all the curves flow around.
On this sofa, because I put a edgewire on the front edge of the springs, the front edge farily sharper. If you wanted a more rounded front or top edge, pull the top layer of foam tighter, which rounds everything more.
It is also important that the underlayers are as smooth (no hollow spots) as possible, but they don't need to be perfect, just reasonable. Before you top the top layer of foam on, carefully inspect the underlayers to make sure there are no bulges or hollow spots. If find any spots where you cut too much of an underlayer out, just glue a thin layer in the hollow spot. If you do a reasonable job of smoothing out the foam, everything will be hidden once you put the top layer of foam on top.