Drc#
- class pyedb.workflows.drc.drc.Drc(edb: Edb)#
High-performance DRC engine for PyEDB.
This class provides a multi-threaded design rule checker that runs inside an open PyEDB session. It uses R-tree spatial indexing for efficient geometry queries and parallelizes all rule checks using ThreadPoolExecutor.
- Parameters:
- edb
pyedb.Edb Active EDB session that must already be open.
- edb
- Attributes:
- edb
pyedb.Edb Reference to the EDB instance.
- violations
listofdict List of violation dictionaries populated by
check().- idx_primitives
rtree.index.Index R-tree spatial index for primitive geometries.
- idx_vias
rtree.index.Index R-tree spatial index for via locations.
- idx_components
rtree.index.Index R-tree spatial index for component bounding boxes.
- edb
Examples
Basic DRC workflow:
>>> import pyedb >>> from pyedb.workflows.drc.drc import Drc, Rules >>> edb = pyedb.Edb("my_board.aedb") >>> rules = Rules.parse_file("rules.json") >>> drc = Drc(edb) >>> violations = drc.check(rules) >>> print(f"Found {len(violations)} violations")
Export to IPC-356A format:
>>> drc.to_ipc356a("review.ipc")
Methods
Drc.check(rules)Run all rules and return a list of violations.
Drc.to_ipc356a(file_path)Write a complete IPC-D-356A netlist with DRC annotations.