How to Export a Gerber Layer to DXF from Gerbv

Some questions about a circuit board are not electrical at all. Will the board fit the enclosure? Do the mounting holes line up with the standoffs? Where exactly does the connector clear the panel cutout? Those questions live in CAD software, and CAD software speaks DXF. Gerbv closes that gap: DXF is one of its documented export formats, and since v2.12.0 the DXF generator is built in on all platforms, so every current build can produce it. This tutorial covers exporting a Gerber layer to DXF, the mechanical and enclosure jobs that export exists for, and — most important — the caveats about what a DXF export actually is, so you use it for the right things. You will need Gerbv v2.13.0 (which includes the 2.12 improvements) from the download page, installed via the Linux installation guide or your platform’s guide; the picture-format sibling of this workflow is exporting to PDF, PNG or SVG, and the viewer’s overall role is on our Gerber viewer page.

A short history that explains the version requirement

DXF export in Gerbv is older than its current convenience. Historically, the export was available only if the build had been compiled with libdxflib support — the underlying DXF library — which meant some builds offered it and some silently did not. The v2.12.0 release notes removed that lottery: all platforms can now generate DXF files because the DXF generator is built in. Practically, that gives you one rule: if DXF export seems to be missing, you are looking at an old build, and upgrading to a current release (v2.13.0 is the latest stable) is the fix. The release also explains a small supply-chain detail you may meet in the notes — the tree bundles dxflib, with its licence acknowledged in the v2.13.0 documentation — which is why “built in” is now the accurate description rather than “optional add-on”.

The export workflow

Open the board in Gerbv and decide which layer the mechanical question is about — DXF export is a per-layer geometry export, so the choice of layer is the choice of drawing. For enclosure fit, that is usually the board outline layer: the edge, cutouts and holes that define the board’s physical shape. For a panel or front-plate design, it may be the silkscreen or the top copper with the connector positions. Load and position the layer using loading and aligning Gerber layers, then export that layer to DXF using Gerbv’s export, from the main window or from the command line — export from the command line is documented, with -x selecting the format and -o the output file. Keep the DXF filename explicit about layer and revision, exactly as you would for a picture export, and view the original layer once more before you export so what you send to CAD is the revision you think it is. If the mechanical check also needs hole positions from the drill data, remember that drill information lives in its own file; viewing Excellon drill files shows how to read those positions in the viewer before you rely on any single exported layer.

What the DXF is used for: mechanical and enclosure work

The canonical use is enclosure design. Import the outline DXF into your CAD tool and the enclosure, mounting plate or panel can be designed around the board’s true edge: standoffs placed under the real mounting holes, walls cleared around the real outline, cutouts positioned over the real connectors — with connector and keep-out positions cross-checked against a copper or silkscreen layer export when those features decide a cutout. A second use is mechanical templates: drilling jigs, test fixtures and adapter plates whose hole patterns must match the board, drawn from exported geometry rather than re-measured by hand. A third is documentation for mechanical colleagues who live in CAD and have no use for a Gerber viewer: a DXF of the outline plus a PDF of the stack (from the picture export tutorial) answers most questions they will ask. In every case the pattern is the same — the DXF carries geometry across the electrical/mechanical boundary, into the tool where that side of the design is decided.

The caveats: what a DXF export is — and is not

Now the part that keeps this tool honest. A DXF export from Gerbv is an export of the rendered layer geometry: the shapes the Gerber file describes for that one layer, written as CAD drawing geometry. It is not your original CAD model, not a schematic, and not an editable PCB design — there are no components, nets, footprints or design rules in it, because none of those exist in Gerber data to begin with. Text becomes drawing geometry, pads become shapes, and a copper pour becomes its outline geometry; nobody should try to reconstruct an editable board from it. Two practical consequences follow. First, verify scale and units when the DXF lands in CAD: measure a known feature in the CAD tool — the board width, a hole spacing you already verified with measurement in Gerbv — and confirm it matches before designing an enclosure around it. Unit mismatches are the classic cross-format failure, and one measured feature settles it. Second, respect directionality: DXF in Gerbv is an export. DXF import is not a documented capability, so do not plan a round trip in which edited DXF comes back into Gerbv as board data — it is a one-way bridge from fabrication data to mechanical design, and within that role it is exactly the right tool.

Checking the result

Treat the DXF like any other deliverable: open it in the CAD tool, measure the known dimensions, and overlay it mentally against the fit check you may later do physically with the 1:1 paper print. If the CAD measurement and the Gerbv measurement agree, the geometry crossed over intact and the enclosure work can proceed on solid ground. If they disagree, the problem is almost always units or a stale layer — re-export from the current revision and check again, rather than scaling things in CAD until they look right.

Frequently asked questions

Which Gerbv version do I need for DXF export?

Any current build. DXF generation has been built in on all platforms since v2.12.0; older builds only offered it if they had been compiled with libdxflib support. v2.13.0 is the latest stable release.

Can I import a DXF file into Gerbv?

No — DXF import is not a documented Gerbv capability. DXF is an export direction only: a one-way bridge from a Gerber layer’s geometry into CAD and mechanical design tools.

Is the exported DXF an editable PCB design?

No. It is the rendered geometry of the layer you exported — shapes, not components, nets or design data. Use it for enclosure fit, fixtures and mechanical reference, and verify its scale in CAD by measuring a known feature.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *