Geom to Wavefront

Name

 		Geom to Wavefront

Synopsis

 	Write AVS geometries to Wavefront object (.obj) files.

Author

 	Steve Chall, Visualization Group, North Carolina Supercomputing
		Center, Information Technologies Division, MCNC, RTP, NC
		(stevec@ncsc.org).

Type

   	Data output

Input

Port:   	GEOMedit_list

Output

Ports:  	None

Parameter

  	Name:  outFNameBase; Type:  string; Default:  "fromAVS" 
Source: 	geom2wave.c

Description

"Geom to Wavefront" accepts as input an AVS GEOMedit_list struct
		which contains a pointer to a linked list of GEOMedit structs.
		 The list is traversed and each element which is of type
		GEOM_EDIT_GEOMETRY is examined to determine its GEOMobj type--as
		opposed to GEOMedit type--where the possible types are mesh,
		polyhedron, polytriangle strip array, sphere, or label.  An
		equivalent Wavefront .obj file is written to disk for each
		polyhedron and polytri in the edit list.  Note that a single AVS
		geometry may map to multiple .obj files.
		Conversion of label, mesh, and sphere objects to Wavefront 
		format is not implemented.  It would probably be fairly simple
		to add mesh conversion by calling either GEOMcvt_mesh_to_polytri
		or GEOMcvt_mesh_to_polyh (AVS-supplied functions) on the mesh
		geometry, and then invoking the appropriate geom2wave subroutine		on the data structure returned.
		The name of the Wavefront-format output file is created by
		concatenating the string value of the outFNameBase module
		parameter with the number of the element to be converted in the
		edit list (unconverted elements, i.e., labels, meshes, and
		spheres, are not counted) and with the standard ".obj" filename
		extension.  Thus, the third polyhedron in an edit list might be
		written out (using the default parameter value) as a file called
		"fromAVS.3.obj".
		Even for polytris and polyhedra, not all the data in the
		geometry structs is necessarily converted, e.g., vertex color
		and texture mapping data are ignored.  For polytris, vertex
		coordinates, connectivity (implicit in the ordering of triangles
		in each strip), and vertex normals (if present) are converted.
		For polyhedra, conversion is performed on vertex coordinates and
		on the explicit connectivity information characteristic of this
		data type.
		After opening the object in Wavefront's Model application, it
		may be necessary to clean it up, for instance by "fixing the
		database" (identifying and eliminating bad and duplicate
		elements), autosmoothing, and welding vertices.
		For more info on AVS geometry, see Jeff Vroom's AVS Technote
		"Interpreting GEOM Information" from the Proceedings of AVS '92,
		RTP, NC.

Example

The following network reads an AVS geometry file, and writes out
		the corresponding Wavefront object file.
  
		       read geom
			   |
			   |
			   |
			   |
		   Geom to Wavefront