write_pov, write_pov_GD, write_pov_ARR

Synopsis

Writes the contents of a field, a Graphic Display object (red renderable port) or a group of Graphic Display objects to a POVray version 3.1 file.

Input Ports

User Macro Name Type Description

write_pov in_fld Mesh+Cell_Set single set of field data
write_pov_GD obj GD Object single Graphic Display Object
write_pov_ARR top_obj GroupObject group of Graphic Display Objects

Description

These user macros all write data to POVray format files. The exact purpose of each of these three macros is described below:

These macros parse the appropriate input and then create an ASCII POV output file containing the Cell_Sets of certain 2D elements. The current implementation outputs triangle, quad, line, polyline and polytristrip cell sets. The module takes cell mesh topology from the input field structure and writes this data out to the POV file in a format suitable for processing by the POVray ray tracing software package.

The POVray software system is a ray-trace based rendering system for high quality image production and animation. The system is available on most common platforms. The POVray system is free, as long as the stated conditions are met. Full source code is also available for extension or ray tracing research. POVray software and further information can be obtained from: http://www.povray.org

The write_pov macro contains no source code from POVray, and does not need any of the POVray software available for module compilation or use. The POVray software is required for processing and rendering the output file. The files generated by this module are compatible with version 3.1 of POVray. They may also work with previous versions; however this has not been tested.

It should be noted that the generated POV files will require a certain amount of manual editing before they can be correctly rendered. Data about camera and light positions is stored in View and Scene objects. The macros take field data as a direct or indirect input and therefore cannot access this data. Sample data is written to the output file. Before the POV file can be rendered the camera and light positions will have to be altered so that they are appropriate for the scene.

The cell-set boundaries are preserved in the POV file format, and union blocks separate each field. Node data is ignored and only mesh geometry is passed to the file. This is done as the POVray system does not appear to allow per-node color values. Lines are defined as thin cylinders.

Inputs

Note that each of the user macros has a different input port.

in_fld - write_pov

Reference to a set of field data that should be written to the POV file. The field data should consist of Mesh and Cell_Set. Node data is not written to the output file.

obj - write_pov_GD

Reference to a Graphic Display object (red renderable port) that should be written to the POV file. The field data to be written is extracted from the supplied Graphic Display object.

top_obj - write_pov_ARR

Reference to a GroupObject (red renderable port) that should be written to the POV file. The GroupObject should contain a number of child Graphic Display objects. These are output as separate union blocks in the POV file. GroupObjects are generated by ARR library modules. They can also be created manually.

Outputs

(none)

Utility Modules

The User Macro write_pov uses the low-level module WritePovCore and the UI macro WritePovUI. As both of the other User Macros are derived from the write_pov macro they also make use of these components.

Example

Two example applications are provided. WritePovEg demonstrates the use of the write_pov user macro by generating an isosurface and writing that isosurface to a file. WritePovArrEg demonstrates the use of the write_pov_ARR user macro by loading a multiblock set of data and generating a series of visualizations. The isosurface can then be written to a file. If the resultant file is examined then it is apparent that the isosurface is written out in several chunks, one per block of data.

Files

iac_proj/wr_pov/wpovmacs.v contains the V definitions of the write_pov, write_pov_GD and write_pov_ARR User Macros, the WritePovUI UI Macro, and the example applications WritePovEg and WritePovArrEg.

Other Notes

The WritePovMacs library inherits its process. As this library contains no procedural code, the process is not important.

Author

Ian Curington
Advanced Visual Systems, Ltd.
Hanworth Lane, Chertsey Surrey, UK
KT16 9JX

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL

See Also

WritePovCore, WritePovUI, WritePovEg, WritePovArrEg, Write VGF, Write STL