insideCourtyard() deprecated

Hi Everyone!

I understand the insideCourtyard() for PCB 8.0 condition is now deprecated, but is there a replacement for it?

Looking at the KiCad 8.0 documentation for Custom design rules, the BGA neckdown rule is still mentioning the insideCourtiard condition, and I have tried it, but it does not seem to work right, it expands to the entire board instead of being contained to the courtyard of choice (i.e. U3 or whatever component I’m choosing). Any suggestions?

I’m using KiCad 8.05 on Windows 11.

Thank you!

The documentation tells you what function to use instead of insideCourtyard(), in the description for insideCourtyard() :wink: It is deprecated solely because the name was misleading. The replacement function intersectsCourtyard() behaves identically but has a more accurate name.

Thanks for pointing out the outdated example, I will update that (but it should still work as written).

As for your behavior question, please give your exact version of KiCad and a demo project that shows what you mean.

Thank you kindly for your fast response,

I will try this right away.

Thanks again for the quick reply.
I tried it and I still see the strange behavior I’ve been mentioning before with interesectsCourtyard as well.

KiCad Version

Application: KiCad PCB Editor x64 on x64

Version: 8.0.6, release build

I made a quick bogus schematic and a new project and here’s how to reproduce the issue I see:

  1. No custom rules, fill the zone. Observe the correct spacing between GND fill and the pads or vias (10mil in my case). The spacing is correct outside and inside the courtyard of U1.

  2. Inside Custom Rules, add:
    (rule “BGA neckdown”
    (constraint track_width (min 4.2mil) (opt 4.5mil))
    (constraint clearance (min 4.2mil) (opt 4.5mil))
    (condition “A.intersectsCourtyard(‘U1’)”))

  3. Fill the zone again

  4. Observe the spacing between the GND fill and the pads, inside and outside the courtyard of U1. Inside the courtyard, I would expect the spacing to follow the rule, but outside the courtyard, I did not expect the BGA neckdown rule to be overriding my default zone spacing of 10mil to the rule’s 4.5mil

I must be doing something wrong or perhaps I don’t fully understand how the custom rules are supposed to behave.

Thanks for all the help!
Rules_Test.zip (361.3 KB)

I’m speculating and I’m not sure if this will address all of your issues, but your rule as written will apply to any object that intersects the courtyard. At a glance, that is both the trace (which is what you want) and the zone (sounds like that’s not what you want). So I would add a condition to your rule to make it apply only to traces and see if that makes you happier.

untested:

(rule "BGA neckdown"
    (constraint track_width (min 4.2mil) (opt 4.5mil))
    (constraint clearance (min 4.2mil) (opt 4.5mil))
    (condition "A.intersectsCourtyard(‘U1’) && A.Type=='Track'"))

This, I think, will fix the clearance between the zone and the pads. I expect you might still have the 4.5mil clearance around the track segment outside of the courtyard. You may need to break it into two track segments, one that intersects the courtyard and one that is completely outside of the courtyard.

If you need more help, please archive your project (in the project manager) and attach the zip here.

1 Like

Yup, this was exactly what I needed, it worked like a charm!
Many, many, thanks!