
* dxftop3d is a utility that convert a valid DXF file to P3D file. 
* The utility does the following:

BUILDING DXFTOP3D:

Simply type 'make' to cause the dxftop3d executable to be built.  By
default, meshes are drawn using polygons.  This gives a closed
surface, but may not be what you want.  The compile-time switch
LINE_MESHES can be defined to cause meshes to be drawn with lines
instead.  See the Makefile for specific instructions.


USAGE INSTRUCTIONS:

dxftop3d takes one parameter, the name of a DXF-format file to
convert.  The generated P3D file is written to the standard output.
The command line is as follows:

% dxftop3d file.dxf > file.p3d

You can replace the colors produced by dxftop3d by editing the P3D
file and substituting a new color table.  For example, the file
stdmac256.p3d includes the Macintosh 'standard' color table;  it
can be inserted into a P3D file by replacing the obvious part of
the P3D file with the contents of this file.


ALGORITHM:

1. open the DXF input file, it should be of the form filename.txt
2. print  the header of the P3D file

3.  print the color-array of the P3D file

4.  print the P3D function definitions

5.  reads through the DXF entities data:LINEs, 3DFACEs, 
and POLYLINEs and print these data in two different methods:

DXFTOP3D_LINES.
prints DXF lines as P3D plines
prints DXF 3dfaces as P3D plines
prints DXF 3d polyline as a P3D pline
prints a DXF 3dpolygon mesh as P3D plines

DXFTOP3D_FACES
prints DXF lines as P3D pline
(if the line has been extruded, it prints it as a P3D 3dface)
prints DXf 3dfaces as P3D 3dface
prints closed DXF 3dpolyline as P3D pline
(if the 3d polyline has been extruded, it prints it as a P3D 3dface)
prints open 3dpolygon mesh as P3D mesh	

6. calculates the viewing information:
- lookat and lookfrom points
- hither and yon distances
Finally prints all viewing information.

KNOWN BUGS:

The DXF format doesn't specify which face of a polygon or mesh facet
is the 'front' face; P3D uses a right hand rule to make that
distinction.  This means that some of the polygons or meshes in
converted models are likely to have 'back' faces showing; we haven't
been able to figure out anything useful to do about this.

CAVEATS:

This converter works for all the DXF files we've tried it with, but
there will certainly be others that it doesn't work for.  If you have
problems converting a DXF model, please send it to me at the address
below (with information like the name and release number of the
package which generated it and DXF release number), and I will try to
modify dxftop3d to support it.

AUTHOR:

This utility was written by Alaa Eldin Ibrahim.  Please end bug
reports to me at ai08@andrew.cmu.edu .  I hope you find dxftop3d
useful.
