2020-09-05 16:00:29 +00:00
|
|
|
# ---- Top-level Clauses
|
|
|
|
|
|
|
|
(version <number>)
|
|
|
|
(rule <rule_name> <rule_clause> ...)
|
|
|
|
|
|
|
|
|
|
|
|
# ---- Rule Clauses
|
|
|
|
|
|
|
|
(constraint <constraint_type> ...)
|
|
|
|
(condition "<expression>")
|
|
|
|
(layer "<layer_name>")
|
|
|
|
|
|
|
|
|
|
|
|
# ---- Constraint Types
|
|
|
|
|
2020-09-23 16:52:44 +00:00
|
|
|
clearance annular_width track_width hole dissallow
|
2020-09-05 16:00:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# ---- Item Types
|
|
|
|
|
|
|
|
track via micro_via buried_via
|
|
|
|
pad hole graphic text zone
|
|
|
|
|
|
|
|
|
|
|
|
# ---- Examples
|
|
|
|
|
|
|
|
(rule "copper keepout"
|
|
|
|
(constraint disallow track via zone)
|
|
|
|
(condition "A.insideArea('zone3')"))
|
|
|
|
|
|
|
|
(rule "BGA neckdown"
|
|
|
|
(constraint track_width (min 0.2mm) (opt 0.25mm))
|
|
|
|
(constraint clearance (min 0.05) (opt 0.08mm))
|
|
|
|
(condition "A.insideCourtyard('U3')"))
|
|
|
|
|
|
|
|
(rule HV
|
|
|
|
(constraint clearance (min 1.5mm))
|
2020-09-18 21:39:30 +00:00
|
|
|
(condition "A.NetClass == 'HV'"))
|
2020-09-05 16:00:29 +00:00
|
|
|
|
2020-09-26 09:20:10 +00:00
|
|
|
(rule HV
|
|
|
|
(layer outer)
|
|
|
|
(constraint clearance (min 1.5mm))
|
|
|
|
(condition "A.NetClass == 'HV'"))
|
|
|
|
|
2020-09-05 16:00:29 +00:00
|
|
|
(rule HV_HV
|
|
|
|
# wider clearance between HV tracks
|
|
|
|
(constraint clearance (min "1.5mm + 2.0mm"))
|
2020-09-18 21:39:30 +00:00
|
|
|
(condition "A.NetClass == 'HV' && B.NetClass == 'HV'"))
|
|
|
|
|
|
|
|
(rule HV_unshielded
|
|
|
|
(constraint clearance (min 2mm))
|
2020-09-18 23:09:53 +00:00
|
|
|
(condition "A.NetClass == 'HV' && !A.insideArea('Shield*')))
|
2020-09-05 16:00:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# ---- Notes
|
|
|
|
#
|
2020-09-21 09:45:54 +00:00
|
|
|
# Version clause must be the first clause.
|
|
|
|
#
|
|
|
|
# Rules should be ordered by specificity. Later rules take
|
|
|
|
# precedence over earlier rules; once a matching rule is found
|
|
|
|
# no further rules will be checked.
|
2020-09-05 16:00:29 +00:00
|
|
|
#
|
|
|
|
# Use Ctrl+/ to comment or uncomment line(s).
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
# ---- Expression functions
|
|
|
|
#
|
|
|
|
# All function parameters support simple wildcards ('*' and '?').
|
|
|
|
#
|
|
|
|
|
|
|
|
# True if any part of A lies within the given footprint's courtyard.
|
|
|
|
|
|
|
|
A.insideCourtyard('<footprint_refdes>')
|
|
|
|
|
|
|
|
|
|
|
|
# True if any part of A lies within the given zone's outline.
|
|
|
|
|
|
|
|
A.insideArea('<zone_name>')
|
|
|
|
|
|
|
|
|
|
|
|
# True if A has a hole which is plated.
|
|
|
|
|
|
|
|
A.isPlated()
|
|
|
|
|
|
|
|
|
2020-09-24 01:05:46 +00:00
|
|
|
# True if A is a member of the given group. Includes nested
|
|
|
|
# membership.
|
|
|
|
|
|
|
|
A.memberOf('<group_name>')
|
|
|
|
|
|
|
|
|
2020-09-05 17:51:19 +00:00
|
|
|
# True if A exists on the given layer. The layer name can be
|
2020-09-05 16:00:29 +00:00
|
|
|
# either the name assigned in Board Setup > Board Editor Layers or
|
|
|
|
# the canonical name (ie: F.Cu).
|
2020-09-26 09:20:10 +00:00
|
|
|
#
|
|
|
|
# NB: this returns true if A is on the given layer, independently
|
|
|
|
# of whether or not the rule is being evaluated for that layer.
|
|
|
|
# For the latter use a (layer "layer_name") clause in the rule.
|
2020-09-05 16:00:29 +00:00
|
|
|
|
|
|
|
A.onLayer('<layer_name>')
|