IVREAD
3D Graphics File Conversion
IVREAD
is a FORTRAN90 program which
reads a 3D graphics file and converts the information
to another format.
IVREAD was originally written to read SGI Inventor 3D graphics
files and convert them to Digistar VLA format. Since then, the program
has evolved to allow the input and output of:
There is also a simpleminded facility to project any 3D image
onto a 2D plane, and make a
PostScript image of the result.
Graphics file formats are often poorly documented; hence this program
was written primarily by examining typical files and struggling
to interpret them. Particularly in the case of Inventor and DXF
files, the program is not able to handle all the subtleties of
the file format, and may mangle data, or even crash.
Usage:

ivread input.ext output.ext

converts input.ext to output.ext, where
the input and output formats are determined by the
file name extensions.

ivread

if no files are specified, an interactive dialog
is set up, and the user can specify the files to
be converted.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
IVREAD is available in
a FORTRAN90 version.
Related Data and Programs:
GRF_IO,
a FORTRAN90 library which
can read or write a GRF file.
IVCON,
a C++ program which
reads 3D graphics file information in a variety of formats,
and can output the same information in a different format.
OBJ_IO,
a FORTRAN90 library which
can read or write an OBJ file.
PBMA_IO,
a FORTRAN90 library which
can read or write an ASCII Portable Bit Map (PBM) file.
PGMA_IO,
a FORTRAN90 library which
can read or write an ASCII Portable Gray Map (PGM) file.
PLOT3D_IO,
a FORTRAN90 library which
can read or write a PLOT3D file.
PPMA_IO,
a FORTRAN90 library which
can read or write an ASCII Portable Pixel Map (PPM) file.
STLA_IO,
a FORTRAN90 library which
can read or write an ASCII Stereolithography file.
TEC_TO_FEM,
a FORTRAN90 program which
can read a TECPLOT file describing a
surface in 3D composed of triangles, and write
a set of FEM files.
TEC_TO_OBJ,
a FORTRAN90 program which
can read a TECPLOT file describing a
surface in 3D composed of triangles or quadrilaterals, and write
an OBJ file.
TEC_WRITE,
a FORTRAN90 library which
can write a TECPLOT file.
XYZ_IO,
a FORTRAN90 library which
reads and writes XYZ files.
Reference:

Adrian Bowyer, John Woodwark,
A Programmer's Geometry,
Butterworths, 1983.

James Foley, Andries van Dam, Steven Feiner, John Hughes,
Computer Graphics, Principles and Practice,
Addison Wesley, Second Edition, 1990.

Albert Nijenhuis, Herbert Wilf,
Combinatorial Algorithms,
Academic Press, 1978, second edition,
ISBN 0125192606.

3D Systems, Inc,
Stereolithography Interface Specification,
October 1989.
Source Code:
Tests and Examples:
List of Routines:

MAIN is the main program for IVREAD.

ANGLE_RAD_3D returns the angle in radians between two vectors in 3D.

ASE_READ reads graphics information from an ASE file.

ASE_WRITE writes graphics information to an ASE file.

BYU_READ reads graphics data from a Movie.BYU surface geometry file.

BYU_WRITE writes out the graphics data as a Movie.BYU surface geometry file.

CH_CAP capitalizes a single character.

CH_EQI is a case insensitive comparison of two characters for equality.

CH_IS_CONTROL reports whether a character is a control character or not.

CH_TO_DIGIT returns the integer value of a base 10 digit.

COMMAND_LINE works with command line parameters.

COR3_NORMAL_SET recomputes zero node normal vectors.

COR3_RANGE computes and prints the coordinate minima and maxima.

CROSS0_3D computes the cross product of (P1P0) and (P2P0) in 3D.

DATA_CHECK checks the input data, and enforces limits.

DATA_INIT initializes internal graphics data.

DATA_READ reads a file into internal graphics data.

DATA_REPORT gives a summary of the contents of the data file.

