Returns the binary representation of an object as a bytea value.
Syntax
bytea ST_AsBinary(meshgeom geom);
bytea ST_AsBinary(sfmesh sfmeshObject);
bytea ST_AsBinary(material material);
bytea ST_AsBinary(texture texture);
bytea ST_AsBinary(meshgeom geom, cstring endian);
bytea ST_AsBinary(sfmesh sfmeshObject, cstring endian);
bytea ST_AsBinary(material material, cstring endian);
bytea ST_AsBinary(texture texture, cstring endian);Parameters
| Parameter | Description |
|---|---|
geom | The meshgeom object. |
sfmeshObject | The sfmesh object. |
material | The material object. |
texture | The texture object. |
endian | The byte order of the output. Valid values: NDR (little-endian) and XDR (big-endian). |
Description
ST_AsBinary converts an object of any supported type to its binary representation. The result is equivalent to an explicit type conversion using ::bytea.
Examples
select ST_AsBinary(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}]}'));
--------------------------
\x014d0102...该文章对您有帮助吗?