by adom
Canonical PCB fab design rules (DRC) for every popular vendor: one JSON record per vendor, process and layer count, with generated Fusion/EAGLE .dru and .edru, KiCad .kicad_dru plus board-setup JSON, Altium .RUL exports, and a human comparison table. Every number cites the vendor's own capabilities page and the date it was read.
main
John Lauer
Apply JLCPCB minimum clearance to every copper item; add native pad-gap regression evidence
e15d2c4
"""Regression: JLC profile regeneration must not restore track-only clearance."""
import importlib.util,json,re,unittest
from pathlib import Path
ROOT=Path(__file__).resolve().parents[2]
spec=importlib.util.spec_from_file_location('generate',ROOT/'tools/generate.py')
g=importlib.util.module_from_spec(spec);spec.loader.exec_module(g)
class ClearanceCoverage(unittest.TestCase):
def test_jlc_all_layers(self):
data=json.loads((ROOT/'rules/records/jlcpcb.json').read_text())
for rec in data['records']:
with self.subTest(layers=rec['layerCount']):
output=g.gen_kicad_dru(data['vendor'],rec)
rule=output.split('(rule "min-clearance"',1)[1].split('(rule ',1)[0]
self.assertIn('(constraint clearance',rule)
self.assertNotIn('(condition',rule)
def test_other_vendor_scope_unchanged(self):
data=json.loads((ROOT/'rules/records/jlcpcb.json').read_text())
output=g.gen_kicad_dru('Unreviewed other vendor',data['records'][0])
self.assertIn("A.type == 'track' && B.type == 'track'",output)
if __name__=='__main__':unittest.main()