Export DXF or SVG of Edge Cuts and Hole Outlines?

It would be useful to have an SVG or DXF file which shows the board edges and the edges of the drill holes. Is this possible? The best I could do is export as SVG with only edge cuts and a mask layer but that’s not ideal as the mask doesn’t accurately represent the holes…

A workaround using FreeCAD:

  1. export your board to IDF
  2. import the IDF in FreeCAD
  3. use Draft Shape2DView to project the board with holes
  4. export DXF

I’ll give that a go. Is there any reason why the Plot pads on silkscreen option in the plot dialog isn’t drawing all of the pads?

This is really the best option at the moment until the PCB API is created and we can create genuine plugins for this kind of job. The PCB API is next on my list of things to do (after a few minor jobs) but this is a very big job; with some luck I’ll get it done before next Christmas.

3 Likes

I’m trying to get from the Gerber file for the solder paste layer to Corel Draw to drive a laser cutter. Most of the tools for converting Gerber files are commercial, outdated, or both.

I’ve tried Linux “gerbv”. This will export SVG or PDF, but not DXF. Both exports just generate a document that covers the active parts of the solder paste layer, not the board boundaries. The SVG export is in units of “points”. PDF export isn’t any better. Suggestions?

DXF export would be nice. That can be brought into Corel Draw with dimensional accuracy and origin alignment.

If your laser cutter can work with gcode, there is an inkscape plugin that will convert the gerber paste layer to gcode.

I use it for producing solder stencils from laser transparencies. It works fine down to 0.8mm pitch components, probably smaller with a bit more experimenting . Just use Kicad to reduce the apertures of the paste layer to account for the kerf of the cutter and the slight overburn on the edges of the cutouts.

Edit: I forgot to add, you have to export the paste layer as an svg to import into inkscape.

Won’t the the DXF plot option work?

1 Like

With regard to my post, in my experience, it is not possible to cut a plastic transparency with a laser in the way laser cutting is normally done as a profile cut around vector lines. The laser cut is too fierce for this.

The easiest way is to scan across the whole image in a series of lines the way laser engraving is done, and just turn the laser on for a fraction of a second where the image needs to be removed.

Of course John-Nagle above may be trying to do something totally different, or may be using a metal cutting laser in which case dxf will be fine but I am just posting my own experiences here for anybody else that may be trying this in the future.

At this stage I suspect the best way to do this is to write a specialized tool; this would allow you to handle large pads by breaking them into grids if necessary. The kicad2step tool uses this library to parse the pcb files:

The DXF files can be created using the libdxf library which is currently included in the kicad source; to avoid problems with installed versions of the library, use static linking to libdxf.

What I usually do is plot to SVG from KiCad and do all the vector stuff in a dedicated vector editor (inkscape, illustrator, etc). Dimensions usually get messed up. In the vector editor, set your documents units to cm/inches in the size of your PCB. And scale the imported SVG layers accordingly (group them so you can scale all at once). If your units are setup correctly, adjusting dimension, origin etc is a breeze and easily done by hand. Hide/delete the layers you’re not interested in.

Use the vector tool to convert the holes into shapes/outlines (sometimes svg line-width is messed up - adjust to the real diameter). Then, use the path-edit tools to combine / subtract / merge the hole utlines and the edge-cuts into one shape.

I use this technique to create “artsy” silkscreen layers outside of KiCad and import them in one go as one image file - and get perfectly matching dimensions.

You must have solved that by now. Yet, I may comment: I had the same need. I found that the “Add layer alignment target” icon, can put a “target” at each of the four corners of the board. Then when I “plot” the “Edge.Cuts” file, I can create the “Edge.Cuts.SVG” file, which when converted & printed in PDF form, it gives me accurate alignment holes for the two layers. That board border, together with the four corner holes can be easily printed on whatever type of paper I want.

There is a DXF exporting version of gerbv, I believe:

https://github.com/alyoshin/gerbv-dxf

might be worth a try

Cheers,

Erich.