Creating a pad from a DXF import gives error

Hi eelik,

Thanks. I’ve searched for stepup but I’m not sure how it is relevant? I’m not trying to export my PCB as a 3D model?

As for creating another pad and selecting them both, it does create a pad without an error, but it isn’t very useful because it just does a merge of the pad and the drawing data, creating a strange shape and not filling in any open space.

I should note, I just found this: Creating and importing footprints

So it looks like it isn’t possible.

So you have lines which have some width (like traces or silk screen text characters) and they form a polygon.

KiCad lacks the ability to convert this kind of set of lines to a “real” polygon. With KiCad you can draw a polygonal area which is what you would need, if I understood you correctly. The original DXF should have polygonal area. Unfortunately I now next to nothing about drawing DXF. The StepUp plugin for FreeCAD may be able to help with that. Actually I don’t know how to use it, although I would like to know how to design pure 2D footprints with that.

There is a workaround via inkscape plus svg2mod.

but much easier is the new functionality of kicad stepup to export footprints:

1 Like

What this error is telling you is that your selection doesn’t have an object that could clearly be a pad. Custom pads always have an “anchor” pad that is either a circle or rectangle. You can add a small circular pad, select it with your imported shapes and convert to custom pad again. That should work.

1 Like

as @Rene_Poschl suggested, with FreeCAD & StepUp it is possible to:

  1. import a DXF as an outline for your Pads
  2. convert your outlines to Sketches
  3. export your Sketches to a KiCAD footprint

and the FreeCAD file for your footprint
PCM12SMTR-dxf-to-fp.FCStd (14.9 KB)

2 Likes

Looks great! I’m almost there! I just have a few questions:

How do I create the text layer? (see pic)

FreeCAD

In addition, it seems to not want to import my pads correctly into kicad, the pad on the bottom left isn’t working properly. Am I doing something wrong here?

Footprint_Editor_%E2%80%94_no_active_library

test.FCStd (5.6 KB)

Also, is there a way to export the STEP of the actual part and the footprint at the same time? (or perhaps even linked already?)

Please have a look at the Help Docs in the Demo folder (available at the KSU Demo Menu)

This is strange, I had no issue using your test file
myfp.kicad_mod (1.2 KB)

Are you on FreeCAD stable 0.17 or FC dev 0.18?
(FC0.16 is not more suggested as it has much less features…)

hi maui,

I tried to view that PDF from the menu, but it doesn’t do anything when I click it (it says “opening generating a KiCAD footprint and model from 3D Step Data.pdf” in orange text in the bottom status bar, but nothing happens). Cheat sheet and kicad-3d-to-mcad work fine.

I’m running the latest freeCAD release as downloaded today:

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13519 (Git)
Build type: Release
Branch: (HEAD detached at 1a8b868)
Hash: 1a8b868018f45ea486c0023fdbfeb06febc1fb89
Python version: 2.7.14
Qt version: 5.10.1
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/Australia (en_AU)

Looks like it is a space in path issue:

The files /Users/jeremy/Library/Preferences/FreeCAD/Mod/kicadStepUpMod/demo/Generating, /Applications/FreeCAD.app/Contents/MacOS/a, /Applications/FreeCAD.app/Contents/MacOS/KiCAD, /Applications/FreeCAD.app/Contents/MacOS/footprint, /Applications/FreeCAD.app/Contents/MacOS/and, /Applications/FreeCAD.app/Contents/MacOS/Model, /Applications/FreeCAD.app/Contents/MacOS/from, /Applications/FreeCAD.app/Contents/MacOS/3D, /Applications/FreeCAD.app/Contents/MacOS/Step, and /Applications/FreeCAD.app/Contents/MacOS/Data.pdf do not exist.

Thx, I will have a look…
For the moment you can download the file from here

https://github.com/easyw/kicadStepUpMod/blob/master/demo/Generating-a-KiCAD-footprint-and-Model-from-3D-Step-Data.pdf

Hi Maui,

Looks good. It seems I can’t repeat the issue with the missing pad, it seems to be working fine now… I’m not sure what was going on there. Thanks again for all your help, this works perfectly and does exactly what I need. This might have been the last thing stopping me from moving over to kicad.

Glad to know it!
Out of curiosity… Have you designed the dxf outline or did you get from the manufacturer site?

I drew it myself, took it from a production design in diptrace. I really hate drawing footprints in PCB software (Altium, diptrace, etc), I feel like parametric cad is always the way to go. Hopefully now I can just draw the footprint, align the step model and export all inside freeCAD!

1 Like

I feel like parametric cad is always the way to go. Hopefully now I can just draw the footprint, align the step model and export all inside freeCAD!

+1 from me :slight_smile:
That’s why I developed my tools :wink:

1 Like

But with custom pads it seems to me it is not possible to obtain a filled pad, unless using a closed poly-line, isn’t it?
Moreover this kind of pads are ‘sort of dangerous’ because DRC does not handle it.

@maui could you please explain in one/two (simple) sentences to total ignorance (means me) the main things behind your “That’s”.
Till now I used only Protel do design PCBs. I am doing my first experiments with KiCad. I don’t understand why you need to use freeCAD and I’d like to understand that.
I don’t understand why @jer used ‘parametrc cad’ in his sentence. Do the parametric cad is something other then cad? Why it is always the way to go (you certainly agree here with him)?

The footprint editor of KiCad is quite limited. For most footprints its feature set is good enough. (Array function + user grid)
Even for simple footprints the user needs to do quite a bit of math to find out where to place a pad and what size does it need to be. Especially if the datasheet does not dimension the pads via center coordinates plus pad size.
Most datasheets do not dimension pads such that you can directly read the values you need to enter into kicad. The reason behind that is the manufacturers need to also communicate tolerances.


The support for more complex footprint is a bit lacking. Especially support for complex pad shapes. Such footprints are a lot easier created in a tool like the freecad sketcher. You can in such instances simply recreate the dimensioned drawing given in the datasheet. (Example the x2son-4 footprint in the official lib and its freecad source file)


Some manufacturers supply a dxf (or step) file containing the suggested outline of the footprints pads. To reduce human error it might be good to have a way to convert this dxf directly into a footprint. As this topics discussion revealed it is not easily possible to import a dxf drawing into kicad and convert it into pads. (dxf import seems to mainly aim for getting the body outline into the footprint editor.)
With kicad stepup you can import the dxf into freecad and create a valid footprint that way.

parametric vs direct cad is not a clear this is better than that question. Both have their benefits and are used for different use cases.

I am just used to the parametric way of doing things. I like to see the dimensions entered in the sketch tool. (And the fact that i can change the dimensions later on is a bonus)

Now lets see what others think:

1 Like

I have very little experience with general CAD tools or the concepts, but I think about it this way:

Take almost any land pattern example from any part’s datasheet. If you would design an editor from scratch wíth which you could create a footprint file with as little work as possible, how would that editor work? Certainly not like the KiCad editor. Instead, it would have WYSIWYG dimensions in the view and you would be able to edit pads and locations without opening any property dialogs and especially without calculating anything, not a single number. Basically it would be almost 1:1 view with the datasheet view to which you could insert values.