TOC PREV NEXT INDEX

Read_Geom

Synopsis

read an AVS geometry (.geom file) and output an AVS/Express field

Input Port

parent

UIconnection

user interface parent object

Parameters

Read GEOM Filename

UIfileSBinput

geometry file selection

Output Port

field

Field

output field data

geom

DataObject

output renderable object

Description

Read_Geom reads an Application Visualization System geometry format file (.geom suffix) and converts it into an AVS/Express Field.

Input

parent

A port to connect to a user interface object that contains the macro's widgets. By default, it is connected to the default user interface object in the application in which the macro is instanced. (This default connection is not drawn in the NE.)

Parameters

Read Geom Filename

UIfileSB file browser. Selects the disk file to input and convert. The default search pattern is $XP_PATH<0>/data/geom/*.geo. The restriction of filetype to a 3 character suffix is required for portability to the PC.
The input file is an AVS_.geom-format binary file, such as the file the AVS Geometry Viewer's Save Object button produces. The file can contain up to 1024 separate geometries.
The types of AVS geometry objects supported are: GEOM_POLYTRI, GEOM_POLYHEDRON, GEOM_MESH and GEOM_SPHERE. Geometry type GEOM_LABEL is not supported.
The input can contain per-vertex normal, color, radii, and texture coordinates (2D uvs or 3D uvws, not both). Vertex transparency information is ignored.

Output Port

field

This output is a new field object containing cellsets to represent each of the supported geometry types. Input types GEOM_POLYHEDRON and GEOM_MESH are converted to GEOM_POLYTRI with both surface (polytriangle strip) and wireframe (polyline or disjoint line) representations before processing. The data from all geometries in the input file is concatenated into one AVS/Express field.

Mesh

The number of nodes is the aggregate number of vertices for all supported input geometries, after GEOM_MESHs and GEOM_POLYHEDRONs have been converted to GEOM_POLYTRIs.

The unstructured mesh consists of:

Grid

nnodes equal to the total number of vertices
nspace equal 3
Data_Array consisting of the locations of the vertices
(nvals = nnodes, veclen = 3, units = "inches")

Cells

ncell_sets in the range 1-4
An array of up to 4 cellsets, possibly one for each of these cell types:

____Polytri_____Polyline_____Line_____Point

The types of cellsets appearing in the output is determined by the union of geometry types in the input. For example, the Polytri cellset will contain the surface information from all AVS GEOM_POLYHEDRON, GEOM_MESH and GEOM_POLYTRI input geometries.The full mapping of AVS geometry types to AVS/Express field cellsets is

AVS geometry types

Polytri

Polyline

Line

Point

GEOM_POLYHEDRON

·

 

·

 

GEOM_MESH

·

·

 

 

GEOM_POLYTRI

·

·

·

 

GEOM_SPHERE

 

 

 

·

Polytri cellset

ncells equal to the number of polytriangle strips
node_connect_list that is the polytriangle strip connectivity
ncell_data = 0 (no cell_data)

Polyline cellset

ncells equal to the number of polylines
node_connect_list that is the polyline connectivity
ncell_data = 0 (no cell_data)

Line cellset

ncells equal to the number of line vertices/2 (number of lines)
node_connect_list that is the disjoint line connectivity
ncell_data = 0 (no cell_data)

Point cellset

ncells equal to the number of spheres
node_connect_list that is a list of the points
ncell_data = 0 (no cell_data)

Node_Data

Vertex data can be associated with AVS geometry types as indicated in the following table.

AVS geometry types

Colors

Normals

Texture

Radii

GEOM_POLYHEDRON

·

·

·

 

GEOM_MESH

·

·

·

 

GEOM_POLYTRI

 

 

 

 

____tristrips

·

·

·

 

____polylines

·

 

 

 

____disjoint lines

·

 

 

 

GEOM_SPHERE

·

 

 

·

Any type of node data can be associated with any cell set in AVS/Express, but some combinations do not make sense and are ignored by the viewers.

nnodes

The total number of nodes in the output field, equal to the sum of nodes in each of the cellsets: Polytri + Polyline + Line + Point

nnode_data

The number of per-vertex data items present. This will be in the range 0-4, one for each of: normals data, color data, radius data, texture coordinate data (2D uvs or 3D uvws). The uvs and uvws texture coordinates are mutually exclusive, only one of these can be present in the output geometries.

Per-vertex transparency data in the input geometry is ignored.

Data_Array

An array of nnode_data data arrays, one for each of normals data, color data, radius data, and texture data, as present in the input geometries:

normals

nvals equal to nnodes
veclen equal to 3 (x, y, z)
id equal to GD_NORMAL_NODE_DATA_ID
DTYPE_FLOAT values array

colors

nvals equal to nnodes
veclen equal to 3 (red, green, blue)
id equal to GD_COLOR_NODE_DATA_ID
DTYPE_FLOAT values array

radii

nvals equal to nnodes
veclen equal to 1 (radius)
id equal to GD_RADIUS_NODE_DATA_ID
DTYPE_FLOAT values array

uvs

nvals equal to nnodes
veclen equal to 2 (u, v)
id equal to GD_UV_NODE_DATA_ID
DTYPE_FLOAT values array

uvws

nvals equal to nnodes
veclen equal to 3 (u, v, w)
id equal to GD_UV_NODE_DATA_ID
DTYPE_FLOAT values array

geom

This is a renderable DataObject referencing the field output data.

The DataObject is a single graphical object, with no children. The name of the object is simply the input file basename. For example, the input file:

$XP_PATH/data/geom/teapot.geo

will generate a DataObject called teapot. If the output port is connected directly to a Viewer3D, then exactly one object will appear in the graphics hierarchy, and the name teapot will appear:

in the Object Selector browser under the ViewEditors menu

echoed in the border of the Viewer3D window for the current object

If there is more than one geometry in the input file, all the geometry data is concatenated into one output field. The DataObject geom output references this field.

The AVS/Express DataObject is the basic unit for rendering control. Rendering attributes include Modes, Properties and Colors. Building a single DataObject for all the input geometries means that the whole model read from file is rendered with a common set of attributes. This contrasts with the Read Geoms module, which builds a hierarchy of DataObjects, with one member of the hierarchy for each input geometry. Read Geoms allows each input geometry to have independent rendering attributes within AVS/Express.

All AVS .geo files supplied with AVS/Express contain one geometry, except these which contain two geometries:

crambin.geo, sphere atoms with disjoint line atomic bonds

math.geo, mesh surface/grid with disjoint line bounding box

Example

Libraries.Examples.Graphics_Display.GDtut_2
v/dv_examp/GDtut2.v
and many others in Libraries.Examples.Graphics_Display and examples

File

v/modules.v
The V pre-processor symbols ACKIT or AC_KIT_V1 must be defined for the loading of v/modules.v , in order to access the Read Geom module. These symbols are usually defined in include/$MACHINE/config.h, and this file is included directly by v/modules.v .

See also related modules

Read_Geoms
Read_Image
Read_Geom
Read_Volume

TOC PREV NEXT INDEX