Lesson 15 of 15
Design Rule Checking
Design Rule Checking (DRC)
Design rules are minimum constraints that PCB manufacturers impose based on their process capabilities. Violating them makes the board unfabricable.
Common PCB design rules (for standard 2-layer boards):
| Rule | Typical Value |
|---|---|
| Minimum trace width | 0.1 mm (4 mil) |
| Minimum trace spacing | 0.1 mm (4 mil) |
| Minimum drill diameter | 0.2 mm |
| Minimum annular ring | 0.1 mm |
| Minimum copper to board edge | 0.3 mm |
The annular ring is the copper ring around a drilled hole. For a via with pad diameter D_pad and drill diameter D_drill:
annularRing = (D_pad - D_drill) / 2
A clearance check verifies that two nets don't come closer than the minimum spacing.
Your Task
Implement a DRC checker function checkDesignRules(rules) that takes an array of rule objects and returns an array of violations.
Each rule object has: { name, value, min }
Return violation objects: { name, value, min, violation: true } for rules where value < min.
JavaScript loading...
Loading...
Click "Run" to execute your code.