This topic describes the ST_Extrude function. This function extrudes a 2D polygon into a 3D model along the positive direction of the z-axis.

Syntax

meshgeom ST_Extrude(geometry geom2d, float8 height);

Parameters

Parameter Description
geom2d The geometry object, which can be of the Polygon or MultiPolygon type.
height The height.

Description

This function extrudes a 2D polygon into a 3D model along the z-axis.

Effect diagram

A 2D polygon is extruded along the z-axis. Effect diagram

Examples

SELECT ST_AsText(ST_Extrude('POLYGON((0 0, 1 0, 1 1, 0 0))', 1));
-----------------------------------------------------------------------------------------------------------------------------------------------------
MESHGEOM(PATCH(POLYGON Z ((0 0 1,1 0 1,1 1 1,0 0 1)),TRIANGLESTRIP Z (0 0 1,0 0 0,1 0 1,1 0 0,1 1 1,1 1 0,0 0 1,0 0 0),POLYGON Z ((0 0 0,1 1 0,1 0 0,0 0 0))))