Skip to content

Correctly read footprint's clearance setting

KiCad Bot requested to merge github/fork/Ratfink/f9-2-fix into master

Created by: Ratfink

There was a problem before where a KicadMod's clearance attribute was set to that of a pad (or the clearance option of a custom shaped pad) if the footprint itself didn't have a clearance value set. This ultimately was caused by improper recursion depth limiting in KicadMod._getArray.

This PR fixes the problem, making the attributes read from only the top level of the kicad_mod's module object.

The fix causes the script to no longer check if any individual pad's clearance values are non-zero. This was done before, but by my understanding of the code it was mostly accidental. If we want to continue to check for that, it would be best to write code specifically to look for it, so that more helpful messages can be printed including e.g. the number of the offending pad.

Please let me know if you'd like this additional check to be done before this is merged, as I'd be happy to implement it. I'm not totally clear on whether this additional check should be part of the test for rule F9.2 or a new test for F4.6, so please let me know that too if I am to implement it.

Fixes #221 (closed).

Edited by Joel Guittet

Merge request reports