Reads GOCAD files and re-scales the data along the x, y and z axis.
module ReadGOCAD <src_file="gocad.cxx", libdeps="FLD", cxx_hdr_files="fld/Xfld.h"> { GocadParams &group_ref<NEportLevels={2,0},export=2>; boolean scale<export=2> => group_ref.scale; string file_name<export=2> => group_ref.file_name; float x<export=2> => group_ref.x; float y<export=2> => group_ref.y; float z<export=2> => group_ref.z; Grid Grid<export=2> { nspace = 3; coordinates { min => ; max => ; }; }; Cells Cells<export=2> { ncell_sets = 1; cell_set = { { cell_nnodes=3,poly_flag=0,cell_order=1,cell_ndim=2 } }; }; Xform Xform<export=2>; Mesh &Mesh<NEportLevels={0,2},export=2> => merge(.Grid,.Cells,.Xform); cxxmethod+notify_inst+req update<export=2>( Grid+write, Cells+write, scale+read+notify+req, x+read+notify+req, y+read+notify+req, z+read+notify+req, file_name+read+notify+req ); };
ReadGOCAD reads the contents of one GOCAD file, and converts this to a Mesh (Xform+Cells+Grid), suitable for input into a DataObject module. The module ignores all other lines from the GOCAD file except for vertices and triangles. It scans each line for the appropriate keywords. If the the line contains "VRTX", then it reads the id, and the position x, y, z. If the line contains "TRGL", it reads three index numbers for which set of vertices to tie together as a triangle. Axis specific scaling is achievable by using the floating point parameters x,y and z.
&group_ref
Reference to the GocadParams parameter block.
Mesh (Xform+Cells+Grid)
The output field contains scaled/not scaled data, suitable for input into a DataObject. This can be viewed using either a 2D or 3D Uviewer.
The low-level ReadGOCAD is used in the Functional Macro Gocad and the User Macro read_gocad. Additionally, these macros also use the GocadParams parameter block group object, as does the GocadUI UI Macro.
An example application ReadGocadEg is provided, which uses the sample data file worldmap.tsurf, to display a picture of the world.
iac_proj/rdgocad/goc_mods.v contains the GocadParams group and the ReadGocad module V definitions.
By default the low-level library GocadMods, inherits its process as express. See the README file for details.
AVS5 version Ian Curington, AVS/UNIRAS Ltd. Ported to AVS/Express by Justin Greenhalgh Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester UK M13 9PL
GocadParams, Gocad, GocadUI and read_gocad.