Custom Design rules Examples

Reduce clearance inside courtyards.

Tracks are often narrower then pads, and this limits the maximum clearance that can be used for tracks, while wider clearances for tracks are often preferred to reduce capacitive coupling between adjacent tracks. Especially for fine pitch footprints it is nice to fine tune this.

This can also help if you prefer to use a combination of track width + clearance that fits on your grid.

(rule clearance_U1
	( constraint clearance (min 0.2mm))
	( condition "A.insideCourtyard( 'U1')")
)
(rule clearance_J1
	( constraint clearance (min 0.14mm))
	( condition "A.insideCourtyard( 'J1')")
)

These rules work on themselves. It was just a test, using wildcard in the footprint names is probably better in a real project. Unfortunately this had serious consequences for the interactive router. It blocked most of it’s functions and also created DRC violations. I opened an issue for this on gitlab and the issue was picked up by James J · GitLab and fixed in less then an hour. As a result, this will probably be included in the next bug fix release of KiCad V8.0.5 in a few weeks.

insideCourtyard() is deprecated, use intersectsCourtyard() instead.