![]() |
![]() |
![]() |
![]() |
Read_Geoms
Synopsis
read an AVS geometry (.geom file) and output AVS/Express fields
Input Port
Parameters
Output Port
Description
Read_Geoms reads an Application Visualization System geometry format file (.geom suffix) and converts it into an array of AVS/Express Fields.
Input
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 Network Editor.)
Parameters
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_LABEL, GEOM_MESH and GEOM_SPHERE.
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
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.
This output is a new array of fields. Each field element corresponds to one input geometry object from the AVS geometry file. Each field contains cellsets to represent the geometry data from the input object. 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 number of nodes is the number of vertices for the input geometry, after GEOM_MESHs and GEOM_POLYHEDRONs have been converted to GEOM_POLYTRIs.
The unstructured mesh consists of:
nnodes equal to the number of vertices for this object
nspace equal 3
Data_Array consisting of the locations of the vertices
(nvals = nnodes, veclen = 3, units = "inches")The number and type of cellsets appearing in each output field is determined by the geometry type for the corresponding input object. For example, a GEOM_MESH input object will require two cellsets in the output field: Polytri and Polyline. The full mapping of AVS geometry types to AVS/Express field cellsets is:
ncells equal to the number of polytriangle strips
node_connect_list that is the polytriangle strip connectivity
ncell_data = 0 (no cell_data)ncells equal to the number of polylines
node_connect_list that is the polyline connectivity
ncell_data = 0 (no cell_data)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)ncells equal to the number of spheres
node_connect_list that is a list of the points
ncell_data = 0 (no cell_data)Vertex data can be associated with AVS geometry types as indicated in the following table.
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.
The total number of nodes in the output field, equal to the sum of nodes in each of the cellsets: Polytri + Polyline + Line + Point
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.
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:
nvals equal to nnodes
veclen equal to 3 (x, y, z)
id equal to GD_NORMAL_NODE_DATA_ID
DTYPE_FLOAT values arraynvals equal to nnodes
veclen equal to 3 (red, green, blue)
id equal to GD_COLOR_NODE_DATA_ID
DTYPE_FLOAT values arraynvals equal to nnodes
veclen equal to 1 (radius)
id equal to GD_RADIUS_NODE_DATA_ID
DTYPE_FLOAT values arraynvals equal to nnodes
veclen equal to 2 (u, v)
id equal to GD_UV_NODE_DATA_ID
DTYPE_FLOAT values arraynvals equal to nnodes
veclen equal to 3 (u, v, w)
id equal to GD_UV_NODE_DATA_ID
DTYPE_FLOAT values arrayThis is a renderable DataObject hierarchy referencing the array of fields output data.
The output DataObject is a local top object with one child DataObject for each input geometry. The top object itself does not reference any geometric field data. If there is only one geometry in the input file, the geom output contains the top DataObject with one child. The names of the DataOobjects are derived from the input file basename. The DataObjects are labelled with suffices:
basename.Top for the local top DataObject
basename.objN for each child DataObject,
where N = 0, 1 ... (number of input objects - 1)
If the geom output is connected to a Viewer3D, then the DataObject names will appear:
in the Object Selector browser under the ViewEditors menu
echoed in the border of the Viewer3D window for the current object
The AVS/Express DataObject is the basic unit for rendering control. Building each output geometry object as a seperate field means the rendering attributes can be specified independently for each object. These attributes include Modes, Properties and Colors.
This is in contrast to the Read Geom module, which concatenates all input geometries into one output field and DataObject. Read Geom forces the whole geometric model read from the input file to have common rendering attributes.
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
The input file $XP_PATH/data/geom/crambin.geo contains two AVS geometries:
GEOM_SPHERE with spheres representing the atoms
GEOM_POLYTRI with disjoint lines representing the atomic bonds
The corresponding Read Geoms field output contains 2 field elements:
field[0] for the atoms data, with one Point cellset
field[1] for the bonds data, with one Line cellset
The file basename is crambin. The top DataObject in the geom output is called crambin.Top, it has two child DataObjects named crambin.obj0 and crambin.obj1:
![]()
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 Geoms 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
![]() |
![]() |
![]() |
![]() |