All Products
Search
Document Center

PolarDB:ST_Translate

Last Updated:Mar 28, 2026

Translates a meshgeom or sfmesh object by the given x, y, and z offsets.

Syntax

meshgeom ST_Translate(meshgeom geom, float Xoff, float Yoff, float Zoff);
sfmesh ST_Translate(sfmesh sfmeshObject, float Xoff, float Yoff, float Zoff);

Parameters

ParameterDescription
geomThe meshgeom object.
sfmeshObjectThe sfmesh object.
XoffThe offset along the x axis.
YoffThe offset along the y axis.
ZoffThe offset along the z axis.

Description

ST_Translate applies a linear translation to all coordinates of the input object. The function supports both meshgeom and sfmesh types.

Each coordinate is shifted as follows:

x' = x + Xoff
y' = y + Yoff
z' = z + Zoff

Examples

Translate a meshgeom object

select ST_asText(ST_Translate('MESHGEOM(PATCH(INDEXSURFACE(VERTEX(0 0,0 10,10 10,10 0), INDEX((0,1,2),(1,2,3)))))'::meshgeom, 0.5, 0.8, 2.0));

Output:

MESHGEOM(PATCH(INDEXSURFACE(VERTEX(0.5 0.8,0.5 10.8,10.5 10.8,10.5 0.8),INDEX((0,1,2),(1,2,3)))))