Thanks a lot for your answer.
My main issue is that I have a number of roofs that are inclined or more complicated for which I have the exact shape of the roof and I wouldn't like to lose this level of detail.
What I have already done is:
1. Copy the all roof shapes (roofs layer) to a new layer (the footprints layer)
2. Make all footprints horizontal (by changing their y-value to 0)
3. Align all footprint shapes to terrain (translate to maximum - offset: 0)
4. Align terrain to footprints layer
So now I have horizontal footprints aligned with terrain (white shapes in screenshot) and horizontal/non horizontal roofs (red shapes) on the exact location above their footprints. What I would like to do is extrude the footprints up to the roofs which means that every corner of a footprint shape should be extruded to a different height. Something that I have no idea how to do.
Alternatively would there be a way to extrude the roof shapes downwards in the world.up direction until they meet the terrain and then somehow make the footprints flat?