← Back to team overview

kicad-developers team mailing list archive



Hello Kicad team,

I'm writing a pcbnew action plugin that needs to read footprint pad
coordinates and shape.
I had no trouble figuring out all shapes except for custom one. It is
represented by SHAPE_POLY_SET which has a corresponding python type but to
get actual vertex coordinates you have to either call one of Iterate()
variants or get polygon outlines with Outline(). They both return objects
(ITERATOR and SHAPE_LINE_CHAIN) that are pointers and have no useful
attributes. As far as I understand they just don't have corresponding swig
bindings so they are not exposed properly in python.

Am I missing some obvious way to read custom pad polygon data in python?

If not, what would it take to add that?

I don't understand much about how swig configuration works but cursory
glance at Kicad source suggests that there needs to be an import for
shape_line_chain.h in common/swig/kicad.i, similar to shape_poly_set import.

If you are curious about what the plugin does, here are some of it's
results, generated from Kicad demos:

#2 above has a solder bridge with custom shape pads that are not rendered.
Links are short lived.


Follow ups