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
| Parameter | Description |
|---|---|
geom | The meshgeom object. |
sfmeshObject | The sfmesh object. |
Xoff | The offset along the x axis. |
Yoff | The offset along the y axis. |
Zoff | The 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 + ZoffExamples
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)))))