Extrudes a 2D polygon into a 3D mesh geometry along the positive z-axis.
Syntax
meshgeom ST_Extrude(geometry geom2d, float8 height);Parameters
| Parameter | Type | Description |
|---|---|---|
geom2d | geometry | The input geometry. Accepts Polygon and MultiPolygon types. |
height | float8 | The extrusion distance along the positive z-axis. |
Description
ST_Extrude takes a 2D Polygon or MultiPolygon and extrudes it along the positive z-axis by the specified height, returning a meshgeom (3D mesh geometry).
Supported input types: Polygon, MultiPolygon
Output type: meshgeom
Extrusion direction: Positive z-axis (upward)
Effect diagram
A 2D polygon is extruded along the z-axis. 
Examples
Extrude a triangular polygon by a height of 1:
SELECT ST_AsText(ST_Extrude('POLYGON((0 0, 1 0, 1 1, 0 0))', 1));Output:
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))))