	 **** dxf2fig & dxfplot ; V2.09 Kees lemmens Dec 2004 ****


Introduction :
==============

Recently I needed to convert an Autocad R14 drawing to the excellent Linux
XFIG drawing program, but found out that there was no import option
whatsoever in xfig.

Also on the internet there was no software to be found that could do this
conversion, except for some commercial or shareware software, so I decided
to revive and modernize some old DXF import program I wrote about 15 years
ago for Commodore 128, Atari ST and Vax VMS :)

The dxfread.c part just parses the DXF input and then calls external
routines to do either plotting (when linked with dxfplot) or do a fig
conversion (when linked with dxf2fig).

The conversion is fairly  complete : also layers (depths in xfig), blocks
(compounds in xfig), colors and linetypes are rougly preserved in the
output file.

License :
=========

Standard GPL (Open source).

Compile and install :
=====================

There is already a precompiled binary in this distribution. If that works on
your computer you may simply copy it to /usr/local/bin .

If you want to recompile from source just type :

make              # only compiles dxf2fig, not dxfplot
make install      # simply copies dxf2fig to /usr/local/bin

Usage dxf2fig :
===============

Either invoke "dxf2fig" without arguments and answer the questions or use :

dxf2fig [-p <projection plane> -f <papersize> -v] <source.dxf> <target.fig>

The projection plane argument is only useful for 3D drawings where you want
to see the projection on the XZ (=2) or YZ (=3) planes. For common 2D
drawings it should simply be set to 1. The papersize can vary between
0 and 4 : 4=A4, 3=A3 .... 0=A0.

Example : dxf2fig -p 1 -f 2 columbia.dxf 1 columbia.fig

This will yield a fig file with A2 paper format.

Notes :
=======

1) After conversion to XFIG you often need to use <ZOOM> to be able to view
   and/or modify the result. Easiest option is using the "Fit to canvas"
   option in the "Zoom" dialog. You may have to rescale and or move the
   result a little.
   
2) The xfig program uses integer coordinates so this program should output
   integers as well. To ensure a reasonable accuracy you have to use a
   papersize that is large enough to maintain all details. The largest size
   (currently A0) results in 46.81" x 33.11" or - with 1200 dpi - 56160 x
   39732 pixels. Dxf2fig currently allows for size A4 - A0.  If you want
   more you'll have to recompile with extra sizes in the formats array.
   
   Note that with large papersizes the image is sometimes not (completely)
   visible without doing a <ZOOM> and "Fit to canvas" first.

3) The program still outputs some debugging information. If this bothers you
   you may recompile with the DEBUG macro set to off in dxfstuff.h

4) If you have any DXF files on which this program fails or crashes or that
   it can not translate properly, please send it to me so I can try to
   improve this program.

5) The dxfplot program source code (a program to view DXF files) is also in
   this package but it can't compile without having my graphics library
   (written in Java) as well. As there are enough DXF viewers available and
   as you can even use xfig for this, I decided to forget about dxfplot in
   this package (although it was very useful while testing the code !)


Happy Linuxing :)

--
Kees Lemmens,
TWA/EWI,
Delft University,
Netherlands.
