ST_AsText

更新时间:
复制 MD 格式

Returns the text representation of an object of any type, equivalent to the explicit type conversion ::text.

Syntax

text ST_AsText(meshgeom geom);
text ST_AsText(sfmesh sfmeshObject);
text ST_AsText(material material);
text ST_AsText(texture texture);

Parameters

ParameterTypeDescription
geommeshgeomThe meshgeom object.
sfmeshObjectsfmeshThe sfmesh object.
materialmaterialThe material object.
texturetextureThe texture object.

Returns

text

Usage notes

  • ST_AsText is equivalent to casting the object with ::text. Both produce identical output.

Examples

The following example converts a meshgeom object to its text representation using ST_MeshFromText as the input.

select ST_AsText(ST_MeshFromText('{"version" : 1, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(INDEXSURFACE(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}]}'));

Output:

{"version" : 1, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(INDEXSURFACE(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}]}