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
| Parameter | Type | Description |
|---|---|---|
geom | meshgeom | The meshgeom object. |
sfmeshObject | sfmesh | The sfmesh object. |
material | material | The material object. |
texture | texture | The texture object. |
Returns
text
Usage notes
ST_AsTextis 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}]}该文章对您有帮助吗?