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:
edbpyedb.Edb

Active EDB session that must already be open.

Attributes:
edbpyedb.Edb

Reference to the EDB instance.

violationslist of dict

List of violation dictionaries populated by check().

idx_primitivesrtree.index.Index

R-tree spatial index for primitive geometries.

idx_viasrtree.index.Index

R-tree spatial index for via locations.

idx_componentsrtree.index.Index

R-tree spatial index for component bounding boxes.

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.