to main page

Converting Layouts in the Postscript format

I decided to use Postscript as input format for a number of reasons:

Usage

Restrictions

This program is intended for typical Layout data. There may be lines, rectangles and circles.

By inspecting "pcberror.dat" one can see what items have not been converted.

Output Format

The output format is quite simple, here is an example:
L 289 3855 289 169
R 1844 628 1899 682
F 1871 748 1871 748 55
F 1871 842 1871 842 55
F 1871 935 1871 935 55
.
.
.
Every line of the file contains one Line, Rectangle or Filled line. The syntax is:
L x1 y1 x2 y2
F x1 y1 x2 y2 w
R x1 y1 x2 y2
With (x1/y1) and (x2/y2) as end or corner points and w as the line width. The units are mil (1/1000 inch).

Support for Drill data

If one assumes that every circle or rectangle is a pad with a hole in its center, it is possible to use the layout to get the drill data. With the restriction however that the diameter is not known and that all holes are looked upon as being centered, also it will not work for SMD.

If the used layout-program supports the printing of holes only, then this can always be used to get the drill data (with diameter).

To generate the drill data out of a postscript layout, "pstoedit" with the environment variable

pcbdrv_drill

set to any value different to "no" is used. If the value is a positive number, it will be used as the hole diameter. If the value is anything else (that can not be converted to a number), the diameter is taken from the input file (circle diameter) and only circles are converted.

The output format is then:

D x1 y1 d

"pcb_error.dat" will not be empty if a complete layout is used as input, it contains the lines in this case.

Internals

The following files have been modified / added to the pstoedit distribution:
Makefile.in
drvpcb.h
drvpcb.cpp

After adding these files "pstoedit" can then be compiled as described in the distribution.

See the "pstoedit" Documentation to see how it works. The drivers, in this case "drvpcb" get single paths that must be converted to the output format. "drvpcb" was created by modifying "drvsample". "drvpcb" tries to convert each path into a line, filled line, rectangle or circle. If this fails the original output from "drvsample" is written in "pcberror.dat". See "drvpcb.cpp" for the details. It should be easy to add support for further objects if necessary.

Download

download drvpcb


Hans-Jürgen Jahn 4.09.02