avs2vrml - convert and save an avs geometry to a VRML file

Name

	avs2vrml - convert and save an avs geometry to a VRML file

Summary

	Name	avs2vrml
	Author	John Evans
		Atlantic Marine Geology
		United States Geological Survey
			
	Type	render
	Input	geometry
	Output	*.wrl file
	Parameters	Name		  Type		  Default
			Filename	  string	  "fname.wrl"     
			draw_polylines	  toggle switch	  false	
			draw_djpolylines  toggle switch	  false
			draw_ascii	  toggle switch	  false

Description

	The avs2vrml module saves an AVS geometry data structure as an
	equivalent VRML Version 1.0 compliant *.wrl file.  Meshes,
	polyhedrons, spheres, and polytriangles are fully-supported.
	Labels don't quite work yet.
   

Inputs

	Geometry (required; geometry) 
		An AVS geometry, created with the libgeom library or by
		another AVS module. 

Parameters

	Filename
		The name of the file the converted geometry should be stored.
     
	draw_polylines
		Toggle switch to indicate whether or not polylines
		should be drawn as part of the polytriangle geometry.
		Default is false.
	draw_djpolylines
		Toggle switch to indicate whether or not disjoint polylines
		should be drawn as part of the polytriangle geometry.
		Default is false.
	draw_ascii
		Toggle switch to indicate whether or not the AVS
		label geometry type should be attempted.  The text is
		not positioned very well, so the user would have to edit
		the *.wrl file until an acceptable orientation is found.  
		Default is false.
 

Outputs

	
	-

Limitations

EXAMPLES and EFFICIENCY CONSIDERATIONS
	The reason for the toggle switches is that some VRML viewers
	currently don't support IndexedLineSets *with color* very well.
	The resulting *.wrl file tends to look bad, kind of like
	crumpled wax paper.  As viewers get better, this problem should
	disappear.  The AVS Label geometry has posed certain problems
	I've not been able to solve yet, as mentioned above, hence the
	reason for a toggle switch in this case. 
	In this example, a geometry is read by READ GEOM displayed by the 
	Geometry Viewer and converted by avs2vrml.
		READ GEOM
		    |___________________
		    |			|
		AVS2VRML        GEOMETRY VIEWER
	AVS does not currently support multiple geometry connections for
	user-written modules, so a work-around is needed for networks
	with several geometry-producing modules.  This work-around is a
	utility called "vrmlcat", and is included with this
	distribution.  The use of vrmlcat is demonstrated by the
	following example.
		READ GEOM                            READ GEOM
		    |____________________________________|
		    |			|                |
		AVS2VRML        GEOMETRY VIEWER      AVS2VRML
	Each avs2vrml module will produce it's own *.wrl file.  After
	the network has run to completion, the user can scoop up all the
	component *.wrl files into a single master *.wrl file by typing
	from the command line
	> vrmlcat -o master.wrl component1.wrl component2.wrl ... 
	or, perhaps easier,
	> ls *.wrl | vrmlcat -o master.wrl
	Note that each component.wrl file is by itself a valid VRML
	file.  If you run the network multiple times, be sure to delete
	your old *.wrl files, otherwise the 2nd invocation method of
	vrmlcat will suck them into your master.wrl file, increasing
	its size greatly, and you might not be able to detect it from
	your VRML viewer except for the fact that rendering will be
	getting slower and slower and slower...
	
	The rendering of *.wrl files containing a large number of
	spheres tends to be glacially slow.   
RELATED	MODULES
	read geom, and all modules producing geometry 
Release	1.0			  			 avs2vrml(6)