Then, in the schematic editor, I’ve tried setting the “Component Class” field to “fine_pitch”. I’ve also tried using the new Rule Area feature to set the component class, and finally, I’ve tried to set the Component Class field in the footprint properties in the PCB Editor. None of these seem to work.
hasComponentClass will only return true on objects that have a component class, namely footprints. The clearance constraint only applies to copper objects, which footprints are not. So, this rule doesn’t do what you expect.
I suspect what you want is “apply this clearance rule to tracks that are inside the courtyard of this component” rather than “apply this clearance rule to this component” (since the latter doesn’t make sense as described above).
Indeed, I was suspecting that the pads didn’t have component class. I also had tried A.Parent.hasComponentClass, assuming that the pad’s parent would be the footprint, but I’m not sure if that’s even what Parent does.
Using intersectsCourtyard('${Class:fine_pitch}') worked great, but documenting for the posteriority, there was an interesting snag. I have a copper zone on the same layer, and the neckdown rule reduced the zone clearance globally. It’s obvious when you think about it but it took a while to figure out. Anyhow, this works:
Yep, that was what I tried. I assumed that since you can assign netclasses in the PCB editor, you’d be able to do the same for component classes. Anyways, I don’t want to complain, component classes are a really great addition and I’m really glad they’ve been introduced!
There are some complexities in synchronising component classes from the pcb editor to the schematic, so I didn’t implement this for now. I should add a warning if a user tries to add a component class field in the pcb footprint properties editor though.