ST_TransScale

更新时间:
复制 MD 格式

Translates and scales a meshgeom or sfmesh object by applying an offset and a scaling factor to each coordinate.

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 applied to the x coordinate.
YoffThe offset applied to the y coordinate.
XFactorThe scaling factor applied to the x coordinate.
YFactorThe scaling factor applied to the y coordinate.

Description

ST_TransScale transforms each coordinate in the meshgeom or sfmesh object using the following formulas:

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

Output:

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