A practical example
Xdraft drawing editor
(last update: 17 Dec 2009)
This web page describes my drawing editor, still a work in progress.
New: Version 0.13 released. This fixes package
dependency problems introduced by Ubuntu 8. This new version will
probably not install on Ubuntu 6 and earlier systems.
A short tutorial
has been written. This is still in the very early stages and feedback
Currently working on: Library items. Attribute editor. More input
modes and intersections. Improved keyboard acceleration.
Also, pattern fills still need to be added to postscript output.
Still to be done: .dxf file format. Path objects. Attribute editor.
Once these are done, I'll release version 1.0.
I have had a report of someone getting a core
dump at startup; has anyone else seen this?
Let me know if you have.
First practical use of xdraft. I've
built a cabinet
that was designed with xdraft.
I see there have already been over 1000 downloads and
it's not even released yet. Not bad.
I just released 0.11; if you download it, please
post a note to let me know any of the following:
Or just to let me know that you got it working ok.
- Problems building
- Problems running
- Ways the user interface could be improved.
Thanx in advance -- Ed Falk
Over the months, I've received multiple requests for
the plans to my Miatascope.
Problem is, I don't have the plans in any kind of electronic form.
I designed it on the back of other documents, using an antique fountain
pen. Scanning the backs of ratty stapled documents isn't really very
good, so I decided to find some free Cad software and enter a formal
I tried to use some of the available free Cad software (Xfig under
Linux, TurboCad-2d and others under Windoze) and came to one
inescapable conclusion: They all suck. You'd think that the people who
wrote them had never taken a drafting class in high school. Xfig
came the closest to being useful, but its arc-definition mode was
too limited, it didn't have any trimming functions, and most
importantly, there was no dimension function.
Oh well; that's free software for you. I'm sure the professional
stuff is much better. But no way am I paying $2000 just to enter
the plans to a $500 telescope.
Next, I tried installing
Catia [note: web page requires
we have a license. I used Catia back in college -- it is without a
doubt the finest Cad software ever written. If you've ever ridden
in a modern airliner, you've ridden in something designed on Catia.
Pratt & Witney designs their engines with Catia. Your car was probably
designed with Catia.
But have you ever tried installing and administering Catia? Forget
it. Requires a trained professional. Actually, I am a
trained professional, and I still got nowhere. Catia administration
requires a full-time person with extensive experience with IBM
mainframes and who studied at Dassault in France for two years to
learn how. Took me a week to install it, and I never did figure
out how to run it. The next engineer after me tried to
install it too, and didn't get any further. I think they're sending
him to France now.
So what do I do? I decided that if Unix is 30 years old and
still doesn't have a decent drafting program, it was time
to write one. This program started life about 15 years ago. I
wrote it in college to drive
vector displays connected
to Pr1me-500 computers. None of the original source code remains
(it was written in Fortran.) All that remains are the design ideas
and philosophy. It incorporates the XFIG file format, and some ideas
from XFIG, Catia and whatever crumbs of good ideas I got from the
other Cad software I've played with.
I'm about 75% done.
Now in beta! Download it from the
You also need to have
installed on your system. These are pretty common and you probably already
- Free software. Uses GTK+ widget set.
- Reads and writes xfig files. I plan to add
other formats. In fact, I'll have to -- xfig format
doesn't do everything I want. DXF format is in the works.
- Multiple ways to define vertices and enter data:
- Point and click with the mouse. All drawing
editors have this feature, but if you've ever really
tried to use CAD software to do real drafting, you'll realize that
this is the method
you'll never actually use.
- Enter X,Y coordinates -- either or both may be relative to
the previous point, or absolute.
- Enter length or angle.
- Enter any combination of X, Y, length or angle; Xdraft will figure
out what to do.
- Any combination of X,Y, length or angle may be "locked" to their
- X and/or Y values may be copied from any vertex in the model.
- Length may be copied from any edge or radius in the model.
- Angle may be copied from any edge in the model.
- Conventional grid snap may be enabled.
- Conventional vertex snap may be enabled.
- Conventional angle snap may be enabled. Some drawing programs call
this "Manhattan" or "mountain" geometry.
- Naturally, all constraints have hot keys, so you need not move the
mouse to change them.
- Extremely powerful grid snap. Most drafting programs have
grids fixed at some interval, or if you're lucky, allow you to
choose between 1/8", 1/4" and 1/2". Xdraft allows you to set
*any* interval. In addition, Xdraft allows you to set the grid
origin to anything you want. Even more, the grid need not be
square, or even rectangular. See this
screenshot to see the grid-definition dialog, with an
isometric grid currently in use.
- Powerful angle snap. Some drawing programs call this
"Manhattan" or "mountain" geometry and limit you to 90-degree
(or 45-degree if you're lucky) intervals. Xdraft goes much
further and allows the user to specify angle snap at any
interval. Default is 15 degree intervals, but 30 degrees is
great for isometric drawings.
- Numeric values are entered as algebraic expressions. If your units
are feet, and you want to enter an inch, type "1/12".
- Multiple layers. Layer 999 is designated the "construction" layer.
It's drawn all in one color, and may be quickly toggled on and off.
If you've ever done real drafting, you know that construction lines
are the key to getting the job done.
- Multiple ways to enter each kind of element:
- Enter coordinates.
- Enter an offset from some other point.
- Intersection(s) of two elements.
- Limit points of an element.
- Evenly spaced between two points.
- At the midpoint (or any other ratio) between two points.
- In a rectangular grid.
- Single line segment defined by two points.
- Polyline defined by multiple points.
- Parallel to an existing edge.
- Perpindicular to an existing edge.
- Join multiple lines into one polyline.
- Break a polyline into individual line segments.
- Trim one or both lines at their intersection.
- Boxes: Defined by corner points or center point and corner point.
- Defined by center and radius.
- Defined by three points on the circle.
- Defined by center and radii.
- Defined within a box.
- Defined by center, radius and two angles.
- Defined by three points.
- Dimension lines:
- Parallel to an edge.
- Text: Simply type and place.
- Pre-select highlighting. With most editors, if the image is
crowded, you point, click, and hope that you got the right element.
In Xdraft, whichever elements is closest to the cursor is drawn in
a bright color to let you know that this is the one you would pick
if you clicked right now.
- Editing: Delete, hide, show, copy, move, 50-level (configurable)
undo/redo buffer. Coming soon: move, delete, add points in a line or
spline. Coming soon: rotate, scale, flip.
There's an rpm file which has been tested under RedHat 7 and 9 and will
probably work on other versions as well. You probably won't need to
build xdraft yourself, but if you want to compile it yourself, follow
This install procedure should work flawlessly under Linux. Xdraft has also
been compiled under Solaris, but not lately, so the build process may
have become broken.
- Install GTK and Gnome (see above, they're probably already installed).
- Edit Makefiles if necessary.
If you have problems compiling or using Xdraft, you can
send me email.
See the file Todo for a list of current bugs and things that
still need doing. See Developers for a list of source files
For now, I'm most interested in the following:
- Devleopment help
- Comments on the user interface, in particular, I need to
make better choices for keyboard acceleration.
- DXF file handling.
-Ed Falk, Nov 2004
First Practical Use
I built a tape-recorder cabinet that I designed with xdraft. You can see
pictures of it being designed in the snapshots above. Here is the
postscript output and some photographs:
A practical example