All Products
Search
Document Center

PolarDB:ST_YupToZup

Last Updated:Mar 28, 2026

Converts an sfmesh model from a Y-up coordinate system to a Z-up coordinate system by flipping the Y and Z axes.

Syntax

sfmesh ST_YupToZup(sfmesh mesh);

Return value

The sfmesh object after the Y and Z axes are flipped.

Parameters

ParameterDescription
sfmeshThe sfmesh object to convert.

Description

ST_YupToZup flips the Y and Z axes of an sfmesh object. This is equivalent to calling ST_Affine with the following transformation matrix:

1.0,  0,    0,   0,
0,    0,    1.0, 0,
0,   -1.0,  0,   0

Examples

SELECT ST_AsText(ST_YupToZup(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 (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,"matrix" : [1,0,0,-1,0,0,0,0,1,0,0,0,0,0,0,1]}]}