Howto connect polygon to net

There is a dxf import in the footprint editor. But i could not find a way to make a filled pad from it. (you get the dxf lines as single graphical lines instead as a polygon. I could not find a way to convert these to a polygon.)

I would use inkscape plus svg2mod get your dxf artwork as a polygon into a kicad footprint.
This even works in kicad stable. You can then place a pad on top of it to connect to it, or convert that polygon to a pad. (The later only works in nightly builds.)

My problems could also be connected with how i created my test dxf file. Even in inkscape i can’t directly fill it but need to convert my outline into a single path first. So maybe there is a way to get a filled polygon directly from dxf into kicad.
To get a single filled polygon in inkscape i selected all lines that formed my pad, combined them with path->combine. After that i selected all points using the path tool (you can use block select here) and pressed the join selected nodes botton to join overlapping points.

I played around a bit, here my test files:test_dxf_to_pad.zip (6.2 KB)

So there is a serious deficiency in Kicad then to make a custom pad. We should not have to jump through all these loops just to make a custom pad.

Well we at least have polygon pads now. The developers know that the tools to generate them are a bit lacking. (But should they have waited with giving us the posibility for complex pads until the interface is finished?)
Maybe somebody is motivated enough to write a python plugin that can convert lines to polygons directly in the footprint editor.

Unfortunately the footprint editor doesn’t support scripting.

At some point it becomes about reinventing the wheel. How complex does it get before it’s better just to use an existing program? In that respect the Kicad Stepup plugin for Freecad? is a remarkable concept and probably not a bad way to go for more complex shapes. You can really avoid duplication of coding effort that way.

Stepup does not support anything near this usecase :wink:

The “only” thing comparable to this usecase can be done via the dxf import. (It can be used to get a board outline from a freecad sketch into a kicad pcb file.) The missing tool is to convert such dxf imported line segments into a polygon such that it can be used for creating complex pads.

Stepup does not even support the new pad types for the footprint -> freecad direction. Stepup has no support for the other way round at all.

Update (May 2018): stepup now supports exporting footprints (even polygon pads are supported Kicad StepUp: The Sketcher for Footprint generation)

I agree with Rene,

All my usecase requires is that I can either:
a) draw a polygon on a PCB copper layer and link it to a net, or
b) I can import a .dxf outline of my “pad” and convert to a polygon, then link to a net.

I did a), I imported a dxf directly to a PCB then drew a polygon over top of the same shape which created my pad, but I can’t link it to a net … which I expected to be able to do by right-clicking on it.

[quote=“Rene_Poschl, post:12, topic:9508”]
Stepup does not support anything near this usecase :wink:
[/quote]Just using it as an example on how integrating an existing tool might be better than the Kicad developers spending cycles on their own interface. There are tools for complex shapes. Leveraging them them is probably the way to go. Unix philosophy. One file, one function, do it well. So yes, I’m talking about the missing tool.

That’s why scripting interface is a great idea. Even much of the existing functionality could be moved to python scripts if they were better supported. The core developers would be free to concentrate on the critical things. Especially actions which work on a selection are naturally “select something, open a menu, click a menu item, possibly open a dialog, accept, it’s done” and don’t need other than one menu item, i.e. an python action plugin. Unfortunately there are many smaller and bigger problems in the scripting support ATM.

But to go back to the original subject, creating a polygon object out of polygonal line segment group (or vice versa) is feasible for scripting. I have felt need for it. I regret not having learned enough KiCad API by now.

For creating footprints, the footprint wizard script feature can be used. This is a very flexible way of adding unusual shaped features. e.g I have written wizards for button contacts.

I think in principle a footprint wizard could open a DXF and convert to a valid footprint. Anyway, it’s easy for a programmer to create a kicad_mod file from scratch, for example creating complex designs like antennae.

1 Like

This is all less than helpful.

How hard can the interface be? All I require is to be able to right click on the polygon I have created on the a copper layer, and connect to a net. Isn’t that ability there for copper fills already?

Making me “a simple user” write a script to do such a simple task seems very user unfriendly … my 2c.

… and since I don’t know what/where a “Footprint Wizard script” is, or how to write said scripts, I might just have to go to eagle to create the pad I need and import it into Kicad … what a hazzle …

We are just users, who try to help each other out. Even if we all agree KiCad could be improved, there is little we can do about it. If you told us more about what you are trying to do, we might even write the scripts for you.

Complaining might be cathartic, but won;t help you achieve your goals.

Hmm, that might not work either, depends on how it is done. KiCad is not Eagle, and never will be. That means certain workflows will be different in KiCad.

Just had a quick sprint through this thread without looking at all the details and it seems to have drifted off course somewhere on the way down here.
Is it not possible to draw the shape you need using the filled zone tool where the first click on the board pops up a window asking which net to connect it to?

Edit : forgot this bit again, I am using a new version

Application: kicad
Version: no-vcs-found-fe62760~61~ubuntu17.10.1, release build
Libraries:
wxWidgets 3.0.3
libcurl/7.55.1 OpenSSL/1.0.2g zlib/1.2.11 libidn2/2.0.2 libpsl/0.18.0 (+libidn2/2.0.2) librtmp/2.3
Platform: Linux 4.13.0-32-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
Boost: 1.62.0
Curl: 7.55.1
Compiler: GCC 7.2.0 with C++ ABI 1011

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_SPICE=ON

There is no good way to directly convert a dxf into a zone. (At least not that i am aware of.) He already got a description of how to get his dxf into a complex pad but because it is a kicad external tool it was too complicated for him.

Yep, maybe I misunderstood but I meant just draw a zone using using the imported shape as a guide to where to place the vertices

As already is clear, b) isn’t possible without someone writing a script for it. BTW, I was confused about talks about “pads”. What you describe here is a copper zone, not a pad. A simple script could do that, but such script doesn’t exist ATM.

But the case a) can be done easily at least with the latest nightly builds and the upcoming 5.0 (which we all wait for eagerly). I don’t remember anymore how well 4.0.7 supports it, but the development version supports attaching net for a zone. Just draw a filled polygon shape to a copper layer - when you start, a properties dialog pops up and you can select a net amongst other properties. That works in the Board Editor - In the Footprint Editor you can draw a filled polygon and “Create Pad from Selected Shapes” if you need a reusable footprint with a polygonal pad. And it looks like you can import a DXF file in the Footprint Editor, too.

Hi eelik,

I updated my version of Kicad to the latest, and yes, I can draw a polygon on a copper layer as a zone and attach it to a net, that will do the job for now.

I had a quick look at the Footprint Editor, but could not see a way to turn on the dwgs.Use layer (to import .DFX into) … as I can in the pcb_new … all the layers from that one down to Margin are ghosted out, as is the copper layers … so I can’t even draw a polygon in a copper layer …

Yes, it’s a bit unintuitive and should be changed IMO in some way or another. But you should be able to use the silk or other available graphic layer. You should be able to import a DXF there draw a polygon on another graphic layer and make it a pad, in the latest nightly builds such a pad is also automatically moved to a copper layer. Earlier it required some extra steps, nowadays it works pretty much automatically - except that it’s not obvious and intuitive that you have to first draw on a non-copper layer. (I assume you mean a nightly build with the “latest” version.)

When you open your PCB file in some text editor, you can get a better understanding of how things work, you can then manually change the netname, coordinates of some points, arcs and stuff like that, and then go back to gui mode and see what happens, helped me a couple of times

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.