Footprints that contain copper (antennas) - can't connect them

I’ve modfied the kicad-coil-generator python script to make NFC antennas. I believe things worked in KiCad 5 (I was able to build build the footprints and wire up the board just fine) but I just upgraded to 6 and now I’m finding I can’t attach a trace to the pads on my antenna if I try to route to the same layer the antenna is on. It’s behaving like a clearance violation between the trace and the copper entities that make up the antenna coil. If I via down to another layer I can attach the pads but I can’t attach on the same layer that holds the antenna. Is there any way to fix this? What have I done wrong? Can I negate the feature that avoids this spacing violation?

Here is my script output.

(module Coil (layer F.Cu) (tedit 629CE8CD)
(descr “One-layer coil”)
(tags coil)
(fp_text reference REF** (at 0 -2) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value Coil (at 1.5 2) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_line (start 12.9 -0.8) (end 12.9 -12.24) (layer F.Cu) (width 0.2))
(fp_line (start 12.9 -12.24) (end 12.24 -12.9) (layer F.Cu) (width 0.2))
(fp_line (start 12.24 -12.9) (end -12.24 -12.9) (layer F.Cu) (width 0.2))
(fp_line (start -12.24 -12.9) (end -12.9 -12.24) (layer F.Cu) (width 0.2))
(fp_line (start -12.9 -12.24) (end -12.9 12.24) (layer F.Cu) (width 0.2))
(fp_line (start -12.9 12.24) (end -12.24 12.9) (layer F.Cu) (width 0.2))
(fp_line (start -12.24 12.9) (end 12.24 12.9) (layer F.Cu) (width 0.2))
(fp_line (start 12.24 12.9) (end 12.9 12.24) (layer F.Cu) (width 0.2))
(fp_line (start 12.9 12.24) (end 12.9 0.707105) (layer F.Cu) (width 0.2))
(fp_line (start 12.9 0.707105) (end 12.4 0) (layer F.Cu) (width 0.2))
(fp_line (start 12.4 0) (end 12.4 -11.96) (layer F.Cu) (width 0.2))
(fp_line (start 12.4 -11.96) (end 11.96 -12.4) (layer F.Cu) (width 0.2))
(fp_line (start 11.96 -12.4) (end -11.96 -12.4) (layer F.Cu) (width 0.2))
(fp_line (start -11.96 -12.4) (end -12.4 -11.96) (layer F.Cu) (width 0.2))
(fp_line (start -12.4 -11.96) (end -12.4 11.96) (layer F.Cu) (width 0.2))
(fp_line (start -12.4 11.96) (end -11.96 12.4) (layer F.Cu) (width 0.2))
(fp_line (start -11.96 12.4) (end 11.96 12.4) (layer F.Cu) (width 0.2))
(fp_line (start 11.96 12.4) (end 12.4 11.96) (layer F.Cu) (width 0.2))
(fp_line (start 12.4 11.96) (end 12.4 0.777816) (layer F.Cu) (width 0.2))
(fp_line (start 12.4 0.777816) (end 11.9 0.070711) (layer F.Cu) (width 0.2))
(fp_line (start 11.9 0.070711) (end 11.9 -11.68) (layer F.Cu) (width 0.2))
(fp_line (start 11.9 -11.68) (end 11.68 -11.9) (layer F.Cu) (width 0.2))
(fp_line (start 11.68 -11.9) (end -11.68 -11.9) (layer F.Cu) (width 0.2))
(fp_line (start -11.68 -11.9) (end -11.9 -11.68) (layer F.Cu) (width 0.2))
(fp_line (start -11.9 -11.68) (end -11.9 11.68) (layer F.Cu) (width 0.2))
(fp_line (start -11.9 11.68) (end -11.68 11.9) (layer F.Cu) (width 0.2))
(fp_line (start -11.68 11.9) (end 11.68 11.9) (layer F.Cu) (width 0.2))
(fp_line (start 11.68 11.9) (end 11.9 11.68) (layer F.Cu) (width 0.2))
(fp_line (start 11.9 11.68) (end 11.9 0.848526) (layer F.Cu) (width 0.2))
(fp_line (start 11.9 0.848526) (end 11.4 0.141421) (layer F.Cu) (width 0.2))
(fp_line (start 11.4 0.141421) (end 11.4 -0.6) (layer F.Cu) (width 0.2))
(fp_line (start 11.4 -0.6) (end 11.4 -0.8) (layer F.Cu) (width 0.2))
(pad 1 thru_hole rect (at 12.9 -0.8) (size 0.37 0.37) (drill 0.12) (layers *.Cu *.Mask))
(pad 2 thru_hole rect (at 11.4 -0.8) (size 0.37 0.37) (drill 0.12) (layers *.Cu *.Mask))
)

I hereby certify that I am not simply asking someone else to design a footprint for me.

I just made a footprint in Kicad V6.0.5 and called it “antenna”, and played around a bit.
I did:

  1. Select a library to put it in, start making the footprint, name, etc…
  2. Place a pad in the footprint editor.
  3. Select the pad and press [Ctrl + e] to enter Pad Edit Mode.
  4. Add some graphic lines to the pad.
  5. Press [Ctrl + e] again to exit Pad Edit Mode
  6. Place some symbol in a schematic, add the footprint to the symbol.
  7. [F8] to put the thing on the PCB.
  8. Draw a track from it.

And it all works. The footprint text looks like:

(footprint "antenna" (version 20211014) (generator pcbnew)
  (layer "F.Cu")
  (tedit 0)
  (attr smd)
  (fp_text reference "REF**" (at 0 -0.5 unlocked) (layer "F.SilkS")
    (effects (font (size 1 1) (thickness 0.15)))
    (tstamp 5731c5ec-ef5f-44a8-b12a-805858cff9fc)
  )
  (fp_text value "antenna" (at 0 1 unlocked) (layer "F.Fab")
    (effects (font (size 1 1) (thickness 0.15)))
    (tstamp 25d57da3-bdff-4050-8009-0d82605fd83a)
  )
  (pad "1" smd custom (at 0 0) (size 1 1) (layers "F.Cu" "F.Paste" "F.Mask")
    (options (clearance outline) (anchor circle))
    (primitives
      (gr_line (start 0 0) (end -3.5 0) (width 0.2))
      (gr_line (start -3.5 0) (end -3.5 -5) (width 0.2))
      (gr_line (start -3.5 -5) (end -7 -5) (width 0.2))
      (gr_line (start -7 -5) (end -7 0) (width 0.2))
      (gr_line (start -7 0) (end -11 0) (width 0.2))
      (gr_line (start -11 0) (end -11 -5) (width 0.2))
    ) (tstamp 840ded0f-d036-4f75-b88d-e7ea52e64828))
)

antenna.kicad_mod (961 Bytes)

Some info about the file formats is in:

Thanks! Editing the pad, nice. I’ll modify my code to generate that.

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