Scales a meshgeom or sfmesh object by the specified factors along each axis.
Syntax
meshgeom ST_Scale(meshgeom geom, float XFactor, float YFactor, float ZFactor);
sfmesh ST_Scale(sfmesh sfmeshObject, float XFactor, float YFactor, float ZFactor);Parameters
| Parameter | Type | Description |
|---|---|---|
geom | meshgeom | The meshgeom object to scale. |
sfmeshObject | sfmesh | The sfmesh object to scale. |
XFactor | float | The scaling factor for the x-axis. |
YFactor | float | The scaling factor for the y-axis. |
ZFactor | float | The scaling factor for the z-axis. |
Description
ST_Scale applies the following coordinate transformation to every vertex in the geometry:
x' = XFactor * x
y' = YFactor * y
z' = ZFactor * zExamples
Scale a meshgeom object
The following example scales a meshgeom object with XFactor=0.5, YFactor=0.8, and ZFactor=2.0. The x-coordinates are halved, y-coordinates are multiplied by 0.8, and z-coordinates are doubled.
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
)
);Output:
MESHGEOM(PATCH(INDEXSURFACE(VERTEX(0 0,0 8,5 8,5 0),INDEX((0,1,2),(1,2,3)))))