MESHGEOM contains three types of keywords: PATCH, NORMAL, and TEXCOORD.
Structure overview
A MESHGEOM object consists of up to three components:
| Component | Keyword | Required | Description |
|---|---|---|---|
| Geometry data | PATCH | Yes | One or more geometry objects |
| Surface normals | NORMAL | No | Normal vectors for 3D lighting and rendering |
| Texture mapping | TEXCOORD | No | Texture coordinates for 2D surface mapping |
PATCH
PATCH holds one or more geometry objects. Separate multiple geometries with commas (,).
Supported geometry types:
Point
LineString
Polygon
MultiPoint
MultiLineString
MultiPolygon
IndexSurface
TriangleStrip
TriangleFan
Example: two geometries in one PATCH
-- 2 patches: 1 Point and 1 IndexSurface
MESHGEOM(
PATCH(
POINT(0 0 1),
INDEXSURFACE(VERTEX(0 0 1,0 10 2,10 10 3,10 0 4), INDEX((0,1,2),(1,2,3)))
)
)NORMAL
NORMAL holds a set of normal vectors for 3D points. Enclose each geometry object's coordinates in parentheses () and separate individual coordinates with commas (,).
The number of points in NORMAL must equal the number of vertices in the corresponding PATCH.
Example: PATCH with NORMAL and TEXCOORD
MESHGEOM(
PATCH(
TRIANGLESTRIP(0 0 1,0 10 2,10 10 3,10 0 4)
),
NORMAL(
(0 0 0, 1 1 1,2 2 2, 3 3 3)
),
TEXCOORD(
(0 0, 1 1, 2 2, 3 3)
)
)TEXCOORD
TEXCOORD holds a set of texture coordinates for 2D points. Enclose each geometry object's coordinates in parentheses () and separate individual coordinates with commas (,).
The number of points in TEXCOORD must equal the number of vertices in the corresponding PATCH.
TEXCOORD supports the Z and M dimensions. All patches in a MESHGEOM object must use the same dimensions.
Example: M dimension
-- All patches declare the M dimension
MESHGEOM(
PATCH(
POINT M(0 0 1),
INDEXSURFACE M(VERTEX(0 0 1,0 10 2,10 10 3,10 0 4), INDEX((0,1,2),(1,2,3)))
)
)Reference another MESHGEOM object
MESHGEOM can reference geometry stored in another table. Use the following keywords to identify the source:
| Keyword | Required | Description |
|---|---|---|
schema | No | Schema name |
table | Yes | Table name |
column | Yes | Column name |
key | Yes | WHERE clause |
Enclose each keyword's value in at signs (@).
Syntax
MESHGEOM(
schema(@<schema_name>@),
table(@<table_name>@),
column(@<column_name>@),
key(@<where_clause>@)
)Example
MESHGEOM(
schema(@public@),
table(@mytable@),
column(@mycolumn@),
key(@id=1@)
)