Discussion:
gerber to .dxf converter
Dave N6NZ
2006-12-09 05:36:45 UTC
Permalink
Is there any free (as in speech) software that will convert gerber to .dxf?

Reason: I have access to a laser cutter through the TechShop and am
trying to work out a path to cut el-cheapo solder paste screens in
acetate sheet or similar material. I tried the path of creating a
PostScript check plot and running the .ps through pstoedit, which looks
promising, although I haven't tried to cut the resulting file yet.
But... seems like a direct path from the gerber would be better instead
of relying on the check plot and the inherent precision limitations of
PostScript. Or perhaps I underestimate the check plots?

-dave
DJ Delorie
2006-12-09 05:53:22 UTC
Permalink
Post by Dave N6NZ
of relying on the check plot and the inherent precision limitations
of PostScript. Or perhaps I underestimate the check plots?
PCB's Postscript is stroked, with as much resolution as the gerbers.
They should be fine, as long as you don't rasterize them during any
interim steps.
p***@public.gmane.org
2006-12-09 06:03:35 UTC
Permalink
Has there ever been a discussion about exporting hard cad files from PCB
... such as dxf or even a closed proprietary format?

It's common to want to move PCB layouts into cad for chassis layout
work. What would be involved in giving PCB this feature? As I
understand it, dxf is open. I don't really know if there are gnu or
open code modules for creating and working with them--I'm clearly over
my head here, but gosh it would be handy.

phil
DJ Delorie
2006-12-09 06:04:24 UTC
Permalink
Post by p***@public.gmane.org
It's common to want to move PCB layouts into cad for chassis layout
work. What would be involved in giving PCB this feature?
Write an export HID. It's the same way we export gerber and
postscript.
Dave N6NZ
2006-12-09 08:13:40 UTC
Permalink
Post by DJ Delorie
Post by p***@public.gmane.org
It's common to want to move PCB layouts into cad for chassis layout
work. What would be involved in giving PCB this feature?
Write an export HID. It's the same way we export gerber and
postscript.
.dxf would be very cool... but having been fooling with .dxf lately, i'd
say it has plenty of gotchas. bear in mind, i had never looked inside a
.dxf file as of three weeks ago, so YMMV. in the mean time, i have
written a program to extract an interesting subset of a .dxf file and
convert it to instructions to drive an Epilog laser cutter. (enough to
cut table top robot chassis from 3mm acrylic)

the problem is that .dxf has a pretty ad-hoc structure. pulling out
pieces that you are interested in is not too hard. reading the whole
thing and making sense of it is hard. writing a .dxf file that lots of
different .dxf readers will interpret correctly is hard.

QCAD has a GPL'ed dxf i/o library for C++. i'll probably end up
re-writing my laser cutter convert to use that library. (another library
choice is DIME.) even with the library, writing a correctly structured
.dxf file is hard.

don't let me discourage you... i'd love to have .dxf export :) just
don't expect to complete it in a weekend.

for my purposes, it sounds like running off the eps sounds sufficient.

-dave
John Griessen
2006-12-09 15:22:19 UTC
Permalink
phil-***@public.gmane.org wrote:
As I
Post by p***@public.gmane.org
understand it, dxf is open. I don't really know if there are gnu or
open code modules for creating and working with them
There are a couple of python cad programs with open source to look at
that do some .ps and .dxf output, and no importing. Pythoncad and cadvas
source code might be helpful in learning curve to get PCB to write out .dxf.

Gerber is just few types of output shapes in the PCB case we use, since the
only apertures used are circles and squares. Lines, arcs, and aperture sizes,
aperture round or square are all that is needed to draw a PCB in .gbr or .ps or
.dxf.

John G
DJ Delorie
2006-12-09 15:42:57 UTC
Permalink
Post by John Griessen
Gerber is just few types of output shapes in the PCB case we use,
since the only apertures used are circles and squares. Lines, arcs,
and aperture sizes, aperture round or square are all that is needed
to draw a PCB in .gbr or .ps or .dxf.
We also use flashes, polygons, and anti-drawn layers.

Hey Harry, can we use the clipper code to create a set of polygons
that reflects all the not-copper parts of the board? We could use
that set to drive a CNC mill directly.
Dave N6NZ
2006-12-09 17:32:23 UTC
Permalink
Post by John Griessen
There are a couple of python cad programs with open source to look at
that do some .ps and .dxf output, and no importing. Pythoncad and cadvas
source code might be helpful in learning curve to get PCB to write out .dxf.
From an overall work flow perspective, it might make sense to start
with gerber previewer and add .dxf output to that. That way, all pcb
layout programs are enabled, not just PCB. (Just thinking of my
compatriots in the Homebrew Robotics Club -- quite a few different pcb
layout programs are represented.)

