Copy a old board layout into KiCAD

I have a old board made in a CAD program I can not afford to keep up. I have schematics and layout in .pdf and .dxf. The PDF is easy to read and the DXF is an outline of the traces and power plains. (not filled) It is hard to read.
The new board needs to be close but not exact.
I took the DXF and imported it onto a footprint. “old_board” It came in well and measures very accurate. I have not tried it yet but I think it can be converted to “EC02.USER” layer.
PCB: bring that footprint in first and get the board out line right, place the large parts, and make the power plains right over the old_board. Now delete or turn off the old_board and place the little parts and rout the traces.
Is this insane? Can I import .pdf at 300dpi? Is there a better way?

Is your question more software related, or a question of whether 300 DPI is adequate resolution?
I cannot answer the first. But as for the second I would think it depends…
300 Dots Per Inch implies 3.3 mil = 0.085 mm resolution at best.

If you have a lot of fine pitch devices and traces, if there is a lot of critical geometry (transmission line impedances?) and are not in a position to apply engineering judgement then I guess it might be a problem.

But if you can apply engineering judgement and there is not anything with very fine pitch geometry, and nothing so critical, then it sounds OK to me.

I don’t know how many copper layers you have. But I am amazed at the low price from some of the Asian pcb fab houses for 2 layer or maybe even four layer. That sort of points to “going for it”…

I do not really have a good way to bring in PDFs at all. My “Micky Mouse” way leaves me needing to scale the image.
Importing DXFs through the foot print editor works well. I am mostly trying to get the parts placement with out finding and entering the X & Y for each part. Large parts only, mounting holes, board edges.
The idea is to have a picture of the old board as a background in the board editor. Then build parts and traces on top.

It is not so easy to use, but I think that GIMP software https://www.gimp.org/ seems to be able to convert almost any image format to almost any other. For example I think that converting a .pdf into a .png would be easy.

Actually, it is easy… but, not a ‘One-Click-Does-It-All’…

The Good news is you can do it with PDF, PNG, STEP… Several ways to to it.

The Bad new is you’ll need to decide which way is most useful/user-friendly for you.

That means trying them out…

#1) One way, as you indicated, load a DXF and trace items of interest

#2) A better way - using an Image
• Load an image (PNG, Jpeg or BMP) into the “BMP To Component Converter Tool”
• Export it (it exports as a Footprint .mod file) Example is set to 96 DPI to get correct scaling for the image I used.
• Using the Footprint Tool, Edit the new footprint
• Double-Click an item and change Layer (example shows some changed from Eco2 to B_Cu). (Could trace over the items instead of changing layers, if desired)
Note: Image exported quality a function of the Threshold Slider and original quality

#3) Using PDF: Using Inkscape (or other Graphic program) load the PDF, Save As PNG, Use #2 method above…

#4) Another approach is to use FreeCAD and the DXF. You can ‘Make Face from Wires’ the last Screenshot.

Some screenshots showing partials of above methods…

PDF and DXF loaded into Inkscape (an upgraded Gimp) and saved as PNG (results are the same so posting only one)
drawing

Using PNG in Bitmap Converter Tool

Resulting Footprint (.mod) in Edit mode changing Layers

Results

FreeCAD

2 Likes

Another (although slightly more involved) method not yet mentioned is svg2shenzhen.

I’m having a lot of trouble with this as well. I am unable to get KiCAD 5.1.9 to import a DXF file. I go to Pcbnew, select a layer, import the file, and nothing happens. How do I get it to work?

One response here indicates that a DXF file must be “traced”. Is there a way to import a vector file, and output it as gerber files without any messing around? Or is this only possible with the quality / resolution reduction that would be caused by using a raster file (PNG, BMP, JPEG, etc)?

