This topic describes the ST_ZupToYup function. This function converts the coordinate system from Z-up to Y-up.
Syntax
sfmesh ST_ZupToYup(sfmesh mesh);Return value
An sfmesh object is returned after the coordinate system is converted from Z-up to Y-up.
Parameters
Parameter | Description |
sfmesh | The sfmesh object that you want to convert. |
Description
This function converts the coordinate system of an sfmesh object from Z-up to Y-up. In some scenarios in which a Z-up coordinate system is used, the Y-up orientation is required. In these scenarios, you can use the ST_ZupToYup function to convert the coordinate system.
You can also call the ST_Affine function to perform the following matrix transformation to convert the coordinate system:
1.0, 0, 0, 0,
0, 0, -1.0, 0,
0, 1.0, 0, 0Examples
SELECT ST_AsText(ST_ZupToYup(ST_MeshFromText('{"version" : 1, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(INDEXSURFACE Z (VERTEX(0 0 2,0 10 3,10 10 1,10 0 1),INDEX((0,1,2),(1,2,3)))))"], "primitives" : [{"meshgeom" : 0}], "nodes" : [{"primitive" : 0}]}')));Result:
{"version" : 1, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(INDEXSURFACE Z (VE
RTEX(0 0 2,0 10 3,10 10 1,10 0 1),INDEX((0,1,2),(1,2,3)))))"], "primitives" :
[{"meshgeom" : 0}], "nodes" : [{"primitive" : 0,"matrix" : [1,0,0,1,0,0,0,0,-1
,0,0,0,0,0,0,1]}]}