Asher Blum - asher@wildspark.com

Read the Makefile.  It invokes gen.pl with various keywords.  Try gen.pl
with one keyword to see how it works.

gen.pl -    Perl script that generates d.c and d.h.  These handle DXF in/out
            and entity structs.

d.c, d.h              Auto-generated.  Do not edit - edit gen.pl instead.
basic.h               Beginning of d.h
endcap.h              Stuff for d.h that depends on previous stuff - end of d.h
                      Function declarations go here.
codes.h               bit flags, etc.

dxfscope.c            DXF viewer program
base.c                Small chunk of C that gets prepended to d.c
draw.c                Functions to draw entities on display
draw_dimensions.c     Draw dimensions.  Used by draw.c.
font.c                Read and use cxf fonts.
geometry.c            Matrix math and other reusable geometry.
startup.c             Initialization for the viewer.
gui.c                 Some GUI functions like progress_bar

WCS = World Coordinate System.  In drawing units.  To go from WCS
points to screen points, use transform() with appropriate matrix.
Points are (x, y, z) but we don't use z.  

Matrices are:  | a d 0 |
               | b e 0 |
               | c f 1 |

the constants are not stored.  This is the homegeneous 2d matrix, which
enables fast 2d transforms.  The angle is stored redundantly with the matrix
to speed calculations.  It's in degrees CCW.



Postscript output is accomplished by substituting workalike functions
for X drawing functions.  It's a bit yucky, but it keeps the system
focused on reasonably fast X performance.  They're in postscript.c.
See ps_out in gui.c.