-dave
Dan McMahill
2006-12-09 18:38:55 UTC
Permalink
Post by Dave N6NZ
Post by John Griessen
There are a couple of python cad programs with open source to look at
that do some .ps and .dxf output, and no importing. Pythoncad and cadvas
source code might be helpful in learning curve to get PCB to write out .dxf.
From an overall work flow perspective, it might make sense to start
with gerber previewer and add .dxf output to that. That way, all pcb
layout programs are enabled, not just PCB. (Just thinking of my
compatriots in the Homebrew Robotics Club -- quite a few different pcb
layout programs are represented.)
that would be useful. My guess is once someone were to acquire some
dxf-fu that a dxf exporter for pcb would not be that hard.

The entirety of the gerber exporter for pcb (including comment and blank
lines) is 990. Of that, a fairly good bit could probably be reused
(i.e. you need many/most of the same functions, just the internals need
to change).

I actually started such a thing a long time ago but looks like I didn't
get very far. I think I got stalled in the "learn about how dxf works"
phase.

-Dan
DJ Delorie
2006-12-09 19:29:46 UTC
Permalink
The advantage of going pcb->dxf and not gerber->dxf is that you only
have to worry about supporting the data we have, which is
significantly simpler than trying to support a generic gerber file.
Dave N6NZ
2006-12-10 01:07:23 UTC
Permalink
Post by DJ Delorie
The advantage of going pcb->dxf and not gerber->dxf is that you only
have to worry about supporting the data we have, which is
significantly simpler than trying to support a generic gerber file.
Oh yes, I hear that. What's easy and what's most generally useful
seldom overlap.

I wish I knew of a good rule checker tool for .dxf file portability...
writing a file that looks similar to .dxf is a lot easier than writing
.dxf that any tool can read, unfortunately. I don't have enough
experience with .dxf to be confident that I could write a well formed file.

-dave

p***@public.gmane.org
2006-12-09 05:57:11 UTC
Permalink
Post by Dave N6NZ
Is there any free (as in speech) software that will convert gerber to .dxf?
PCB is free, and it'll export .eps. It's not a dxf but perhaps your cad
application can import it. You'll have to give it a scale, but if
you're clever here, you'll never known the difference.

I've used this as a path to autocad with good results.

Phil
DJ Delorie
2006-12-09 06:02:10 UTC
Permalink
Post by p***@public.gmane.org
PCB is free, and it'll export .eps.
Oh, right. EPS, not PS output. Both are Postscript, and thus
rasterized, but the PS output may be scaled to fit on the page. If
you don't select the "fill page" option it may still work (with an
offset or rotation) but the EPS is a better choice.
Dave N6NZ
2006-12-09 08:29:24 UTC
Permalink
hhmmm... QCAD only opens .dxf, pstoedit only opens PS, not EPS. But I
guess if I don't do 'fill page' I should be OK.

-dave
Post by DJ Delorie
Post by p***@public.gmane.org
PCB is free, and it'll export .eps.
Oh, right. EPS, not PS output. Both are Postscript, and thus
rasterized, but the PS output may be scaled to fit on the page. If
you don't select the "fill page" option it may still work (with an
offset or rotation) but the EPS is a better choice.
John Griessen
2006-12-09 15:15:24 UTC
Permalink
Post by p***@public.gmane.org
PCB is free, and it'll export .eps. It's not a dxf but perhaps your cad
application can import it. You'll have to give it a scale
So, did this keep the stroked vectors nature of the data, or rasterize it finely?

John G
DJ Delorie
2006-12-09 15:38:10 UTC
Permalink
Post by John Griessen
So, did this keep the stroked vectors nature of the data, or rasterize it finely?
EPS and PS output from PCB is always vectors.
p***@public.gmane.org
2006-12-09 17:04:42 UTC
Permalink
Post by John Griessen
Post by p***@public.gmane.org
PCB is free, and it'll export .eps. It's not a dxf but perhaps your
cad application can import it. You'll have to give it a scale
So, did this keep the stroked vectors nature of the data, or rasterize it finely?
Keep it vector, and either import at a scale if you know what it should
be (say for the second or third iteration of the exact same PCB output)
.... or import it, and scale it.

I remember measurements being off on the order of 0.001" ... which could
just as much be a result of the limitations of the scale tool (in cad)
as my computation of the scale coefficient (in the HP).

Phil
Mark Rages
2006-12-09 08:37:40 UTC
Permalink
Post by Dave N6NZ
Is there any free (as in speech) software that will convert gerber to .dxf?
Reason: I have access to a laser cutter through the TechShop and am
trying to work out a path to cut el-cheapo solder paste screens in
acetate sheet or similar material. I tried the path of creating a
PostScript check plot and running the .ps through pstoedit, which looks
promising, although I haven't tried to cut the resulting file yet.
But... seems like a direct path from the gerber would be better instead
of relying on the check plot and the inherent precision limitations of
PostScript. Or perhaps I underestimate the check plots?
-dave
I'm suprised the cutter doesn't take gerber directly, since that's the
standard for CNC machines.

Regards,
Mark
***@gmail
--
You think that it is a secret, but it never has been one.
- fortune cookie
Loading...