ST_TransScale

Updated at:

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(meshgeomgeom, float Xoff, float Yoff, float XFactor, float YFactor);
sfmesh ST_TransScale(sfmeshsfmeshObject, float Xoff, float Yoff,  float XFactor, float YFactor);

Parameters

Parameter

Description

geom

The meshgeom object.

sfmeshObject

The sfmesh object.

Xoff

The offset value for the x-coordinate.

Yoff

The offset value for the y-coordinate.

XFactor

The scaling factor for the x-coordinate.

YFactor

The scaling factor for the y-coordinate.

Description

This function applies the following formulas to all coordinate points of a 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)))))