Doom map-style rooms (using splines)

I’ve been working on an idea today that would allow for the ultimate in freedom when it comes to Doom-style maps.

In Doom (classic Doom that is), most rooms have very odd shapes, which creates a very unique and fun layout for each map.

Today I’ve been playing around with splines and noticed a very similar result when I added walls to the splines. I was able to shape them however I wanted and they would keep their shape and even the material I got to scale accordingly to the distance of the points.

But now comes a tricky part that I can’t figure out.

How do I add floors?

The obvious answer would be to simply pick 4 corner points and add a spline mesh, then scale it and calculate the tangents between the points. Do this until all corner points have a floor connecting to it and voila. But this is where I’m stuck. I can’t figure out the math behind all that. Then there is another problem with the material. The floors cannot overlap or otherwise the materials would start Z-fighting because of differences in scale.

In case anyone wants to help me and get up to speed in no time, here’s my simple spline mesh setup for the walls: