However, this feels like a hack, and doesn’t properly cover the case. Is there a better solution?
Different clearances for component and solder side for through holes. Is there a way to match on the side a component is placed on for a pad constraint?
Constraints dependent on values of items under test. E.g. requirement 14.3.5:
The track width connecting to soldering pad of PTH shall be maximum half of the diameter of the pad.
Are there solutions to those, or are those rules maybe not meant to be that granular?
Of course I could just assume the largest clearances etc, but that will likely lead to space problems later on and doesn’t feel clean.
I think your solution to (1) is about the best you’re going to do.
You can check which side a footprint is on, but there’s no way to get from the pad to properties of the parent footprint. I’ve recently introduced a memberOfFootprint(foo) function, but to use that you’d have to have a policy of using different reference-designators for back-side components or something, which clearly isn’t ideal.
(3) is sort of the same problem as (1). You could again introduce a stepped set of rules, but it’s not a direct match.
Log a feature request on GitLab for “A/B references inside constraint expressions”, and I’ll look into whether or not it would be a huge effort to add…
So I’ve been digging around a bit, correct me if I’m wrong, but there doesn’t seem to be a straight forward way to place a DRC marker from the python api?
The PCB_MARKER class is accessible through python, but the DRC_ITEM class doesn’t seem to be accessible, which (if I understand it correctly) needs to be constructed for a valid marker.
Would it be enough to make DRC_ITEM accessible to place a marker, or would there be the need for more in depth changes to make this possible?
If you generate a report it’s also going to expect the DRC_ITEM to have a DRC_TEST_PROVIDER (returned via GetViolatingTest()). The only thing needed from the DRC_TEST_PROVIDER API is GetName(), but it would be nice to have some way of returning the name of the Python script there…