DATA_WRITE writes the internal graphics data to a file.

DEGREES_TO_RADIANS converts an angle from degrees to radians.

DIGIT_TO_CH returns the character representation of a decimal digit.

DOT0_3D computes the dot product of (P1P0) and (P2P0) in 3D.

DXF_READ reads graphics information from an AutoCAD DXF file.

DXF_WRITE writes graphics data to an AutoCAD DXF file.

EDGE_ADD_NODES adds the edge defined by two nodes to the edge list.

EDGE_BOUND reports the edges which are part of the boundary.

EDGE_COUNT determines the number of edges in a graph.

EDGE_MATCH_FACE seeks an edge common to a face and the edge list.

EDGE_MATCH_NODES seeks an edge of the form (N1,N2) or (N2,N1) in EDGE.

EDGE_NULL_DELETE deletes face edges with zero length.

ENORM_ND computes the Euclidean norm of a vector in ND.

ENORM0_3D computes the Euclidean norm of (P1P0) in 3D.

FACE_AREA_SET computes the area of the faces.

FACE_CHECK checks and analyzes a set of faces.

FACE_FLIP flips faces to achieve a consistent orientation.

FACE_NORMAL_AVE sets face normals as average of face vertex normals.

FACE_NULL_DELETE deletes faces of order less than 3.

FACE_PRINT prints out information about a face.

FACE_REVERSE_ORDER reverses the order of the nodes in each face.

FACE_SORT renumbers the faces in order of object and tier.

FACE_SUBSET selects a subset of the current faces as the new object.

FACE_TO_EDGE converts face data to edge data.

FACE_TO_LINE converts face information to line information.

FACE_TOUCH reports whether two polygonal faces touch.

FILE_GET_NEXT_WORD returns the next word and trailing context from a file.

FILE_NAME_EXT_GET determines the "extension" of a file name.

GET_UNIT returns a free FORTRAN unit number.

HELLO prints out a message about the program.

HELP prints out a help message about the interactive commands.

HRC_READ reads graphics information from a SoftImage HRC file.

HRC_WRITE writes graphics data to an HRC SoftImage file.

I4_MODP returns the nonnegative remainder of integer division.

I4_SWAP switches two integer values.

I4_TO_S_ZERO converts an integer to a string, with zero padding.

I4_WRAP forces an integer to lie between given limits by wrapping.

INFILE determines the input filename and type.

INTERACT interacts with the user to specify input and output files.

INTNEX "reads" integers from a string, one at a time.

IV_POINT_WRITE writes point and line data to an Inventor file.

IV_READ reads graphics information from an Inventor file.

IV_WRITE writes graphics data to an Inventor file.

I4VEC_MAX computes the maximum element of an integer array.

I4VEC_REVERSE reverses the elements of an I4VEC.

I4VEC_ROTATE rotates an object in place.

LCON reports whether a character is a control character or not.

MESH_T3 produces a grid of pairs of 3 node triangles.

NEWS prints out news (old and new) about the program.

NODE_RELAX smooths a shape by an averaging operation on the node positions.

NODE_TO_VERTEX_MATERIAL extends node material definitions to vertices.

OBJ_READ reads graphics information from a Wavefront OBJ file.

OBJ_WRITE writes graphics information to a WaveFront OBJ file.

OBJECT_BUILD builds edgeconnected "objects" out of polygonal faces.

OBJECT_INVERT makes an inverted duplicate of the object.

OFF_READ reads graphics information from a GEOMVIEW OFF file.

OFF_WRITE writes graphics information to a GEOMVIEW OFF file.

OOGL_READ reads graphics information from a OOGL file.

OOGL_GRID adds a grid to an OOGL data file.

OUTFILE determines the output filename and type.

PI returns the value of pi.

PLANE_EXP2IMP_3D converts an explicit plane to implicit form in 3D.

PLANE_IMP_POINT_NEAREST_3D: nearest point on a implicit plane to a point in 3D.

