A couple of years ago I was attempting to make large foam figures and I found that foam stores just take their foam and toss what doesn't fit into recycle bags. I asked for any that would fit my purpose and they said to help myself. Some of these pieces were truly premium used to recover expensive furniture, just cut the wrong way or cut off to fit cushions.
Using an old fashioned electric meat cutting knife and a router table, I built a jig to cut straight lines and then glued pieces together using spray glue.
What I am thinking you could do is build some cushion back wedges for your mattress. I would also put your mattress onto plywood so that the front can be lifted and set slightly elevated for day use, or left flat if your wedges go on the ends. You would have a comfortable day bed, and the foams would just get tossed into the overhead when it's bedtime.
Mike
2012 Winnebago Impulse Silver 26QP
2005 16.6 Double Eagle
2018 Jeep Wrangler JK
previously Snowbird Campers,
Triple E Motorhome and Fifth Wheel