IVCON
3D Graphics File Conversion
IVCON
is a C++ program which
reads and writes a small
variety of 3D graphics file formats, converting from one to the other.
This is by no means a
perfect or even correct program! It was home-grown, and developed,
as needed, to handle a particular set of files. It can make mistakes,
or crash, rather more often than software you pay for, written by
someone who knows what they're doing.
The supported formats include:
-
3DS
AutoCAD 3D Studio Max binary files;
-
ASE
AutoCAD ASCII export files;
-
BYU Movie.BYU surface geometry files;
-
DXF
AutoCAD DXF files;
-
GMOD
Golgotha GMOD files;
-
HRC
SoftImage hierarchical files;
-
IV
SGI Inventor files;
-
OBJ - a file format from Alias (
http://www.alias.com/eng/index.shtml)
-
OFF
GEOMVIEW OFF files;
-
POV
Persistence of Vision files (output only);
-
SMF
Michael Garland's format for his QSLIM program;
-
STL/STLA
ASCII Stereolithography files;
-
STLB
binary Stereolithography files;
-
TEC
TECPLOT files (output only);
-
TRI/TRIA
a simple ASCII triangle format requested by Greg Hood;
-
TRIB
a simple binary triangle format requested by Greg Hood;
-
TXT
a text dump (output only);
-
UCD
Advanced Visual Systems (AVS) Unstructured Cell Data
(output only);
-
VLA
Evans and Sutherland
Digistar II VLA files for planetariums;
-
WRL
WRL/VRML (Virtual Reality Modeling Language) files (output only).
-
XGL
the XGL format, based on the XML language and OpenGl graphics
(output only).
The program can be used in command line form, as in:
ivcon input.iv output.stl
or can be used in an interactive mode, in which input and output
files can be read or converted in any order.
Graphics file formats are 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.
Helpful corrections to the 3DS reader were supplied by John F Flanagan.
The GMOD reader and writer were written and supplied by
Zik Saleeba.
Improvements to the DXF routines to handle polygon oriented files
were supplied by Zik Saleeba. The 3DS reader is based on a program
by Martin van Velsen, with the help of Gert van der Spoel.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Related Data and Programs:
IVREAD,
a FORTRAN90 program which
can convert some 3D graphics 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.
Reference:
-
Adrian Bowyer and 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.
-
3D Systems, Inc,
Stereolithography Interface Specification,
October 1989.
Source Code:
Examples and Tests:
-
IVCON converts various 3D graphics files.
-
MAIN is the main program for converting graphics files.
-
ASE_READ reads an AutoCAD ASE file.
-
ASE_WRITE writes graphics information to an AutoCAD 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 true if two characters are equal, disregarding case.
-
CH_INDEX_LAST finds the last occurrence of a character in a string.
-
CH_IS_SPACEis TRUE if a character represents "white space".
-
CH_PAD "pads" a character in a string with a blank on either side.
-
CH_READ reads one character from a binary file.
-
CH_TO_DIGIT returns the integer value of a base 10 digit.
-
CH_WRITE writes one character to a binary file.
-
COMMAND_LINE carries out a command-line session of file conversion.
-
COR3_NORMAL_SET computes node normal vectors.
-
COR3_RANGE computes the coordinate minima and maxima.
-
DATA_CHECK checks the input data.
-
DATA_INIT initializes the 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.
-
DXF_READ reads an AutoCAD DXF file.
-
DXF_WRITE writes graphics information to an AutoCAD DXF file.
-
EDGE_COUNT determines the number of edges in a graph.
-
EDGE_NULL_DELETE deletes face edges with zero length.
-
FACE_AREA_SET computes the area of the faces.
-
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_SUBSET selects a subset of the current faces as the new object.
-
FACE_TO_LINE converts face information to line information.
-
FACE_TO_VERTEX_MAT extends face material definitions to vertices.
-
FILE_EXT picks out the extension in a file name.
-
FLOAT_READ reads 1 float from a binary file.
-
FLOAT_REVERSE_BYTES reverses the four bytes in a float.
-
FLOAT_WRITE writes 1 float to a binary file.
-
GMOD_ARCH_CHECK inquires into some features of the computer architecture.
-
GMOD_READ reads a golgotha GMOD file.
-
GMOD_READ_FLOAT reads a float from a Golgotha GMOD file.
-
GMOD_READ_W16 reads a 16 bit word from a Golgotha GMOD file.
-
GMOD_READ_W32 reads a 32 bit word from a Golgotha GMOD file.
-
GMOD_WRITE writes a Golgotha GMOD file.
-
GMOD_WRITE_FLOAT writes a float to a Golgotha GMOD file.
-
GMOD_WRITE_W16 writes a 16 bit word to a Golgotha GMOD file.
-
GMOD_WRITE writes a 32 bit word to a Golgotha GMOD file.
-
HELLO prints an explanatory header message.
-
HELP prints a list of the interactive commands.
-
HRC_READ reads graphics information from a SoftImage HRC file.
-
HRC_WRITE writes graphics data to an HRC SoftImage file.
-
I4_MAX returns the maximum of two I4s.
-
I4_MIN returns the smaller of two I4's.
-
I4_MODP returns the nonnegative remainder of integer division.
-
I4_WRAP forces an integer to lie between given limits by wrapping.
-
INIT_PROGRAM_DATA initializes the internal program data.
-
INTERACT carries on an interactive session with the user.
-
IV_READ reads graphics information from an Inventor file.
-
IV_WRITE writes graphics information to an Inventor file.
-
I4VEC_MAX returns the maximum element in an I4VEC.
-
LONG_INT_READ reads a long int from a binary file.
-
LONG_INT_WRITE writes a long int to a binary file.
-
NEWS reports the program change history.
-
NODE_TO_VERTEX_MAT extends node material definitions to vertices.
-
OBJ_READ reads a Wavefront OBJ file.
-
OBJ_WRITE writes a Wavefront OBJ file.
-
OFF_READ reads a GEOMVIEW OFF file.
-
OFF_WRITE writes graphics information to a GEOMVIEW OFF file.
-
POV_WRITE writes graphics information to a POV file.
-
RCOL_FIND finds if a vector occurs in a table.
-
RGB_TO_HUE converts (R,G,B) colors to a hue value between 0 and 1.
-
S_EQI reports whether two strings are equal, ignoring case.
-
S_LEN_TRIM returns the length of a string to the last nonblank.
-
S_TO_I4 reads an I4 from a string.
-
S_TO_I4VEC reads an I4VEC from a string.
-
S_TO_R4 reads an R4 from a string.
-
S_TO_R4VEC reads an R4VEC from a string.
-
SHORT_INT_READ reads a short int from a binary file.
-
SHORT_INT_WRITE writes a short int to a binary file.
-
SMF_READ reads 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 an ASCII STL (stereolithography) file.
-
STLA_WRITE writes an ASCII STL (stereolithography) file.
-
STLB_READ reads a binary STL (stereolithography) file.
-
STLB_WRITE writes a binary STL (stereolithography) file.
-
TDS_PRE_PROCESS divides the monolithic object into acceptably small pieces.
-
TDS_READ reads a 3D Studio MAX binary 3DS file.
-
TDS_READ_AMBIENT_SECTION ???
-
TDS_READ_BACKGROUND_SECTION ???
-
TDS_READ_BOOLEAN ???
-
TDS_READ_CAMERA_SECTION ???
-
TDS_READ_EDIT_SECTION ???
-
TDS_READ_KEYFRAME_SECTION ???
-
TDS_READ_KEYFRAME_OBJDES_SECTION ???
-
TDS_READ_LIGHT_SECTION ???
-
TDS_READ_U_LONG_INT ???
-
TDS_READ_LONG_NAME ???
-
TDS_READ_MATDEF_SECTION ???
-
TDS_READ_MATERIAL_SECTION ???
-
TDS_READ_NAME ???
-
TDS_READ_OBJ_SECTION ???
-
TDS_READ_OBJECT_SECTION ???
-
TDS_READ_TEX_VERTS_SECTION reads the texture vertex data.
-
TDS_READ_TEXMAP_SECTION tries to get the TEXMAP name from the TEXMAP section.
-
TDS_READ_U_SHORT_INT ???
-
TDS_READ_SPOT_SECTION ???
-
TDS_READ_UNKNOWN_SECTION ???
-
TDS_READ_VIEW_SECTION ???
-
TDS_READ_VP_SECTION ???
-
TDS_WRITE writes graphics information to a 3D Studio Max 3DS file.
-
TDS_WRITE_STRING ???
-
TDS_WRITE_U_SHORT_INT ???
-
TEC_WRITE writes graphics information to a TECPLOT file.
-
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 an axis rotation to the geometric transformation matrix.
-
TMAT_ROT_VECTOR applies a rotation about a vector to the 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 an ASCII triangle file.
-
TRIA_WRITE writes the graphics data to an ASCII "triangle" file.
-
TRIB_READ reads a binary triangle file.
-
TRIB_WRITE writes the graphics data to a binary "triangle" file.
-
TXT_WRITE writes the graphics data to a text file.
-
UCD_WRITE writes graphics data to an AVS UCD file.
-
VERTEX_NORMAL_SET recomputes the face vertex normal vectors.
-
VERTEX_TO_FACE_MATERIAL extends vertex material definitions to faces.
-
VERTEX_TO_NODE_MATERIAL extends vertex material definitions to nodes.
-
VLA_READ reads a VLA file.
-
VLA_WRITE writes internal graphics information to a VLA file.
-
WRL_WRITE writes graphics data to a WRL file.
-
XGL_WRITE writes an XGL file.
You can go up one level to
the graphics source codes.
Last revised on 15 November 2006.