ST_MaterialN

Updated at:

Retrieves the Nth material from an sfmesh object.

Syntax

material  ST_MaterialN(sfmesh sfmeshObject, int4 index);

Parameters

Parameter

Description

sfmeshObject

The sfmesh object.

index

The index of the material. The index starts from 0.

Description

This function returns the Nth material in an sfmesh object.

Examples

select ST_MaterialN('{   "meshgeoms" : ["MESHGEOM(PATCH(TRIANGLESTRIP(0 0,0 10,10 10,10 0)))"],  "materials":[{"type":"db", "attributes": {"schema":"public","table":"t_material","column":"the_material","key":"num=1"}} ], "primitives" : [  {"meshgeom": 0, "material" : 0}],  "nodes" : [    {"primitive" : 0} ] }'::sfmesh, 0);

------------------------------
 010102FFDDEEAA