POINTS_DISTANCE_3D finds the distance between two points in 3D.

POLY_2_TRI converts a collection of polygons into a collection of triangles.

POV_WRITE writes graphics information to a POV file.

PROJECT_2D projects 3D data to 2D based on user choices.

PROJECT_ANGLE converts 3D data to 2D using a presentation angle.

PROJECT_OPLANE projects 3D points onto an orthographic plane.

PROJECT_PPLANE projects a point through a focus point onto a perspective plane.

PS_WRITE writes 2D face and line information to a PostScript file.

R4_RANDOM returns a random real in a given range.

R4_SWAP switches two R4's.

R4COL_FIND seeks a table column equal to a real vector.

RGB_TO_HUE converts (R,G,B) colors to a hue value between 0 and 1.

RELNEX "reads" real numbers from a string, one at a time.

R4VEC_TO_S "writes" an R4VEC into a string.

S_BLANK_DELETE removes blanks from a string, left justifying the remainder.

S_BLANKS_DELETE replaces consecutive blanks by one blank.

S_CAP replaces any lowercase letters by uppercase ones in a string.

S_CAT concatenates two strings to make a third string.

S_CONTROL_BLANK replaces control characters with blanks.

S_EQI is a case insensitive comparison of two strings for equality.

S_INDEX_LAST finds the LAST occurrence of a given substring.

S_IS_I4 returns .TRUE. if STRING represents an integer.

S_IS_R4 returns .TRUE. if STRING represents a real number.

S_TO_I4 reads an I4 from a string.

S_TO_R4 reads an R4 from a string.

S_TRIM_ZEROS removes trailing zeros from a string.

SMF_READ reads graphics information from an SMF file.

SMF_WRITE writes graphics information to an SMF file.

SORT_HEAP_EXTERNAL externally sorts a list of items into linear order.

STLA_READ reads graphics information from an ASCII StereoLithography file.

STLA_WRITE writes graphics information to an ASCII StereoLithography file.

TEC_WRITE writes graphics information to a TECPLOT file.

TIMESTAMP prints the current YMDHMS date as a time stamp.

TMAT_INIT initializes the geometric transformation matrix.

TMAT_MXM multiplies two geometric transformation matrices.

TMAT_MXP multiplies a geometric transformation matrix times a point.

TMAT_MXP2 multiplies a geometric transformation matrix times N points.

TMAT_MXV multiplies a geometric transformation matrix times a vector.

TMAT_ROT_AXIS applies a coordinate axis rotation to the geometric transformation matrix.

TMAT_ROT_VECTOR: arbitrary axis rotation to geometric transformation matrix.

TMAT_SCALE applies a scaling to the geometric transformation matrix.

TMAT_SHEAR applies a shear to the geometric transformation matrix.

TMAT_TRANS applies a translation to the geometric transformation matrix.

TRIA_READ reads graphics information from an ASCII triangle file.

TRIA_WRITE writes the graphics data to an ASCII "triangle" file.

TS_READ reads graphics information from a Mathematica TS file.

TS_WRITE writes graphics information to a Mathematica TS file.

TXT_WRITE writes the graphics data to a text file.

UCD_WRITE writes graphics data to an AVS UCD file.

VECTOR_UNIT_ND normalizes a vector in ND.

VERTEX_NORMAL_SET recomputes the face vertex normal vectors.

VERTEX_TO_NODE_MATERIAL extends vertex material definitions to nodes.

VLA_READ reads graphics information from a VLA file.

VLA_WRITE writes graphics data to a VLA file.

VRML_READ reads graphics information from a VRML file.

VRML_WRITE writes graphics data to a VRML file.

WORD_NEXT_READ "reads" words from a string, one at a time.

XGL_WRITE writes graphics data to an XGL file.

XYZ_READ reads graphics information from an XYZ file.

XYZ_WRITE writes graphics data to an XYZ file.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 15 November 2006.