Design rules
Represents kicad design rules.
- class edea.kicad.design_rules.ConstraintArgType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
StrEnum
Different types of arguments used in PCB design constraints.
- min_resolved_spokes = 'min_resolved_spokes'
Minimum number of connected spokes in a thermal relief pattern.
- physical_clearance = 'physical_clearance'
Physical clearance between objects in the manufactured PCB.
- physical_hole_clearance = 'physical_hole_clearance'
Physical clearance between an object and a drilled hole in the manufactured PCB.
- class edea.kicad.design_rules.Rule(name: str, constraint: tuple[ConstraintArgType, tuple[str, ...] | str] | tuple[ConstraintArgType, tuple[str, ...] | str, tuple[str, ...] | str], layer: str | None = None, severity: Severity | None = None, condition: str | None = '')
Bases:
KicadExpr
A design rule for a KiCad PCB layout.
- Parameters:
name – The name of the rule.
constraint – The design rule constraint.
layer – The PCB layer where the rule applies.
severity – The severity level of the rule violation.
condition – An optional KiCad expression representing a condition under which the rule applies.
- constraint: tuple[ConstraintArgType, tuple[str, ...] | str] | tuple[ConstraintArgType, tuple[str, ...] | str, tuple[str, ...] | str]
- class edea.kicad.design_rules.DesignRuleSet(version: ~typing.Literal['1'] = '1', rules: list[~edea.kicad.design_rules.Rule] = <factory>)
Bases:
KicadExpr
A collection of design rules for a KiCad PCB layout.
- Parameters:
version – supported version of kicad_dru file.
rules – A list of Rule objects defining the individual design rules for the PCB layout.
- rules: list[Rule]
- noramlize()
Remove duplicate rules.
- Returns:
The ‘DesignRules’ object itself after removing duplicates.
- extend(other: DesignRuleSet)
Merge another set of design rules into the current one.
- Parameters:
other – Another set of design rules.
- Returns:
The extended design rules object.
- Raises:
TypeError – : If the provided argument is not a ‘DesignRules’ instance.