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

Syntax

meshgeom ST_TransScale(meshgeom geom, float Xoff, float Yoff, float XFactor, float YFactor);
sfmesh ST_TransScale(sfmesh sfmeshObject, float Xoff, float Yoff,  float XFactor, float YFactor);

Parameters

ParameterDescription
geomThe meshgeom object.
sfmeshObjectThe sfmesh object.
XoffThe offset units of the x coordinate.
YoffThe offset units of the y coordinate.
XFactorThe scaling factor of the x coordinate.
YFactorThe scaling factor of the y coordinate.

Description

This function processes the coordinates of meshgeom or sfmesh object.
x' = XFactor *(x + Xoff) 
y' = XFactor *(y + Yoff)

Examples

select ST_asText(ST_TransScale('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,1.3));

----------------------------------------------------------------------
 MESHGEOM(PATCH(INDEXSURFACE(VERTEX(1 1.04,1 14.04,21 14.04,21 1.04),INDEX((0,1,2),(1,2,3)))))