Creating a pad from a DXF import gives error


#1

Hi,

I’m trying to import a DXF of a component footprint. In this case, I’m just trying to test out kicad, I realise that I could just draw this by hand.

It imports fine in the footprint editor, but when I select an object and right click->Create pad from selected shapes, I get the following error:

“Cannot convert items to a custom-shaped pad: unable to determine the anchor point position. Consider adding a small anchor pad to the selection and try again.”

This DXF works perfectly in diptrace, so I’m not sure what I am doing wrong here. Could someone please point me in the right direction?

Here is the DXF file: https://www.dropbox.com/s/483cc5ompe3khns/PCM12SMTR.dxf?dl=0
I’m using the latest nightly build: 5.0.0-rc2-dev-707-g2ed24a4


#2

Soon someone would point yiou to StepUp anyways, so I thought I could as well tell you to do a forum search for “stepup”.

As for the custom-shaped pads - add a normal SMD pad, circle or rectangle, so that it overlaps the polygonal custom-shaped pad or is inside it. Then select them both and try again creating a custom pad.


#3

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.


#4

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

So it looks like it isn’t possible.


#5

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.


#6

There is a workaround via inkscape plus svg2mod.

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


#7

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.


#8

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)


Pad with special shape in V5
#9

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)


#10

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?)


#11

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…)


#12

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)


#13

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.

#14

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


#15

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.


#16

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


#17

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!


#18

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:


#19

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.


#20

@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)?