The backstory: This is my first time attempting to use this program. I first started making circuit boards using markers and tape, 40 years ago. Lately, I’ve been using graphic design software and the laser printer / iron method. These methods were straightforward, and worked. Now my latest project involves some of these newfangled parts that require plated through holes on boards that need to be mounted flat against a heatsink. So I’m forced to actually pay someone to make a board, which to me is repulsive, but seems more practical than building an entire electroplating rig just to make a few small boards.

Of course, no one is willing to make boards from any “normal” file type, and demands this gerber file stuff (yes, I understand why). So here I am, and this is what brought me to KiCAD. What I need to make the program do is to import my board designs in any standard vector file format (I would see using a raster file, with the associated quality / resolution reduction, as an absolute last resort), and get the program to output them as gerber files. It would seem to be a simple matter to import one file type, and save it as another! But the program is not intuitive at all, the help pages are of no help in this, and reading here on the subject sheds no light on the subject except telling me that KiCAD will supposedly accept a DXF vector file. I need the “idiot’s guide”, and at this point, I’m going to beg for mercy and respectfully ask that someone please help walk me through the process of doing what I need to do!

If what you are doing are few small boards, then I suppose you will get what you need much faster if you design them from scratch with KiCad.
I have moved to KiCad from Protel, but I even didn’t searched for any tool to copy my old designs. Today I have just started to rewrite one my old design to KiCad (at one screen I have old schematic, at other I do it in KiCad).

Long time ago I have written a simple C program to convert bmp files to gerber with no optimization. The bmp had to be B&W, and in gerber there were a serie of horizontal 1mils width lines. As program I used to define my graphic could export max 600dpi I used 500dpi and draw my pictures in 2:1 scale.
I used it to add graphic to my Protel projects (Protel can import gerber but can’t import bmp).
I can search for its source code, but I think it is not what you really need.

At the PCB program. File/import/ import graphics … choose a .DFX Pick what layer (you probably want top copper)
Give it a try.

That’s exactly what I’d like to avoid. I already went through all of that work once, doing it all over again is even less of a last resort than working with a raster file import.

That’s exactly what I did, and nothing happens. What am I doing wrong? How do I get it to actually work? It seems like it should be so simple! I go to Pcbnew. Then on the right side of the screen, there is the list of layers with checkboxes that are all checked. I have left the checkboxes all checked. I click on F.Cu (which I assume means front copper layer), and a little arrow appears to the left of this selection. Then in the file dropdown at the top of the screen, I select import graphics, browse to the DFX file, click OK, and nothing happens. I tried it with both placement selections (clicking on the middle of the screen after interactive placement, thinking that it would place the graphic where I clicked the mouse, and at the origin of 0,0 for the at placement option). I have tried with several DFX files.

For each of 3 boards, I have three layers: the board outline, the traces, and the plated through hole locations. No solder mask, stencils, or any other fancy stuff. So it shouldn’t be any big deal to import each one into Pcbnew on the appropriate layer, and then export as a gerber file, if I can only get the import function to work! The only potentially tricky part might be getting the layers to line up properly, depending on how the program places them upon import, but that would just be a matter of figuring out how to move them around and adjust the placement. Should also be simple, but I have to get the files imported successfully first!

As I understand you did it not in program for PCB design. So you painstakingly guided each path in the graphics program, self checking what connect with what and whether the clearance between tracks are sufficient.
In KiCad when you have schematic all controls is left to program. In the simple project to route the track you practically once click at the start point and once at the end point and whole connection is done. When you have no room for new track all others are automatically pushed to make a room for your new track. When you wont to drag a track segment the whole track integrity is kept for you by program even jumping with track over elements if needed.

I am not sure which version of KiCAD you are using, but File->Import grpahics should show you the following dialog:

image

there you will select the file that you want to import, the line width, the graphic layer and the scale.

There is however wrinkle on the import function, that it only let you import graphics in graphic layers, no copper, but fortunately, kicad files are text based so it shouldn’t be a problem.

For it to work without too much pain, you will need to import first the copper layer and then the other layers.

So on an empty Pcbnew file, you will:

File->Import->Import Graphics and use the Dwgs.User as destination, use the “Placement At” option, to get all layer nicely aligned:

image

Save your file and close PCBNew, use a good text editor to open your board file:

you will need to change all the text “Dwgs.Users” to “F.Cu” from the lines drawing lines (gr_line):

Save the file and open it again with KiCAD:

Now your drawing should be on the copper layer, you will then new to import the other layer using the same origin but using the layers “Edge.Cuts” for the border.

I am not sure how should can import your THT this way tough…

1 Like

The original DXFfile format was specified in 1982 and it has evolved over many iterations since then. I believe that DXF ‘Version 12’ format is the most compatible format with KiCad. Would be worth checking what format your files are in and, if possible, try saving them to V12 format to see if that helps.

Screenshot 2021-01-15 at 16.31.49

Generally, KiCad works well for MCAD integration with FreeCad and seems to save in a format that is readable by KiCad. It might be worth opening and saving your files using FreeCad if you don’t have an option to save in a specific version from your 3D software.

One of the principles of using KiCad is that it does the heavy lifting for you - design the circuit, chose the components, arrange the footprints, route it and make your board. It will take care of the tricky details. You will find that KiCad works very well if you work with it but might fight you (or at least find things more tricky) if you try and work against it. So, for instance, if you are importing a board in this way, you will not have a netlist and no DRC.

1 Like

Correct. I even created my own custom library of templates for components, pads, commonly used shapes, holes, and trace widths. Nothing is automated, so I have full contol over the result. I never thought of it as painstaking, I only thought of how superior of a method it was to laying out boards with tape and a marker! :slight_smile:

Excellent, thanks! Now we’re getting somewhere. It looks like the problem was not knowing that the import was going into a Dwgs.Users layer, rather than the layer specified. I found the location where everything was saved to, and see 4 text files with the extentions of: .kicad_pcb, .kicad_pcb-bak, .pro, and .sch. Which one do I open in a text editor and change from Dwgs.Users to F.Cu?

You also mentioned importing the other layers to the same origin. Does KiCAD use the center of the image or a corner as the reference point on the image that is placed at the origin? If I knew this in advance, it should therefore be possible to place the other layers directly into the proper position upon import, rather than moving them around after the fact.

I was concerned about that as well, since I don’t see any layers listed for “drill”, “holes”, “vias”, etc. I figured that will be the next problem to solve, after I can first get the board outline and traces layers successfully imported and aligned.

Unfortunately, I have not been able to find a way to tell what version of DXF the files are. DXF is simply DXF, according to my vector graphics program, the file extention, and the file properties in windoze.

Many thanks to everyone who has offered their help so far!

I’ve got still another way.

KiCad 5.99 can import SVG graphics. PDF can be converted easily to SVG with some online service (just search for “PDF to SVG” or with e.g. Inkscape.

How complicated is the PCB?
BlackCoffee Showed how to import traces. I played with that but this is not how “CAD” works. I can get a gerber but can not easy make changes.
Do you have all layers turned on? The data might have come in on a turned off layer.

If you could share a sample DXF that would help a lot.

Unfortunately, I have not been able to find a way to tell what version of DXF the files are. DXF is simply DXF, according to my vector graphics program, the file extention, and the file properties in windoze.

It still might be worth trying to open and resaving the files as .dxf format from FreeCad. The files produced by FreeCad generally seem to be compliant with KiCad (I haven’t diff’d them to see what changes).

You do not know what you’re missing.
When I was a child I made my PCBs by painting them directly at PCB with ballpoint refill with the ball removed. I can also say nothing was automated and I had full control but using KiCad as it is intended is much, much better way of designing PCBs.

2 Likes

.kicad-pcb is the board’s layout file.

Sorry, you will need to experiment a bit here, I am not sure.

You can import your holes file on a drawing layer and use it as a reference to laid down some pads, however this could get very tedious depending on the complexity of your board.