We’re working on setting the minimum clearance for different copper thicknesses on our PCB. We have a 6-layer board where the inner layers have a copper thickness of 2 oz, and the outer layers have a thickness of 1 oz. We’re looking to establish clearance rules for each layer to ensure that we can properly validate the spacing constraints.
We’ve tried the following rules without success. Does anyone have any suggestions on how to set this up?
Just guessing, but maybe the rules get confused by spaces in layer names. I never use spaces in identifiers, path names etc, even when they are supposed to be supported. There are just too many bugs lingering in such areas.
Note there appears to be a bug in the interactive router not updating clearance sizes (visually in the status bar, at least) when changing layers. I’m taking a look.
The difference is for items that exist on multiple layers (such as vias). For items which only exist on one layer (such as a track), they are equivalent. For items on multiple layers, A.Layer will only match the name of the first layer the obect is on, whereas A.existsOnLayer will match any layer the object exists on.
and nothing else. Notice that you can as well leave the outer layers out and handle them through the GUI with netclasses and board settings Constraints. For the inner layers, this textual rule overwrites the rules defined in the GUI. The reference manual says
While the layer of objects can be tested in the condition clause as described below, using the layer clause is more efficient.
The rule also seems to work for vias, at least when zones are filled: the filling next to via has smaller clearance in the outer layer and larger in the inner layer. Using the layer clause isn’t identical to using a condition clause, not even when when rule match is tested (and not only for efficiency as the manual would let you understand). The reference manual doesn’t describe the difference adequately, and doesn’t describe nuances for sure.
Sometimes custom rules are dangerous because they seem to work but the situation changes when the layout changes. Imagine for example that you replace 6 zones in different layers with one zone which exists in all layers. Whether you use X.Layer== or existsOnLayer, the old rules may work differently for the new situation. I even doubt if you can write a rule you want using X.Layer and existsOnLayer so that it works always, at least easily. The layer clause may be the only way.