tri_mesh, quad_mesh, polytri_mesh


Synopsis

mesh mappers that create meshes containing Tri, Quad or Polytri cells from coordinate and connectivity arrays

Input Ports

coord

float[nnodes][nspace]

coordinates of objects

connect

int[nnodes * cell_nnodes]

node connectivity list

 

Output Ports

out

Mesh

obj

output renderable object

 

Description

Each of these macros creates a mesh containing cells (geometric objects), given arrays containing the locations of the nodes in space and their connectivity. These macros simplify the process of generating field data by reducing the amount of data you must supply to create a field. Usually the output of one of these macros is combined, using combine_mesh_data, with the output of one of the data mapper macros to create a field.

polytri_mesh creates a mesh containing a cell set of type Polytri. This may contain multiple polytriangle strips.

tri_mesh creates a mesh containing a cell set of type Tri.

quad_mesh creates a mesh containing a cell set of type Quad.

Input Ports

coord

float[nnodes][nspace]. This array specifies the coordinates of the vertices of the cells. Their connectivity (for example, into quads or triangles) is specified in the connect array. For example, coord[4][2]={{0,0}, {1,0}, {1,1}, {0,1}} creates four vertices at the corners of the unit square in 2-space. In 3-space, you can add a Z coordinate value to each of the subarrays.

connect

int[nnodes * cell_nnodes]. For each cell, this array specifies which node in the coord array describes each vertex of that cell. The layout is by cells, with the nodes of each cell specified in the canonical cell order.

 

For example, to specify a square using the example coordinates above, provide the quad_mesh macro with connect[4]={0,1,2,3}. To specify two triangles using the example coordinates above, provide the tri_mesh macro with connect[6]={0,3,2,0,2,1}. Note that in this last case there are two triangles of three vertices each, giving six entries in the array. The triangles are specified in a counterclockwise order, as required for the canonical triangle vertex ordering.

The polytri_mesh macro treats the connect array differently. Elements of the connect array are taken in pairs; each pair representing the start and end indices into the coordinates array for one polytriangle. If a coord array of dimensions [12][2] were provided, a connect array of the form connect[4] = {0,4,5,11} would produce two polytriangle strips: the first would contain triangles with coordinate indices {{0,1,2},{1,2,3},{2,3,4}} and the second would contain triangles with coordinate indices {{5,6,7},{6,7,8},{7,8,9},{8,9,10},{9,10,11}}.

Parameters

none

Output Ports

out

Mesh. Contains the mesh described by the input arrays.

obj

Renderable object corresponding to out.

Example

Not available.

File

v/fld_map.v

See also

Related modules