SFMESH uses JSON as the representation method of well-known texts (WKTs) and contains node information. This topic describes the node information.

  • version: the version of SFMESH. Set the value to 1.
  • srid: the spatial reference identifier (SRID).
  • lod: the Level of Detail (LOD).
  • root: the root directory ID of the node. Default value: 0.
  • meshgeoms: an array of all referenced meshgeom objects, which can be referenced objects.
  • meshes: an array of all sfmesh objects that are referenced based on the node, which can be referenced objects.
  • textures: an array of all texture objects.
  • materials: an array of all material objects.
  • primitives: an array of all primitives. Primitives are categorized as two types: meshgeom and mesh. Primitives of the meshgeom type can contain material information and can be associated by using the material keyword.
  • nodes: You can use nodes to define a tree structure for organization construction. The following attributes can be included:
    • primitive: the information about the primitive.
    • children: an array of child objects.
    • matrix: the transformation matrix, which is described in the following format:
      / a  b  c  xoff \ 
      | d  e  f  yoff | 
      | g  h  i  zoff |
      \ 0  0  0     1 / 
    • id: the ID associated with the object.
{
    "version":1,
    "root":0,
    "meshgeoms":[
        "MESHGEOM(PATCH(TRIANGLESTRIP(0 0,0 10,10 10,10 0)))"
    ],
    "meshes":[
        "MESH(schema(@public@), table(@t_mesh@), column(@the_mesh@), key(@num=1@))"
    ],
    "primitives":[
        {
            "mesh":0
        },
        {
            "meshgeom":0
        }
    ],
    "nodes":[
        {
            "children":[
                1,
                2
            ],
            "id":100
        },
        {
            "primitive":0
        },
        {
            "primitive":1,
            "matrix":[
                2,
                0,
                0,
                1,
                0,
                2,
                0,
                3,
                0,
                0,
                2,
                4,
                0,
                0,
                0,
                1
            ],
            "id":10
        }
    ],
    "materials":[
        {
            "type":"db",
            "attributes":{
                "schema":"public",
                "table":"t_material",
                "column":"the_material",
                "key":"num=1"
            }
        }
    ],
    "textures":[
        {
            "compressionType":"None",
            "format":"JPEG",
            "wrap":"Wrap",
            "type":"Url",
            "depth":3,
            "width":256,
            "height":256,
            "size":15,
            "data":"http://aaa.png"
        }
    ]
}
SFMESH allows you to reference other sfmesh objects. In this case, SFMESH contains the following keywords: schema, table, column, and key. The last three of the keywords are required. The value for each keyword is enclosed by at signs (@).
/*
Format
MESH(
   schema(@schema_name@),
    table(@table_name@),
    column(@column_name@),
    key(@where_clause@)
   )
*/

  MESH(
   schema(@public@),
    table(@mytable@),
    column(@mycolumn@),
    key(@id=1@)
   )