All Products
Search
Document Center

PolarDB:ST_Extrude

Last Updated:Mar 28, 2026

Extrudes a 2D polygon into a 3D mesh geometry along the positive z-axis.

Syntax

meshgeom ST_Extrude(geometry geom2d, float8 height);

Parameters

ParameterTypeDescription
geom2dgeometryThe input geometry. Accepts Polygon and MultiPolygon types.
heightfloat8The 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. Effect diagram

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))))