I am trying to create a rule to define the clearance between THT and SMD (on the soldering side of the THT). The reason is to prevent the SMD components from being washed away by the solder flow during the automated THT soldering process.
I tried this rule, but it doesn’t work:
(rule “Clearance: THT pad to SMD pad”
(condition “A.Type == ‘pad’ && B.Type == ‘pad’ && A.Pad_Type == ‘through_hole’ && B.Pad_Type == ‘smd’”)
(constraint clearance (min 6.0mm))
)
The auto completion suggests ‘Through-hole’ as pad type, not ‘through_hole’. Besides that many new features for the custom DRCs were only added in v8, so maybe your version does not support everything you want to do, yet.
I’m used to editing in Notepad. Before I wrote the question I was looking at what changes in the .pcb file when I change the Fooprint type attribute in the properties (E key). That’s how I came to through_hole.
Now it works a bit, but I have a lot of false positive errors because some footprints have plated through holes, but I don’t solder anything there (heat dissipation). I would also need to define it to check on the soldering side only.
Ok, I’m not sure, that I understood you correctly. If not, please elaborate and I try to help further. But if you want a special clearance between all SMD pads and all non-plated holes this rule should work:
I need to maintain a distance between the SMD pads (or footprint in general) and the Thruhole components (their pads) due to soldering the Thruhole using a fountain of molten tin (there is a risk of the SMD component being washed away if it is too close).
Ideally I would like to set a rule like:
When A is a pad of Through hole footprint, B is a pad of SMD footprint then the distance is at least 6mm.
Interesting challenge. On the other hand, sometimes I wonder if an easier and simpler solution would be to just adjust “clearances” while you position the footprints and route the tracks, using your eyes and hand. Or use a simpler rule, like courtyard_clearance for certain reference designators if there aren’t too many of those THT footprints.
Your chances would be better with v9 (now a pre-release “RC” version). You might be able to create a rule which you describe by attaching certain parts to Component Classes (see Schematic Editor | master | English | Documentation | KiCad) and using a combination of memberOfFootprint('x') where x is a component class (see PCB Editor | master | English | Documentation | KiCad). Then, your thruhole components would belong to the class Thruhole and you would test those pads against pads which aren’t part of footprint in that class. This needs to be physical_clearance because the net doesn’t matter, only the footprint class (normal clearance is for two different nets).