point_mesh, line_mesh, line_disjoint_mesh, polyline_mesh


Synopsis

mesh mappers that create meshes containing Point, Line or Polyline cells from coordinate and connectivity arrays

Input Ports

coord

float[nnodes][nspace]

coordinates of objects

connect

int[nnodes * cell_nnodes]

node connectivity list (not used for point_mesh)

coord1

float[nlines][nspace]

start coordinates of lines (line_disjoint_mesh only)

coord2

float[nlines][nspace]

end coordinates of lines (line_disjoint_mesh only)

 

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.

point_mesh creates a mesh containing a cell set of type Point.

line_mesh creates a mesh containing a cell set of type Line.

line_disjoint_mesh creates disjoint lines in a cell set of type Line. It accepts two arrays, one with the start coordinates and one with the end coordinates for each line.

polyline_mesh creates a mesh containing a cell set of type Polyline. This cell set can contain multiple disconnected polylines.

Input Ports

coord

float[nnodes][nspace]. This array specifies the coordinates of the vertices of the cells. Their connectivity (for example, into lines or polylines) 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 the letter Z as three lines using the line_mesh macro using the example coords above, you can specify connect[6]={0,1,1,3,3,2}. The first line uses vertices 0 and 1, the second 1 and 3, and the third 3 and 2.

The polyline_mesh macro treats the connect array differently, since it generates multiple polylines. Elements of the connect array are taken in pairs; the first and second elements are start and end indices into the coordinates array, producing a set of coordinates for each polyline strip. Polylines are drawn as connected line segments from the first coordinate to the last coordinate. So, to draw a backward C-shaped polyline using the example coords, above, you can specify connect[2]={0,3}. This uses all four coordinates in a single polyline.

coord1, coord2

line_disjoint_mesh differs from the other *_mesh macros because it uses two coord arrays--coord1 and coord2, instead of coord and connect. Line segments are created between corresponding elements of the two arrays, which must have the same length.

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