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
| Parameter | Description |
|---|---|
geom | The meshgeom object. |
sfmeshObject | The sfmesh object. |
Xoff | The offset applied to the x coordinate. |
Yoff | The offset applied to the y coordinate. |
XFactor | The scaling factor applied to the x coordinate. |
YFactor | The 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)))))该文章对您有帮助吗?