Howto connect polygon to net

What do you mean with polygon? What is you kicad version?


Now a few guesses of what you could mean:

Is it a zone then you can select a net in the zone properties. (Only if your pcb has a netlist. So you need a schematic for that)

If you used an external tool to get polygons into a footprint for kicad version 4, then you can overlay it with a small pad that allows connection of the polygon.

If you talk about the new polygon feature in nightly then i have mixed news. If the polygon is inside a footprint then you can convert it to a pad. (Right-click -> “Create pad from selected shapes”)
If it is on the pcb, then it is unsupported. (One can draw a copper polygon but opening its properties dialog results in an error message that this feature is on an unsupported layer.)

1 Like

Rene answered while I was typing… sounds like it should be a zone?

Otherwise, the only way to connect drawing features that don’t have a net is to draw a track with the required net which overlaps them. That might require DRC to be turned off.

Hi, thanks for the replies.
I am placing the polygon direct in the pcb, and I do have a schematic/netlist.

The reason I am trying to do it this way, is that i have a .dxf drawing from the mechanical guys that I have to copy the outline of, I can only import .dxf into the pcb … unless there is a way to import .dxf when creating a pad??

I tried drawing a track over the polygon and like I said the test point is overlapped as well. However when I create my Gerber file, the polygon does not exist at all.

Any idea’s

Please be more specific. What’s your KiCad version? Do you mean polygonal zones (filled areas) or polygons made of line segments? Can you give a screenshot?

1 Like

KIcad from git, version of 2017-12-15
I mean polygon from line segments … will give screenshot when back at work

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