This topic describes the ST_Scale function. This function scales a meshgeom or sfmesh object based on a given factor.

Syntax

meshgeom ST_Scale(meshgeom geom, float XFactor, float YFactor, float ZFactor);
sfmesh ST_Scale(sfmesh sfmeshObject, float XFactor, float YFactor, float ZFactor);

Parameters

ParameterDescription
geomThe meshgeom object.
sfmeshObjectThe sfmesh object.
XFactorThe scaling factor of the x-axis.
YFactorThe scaling factor of the y-axis.
ZFactorThe scaling factor of the z-axis.

Description

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

x' = XFactor*x 
y' = YFactor*y
z' = ZFactor*z

Examples

select ST_asText(ST_Scale('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 0,0 8,5 8,5 0),INDEX((0,1,2),(1,2,3)))))