Drilled hole too close to other hole | 🧨 KiCad Custom Rule

Intro

This series of short notes showing practical examples of using custom text-based rules forΒ KiCad EDA.

πŸ”Ί Issue Description

I have board with two battery connectors for different versions, so in one version it could be 18650 and in another 21700:

Image

The problem is the holes located too close and KiCad show errors:

Image

πŸ”§ Issue Fix

Open Board Setup -> Custom Rules and add following rule with specifying your net name (in my case it's -BATT and BAT_INPUT):

  1. # Hole to hole clearance
  2. (rule "Distance between Holes of the same net"
  3. (constraint hole_to_hole (min -1mm))
  4. (condition "A.Type == 'Pad' && B.Type == 'Pad' && (A.NetName=='-BATT' || A.NetName=='/BAT_INPUT')"))
  5.  

Click OK:

Image

βœ” Fixed

Rerun DRC again and now violations on all battery pins correctly excluded by custom rule:

Image

🌟 Related Article

ImageThermal relief for specified components | 🧨 KiCad Custom Rule
ImageHow to write custom KiCad rule exception? Simple example of courtyard overlap resolve
131
No comments yet. Be the first to add a comment!
Cookies?