The generic dispatcher returns the same 3D roofs as the specialized helpers for the same footprint.
WITH data AS (
SELECT 'POLYGON((0 0,4 0,4 4,0 4,0 0))'::geometry AS input_footprint
)
SELECT input_footprint AS input_footprint,
CG_GenerateRoof(input_footprint, 'HIPPED', 2.0, 30.0, 0) AS hipped_roof,
CG_GenerateRoof(input_footprint, 'FLAT', 2.0, 30.0, 0) AS flat_roof
FROM data;
POLYGON((0 0,4 0,4 4,0 4,0 0)) | POLYHEDRALSURFACE Z (((0 4 0,4 4 0,4 0 0,0 0 0,0 4 0)),((0 4 0,0 0 0,2 2 2,0 4 0)),((0 0 0,4 0 0,2 2 2,0 0 0)),((4 0 0,4 4 0,2 2 2,4 0 0)),((4 4 0,0 4 0,2 2 2,4 4 0))) | POLYHEDRALSURFACE Z (((0 0 0,0 4 0,4 4 0,4 0 0,0 0 0)),((0 0 2,4 0 2,4 4 2,0 4 2,0 0 2)),((0 0 0,0 0 2,0 4 2,0 4 0,0 0 0)),((0 4 0,0 4 2,4 4 2,4 4 0,0 4 0)),((4 4 0,4 4 2,4 0 2,4 0 0,4 4 0)),((4 0 0,4 0 2,0 0 2,0 0 0,4 0 0)))
010300000001000000050000000000000000000000000000000000000000000000000010400000000000000000000000000000104000000000000010400000000000000000000000000000104000000000000000000000000000000000 | 010F000080050000000103000080010000000500000000000000000000000000000000001040000000000000000000000000000010400000000000001040000000000000000000000000000010400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001040000000000000000001030000800100000004000000000000000000000000000000000010400000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000400000000000000040000000000000000000000000000010400000000000000000010300008001000000040000000000000000000000000000000000000000000000000000000000000000001040000000000000000000000000000000000000000000000040000000000000004000000000000000400000000000000000000000000000000000000000000000000103000080010000000400000000000000000010400000000000000000000000000000000000000000000010400000000000001040000000000000000000000000000000400000000000000040000000000000004000000000000010400000000000000000000000000000000001030000800100000004000000000000000000104000000000000010400000000000000000000000000000000000000000000010400000000000000000000000000000004000000000000000400000000000000040000000000000104000000000000010400000000000000000 | 010F00008006000000010300008001000000050000000000000000000000000000000000000000000000000000000000000000000000000000000000104000000000000000000000000000001040000000000000104000000000000000000000000000001040000000000000000000000000000000000000000000000000000000000000000000000000000000000103000080010000000500000000000000000000000000000000000000000000000000004000000000000010400000000000000000000000000000004000000000000010400000000000001040000000000000004000000000000000000000000000001040000000000000004000000000000000000000000000000000000000000000004001030000800100000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000010400000000000000040000000000000000000000000000010400000000000000000000000000000000000000000000000000000000000000000010300008001000000050000000000000000000000000000000000104000000000000000000000000000000000000000000000104000000000000000400000000000001040000000000000104000000000000000400000000000001040000000000000104000000000000000000000000000000000000000000000104000000000000000000103000080010000000500000000000000000010400000000000001040000000000000000000000000000010400000000000001040000000000000004000000000000010400000000000000000000000000000004000000000000010400000000000000000000000000000000000000000000010400000000000001040000000000000000001030000800100000005000000000000000000104000000000000000000000000000000000000000000000104000000000000000000000000000000040000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000104000000000000000000000000000000000