This topic describes the ST_Translate function. This function translates a meshgeom or sfmesh object based on given values.

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 units of the x coordinate.
YoffThe offset units of the y coordinate.
ZoffThe offset units of the z coordinate.

Description

This function processes the coordinates of the meshgeom or sfmesh object.

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

Examples

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

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