Rotates a meshgeom or sfmesh object by a specified angle in radians.
Syntax
meshgeom ST_Rotate(meshgeom geom, float angle);
sfmesh ST_Scale(sfmesh sfmeshObject, float angle);The second signature showsST_Scaleas the function name. This appears to be a documentation error in the source. The behavior described applies to rotation ofsfmeshobjects.
Parameters
| Parameter | Description |
| geom | The meshgeom object to rotate. |
| sfmeshObject | The sfmesh object to rotate. |
| angle | The rotation angle, in radians. |
Description
ST_Rotate rotates a 3D mesh object along the x-axis or y-axis only.
Example
The following example rotates a meshgeom object by pi()/4 radians (45 degrees):
-- Rotate 45 degrees (pi()/4 radians)
select ST_asText(
ST_Rotate(
'MESHGEOM(PATCH(INDEXSURFACE(VERTEX(0 0 1,0 10 2,10 10 3,10 0 4), INDEX((0,1,2),(1,2,3)))))'::meshgeom,
pi()/4
)
);Output:
MESHGEOM(PATCH(INDEXSURFACE Z (VERTEX(0 0 1,-7.07106781186547 7.07106781186548 2,0 14.142135623731 3,7.07106781186548 7.07106781186547 4),INDEX((0,1,2),(1,2,3)))))该文章对您有帮助吗?