Synopsis
read an AVS geometry (.geom file) and output AVS/Express fields
Input Port
parent |
UIconnection |
user interface parent object |
Parameters
Read GEOM Filename |
UIfileSB |
input geometry file selection |
Output Ports
field |
Field[] |
array of fields, geometrical data |
geom |
DataObject |
renderable object hierarchy for the fields |
Description
Read_Geom reads an Application Visualization System geometry format file (.geom suffix) and converts it into an array of AVS/Express Fields.
Input Port
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 Network Editor.)
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_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 Ports
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.
For each field in the array:
Mesh
The unstructured mesh consists of:
Grid
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")
Cells
AVS geometry types
|
Polytri
|
Polyline
|
Line
|
Point
|
GEOM_POLYHEDRON |
· |
|
· |
|
GEOM_MESH |
· |
· |
|
|
GEOM_POLYTRI |
· |
· |
· |
|
GEOM_SPHERE |
|
|
|
· |
Polytri cellset
Polyline cellset
Line cellset
Point cellset
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, texture data (2D uvs or 3D uvws), as present in the input geometries.
normals
colors
radii
uvs
uvws
geom
This 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