The footprint and hipped roof are shown side-by-side so the generated 3D faces do not hide behind the input footprint.
WITH data AS (
SELECT 'POLYGON((0 0,5 0,5 4,0 4,0 0))'::geometry AS input_footprint
)
SELECT input_footprint AS input_footprint,
CG_GenerateHippedRoof(input_footprint, 2.0) AS hipped_roof
FROM data;
POLYGON((0 0,5 0,5 4,0 4,0 0)) | POLYHEDRALSURFACE Z (((0 4 0,5 4 0,5 0 0,0 0 0,0 4 0)),((0 4 0,0 0 0,2 2 2,0 4 0)),((0 0 0,5 0 0,3 2 2,2 2 2,0 0 0)),((5 0 0,5 4 0,3 2 2,5 0 0)),((5 4 0,0 4 0,2 2 2,3 2 2,5 4 0)))
010300000001000000050000000000000000000000000000000000000000000000000014400000000000000000000000000000144000000000000010400000000000000000000000000000104000000000000000000000000000000000 | 010F000080050000000103000080010000000500000000000000000000000000000000001040000000000000000000000000000014400000000000001040000000000000000000000000000014400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001040000000000000000001030000800100000004000000000000000000000000000000000010400000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000400000000000000040000000000000000000000000000010400000000000000000010300008001000000050000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000000000000000000000000000840000000000000004000000000000000400000000000000040000000000000004000000000000000400000000000000000000000000000000000000000000000000103000080010000000400000000000000000014400000000000000000000000000000000000000000000014400000000000001040000000000000000000000000000008400000000000000040000000000000004000000000000014400000000000000000000000000000000001030000800100000005000000000000000000144000000000000010400000000000000000000000000000000000000000000010400000000000000000000000000000004000000000000000400000000000000040000000000000084000000000000000400000000000000040000000000000144000000000000010400000000000000000