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.
← Commit history
Apply JLCPCB minimum clearance to every copper item; add native pad-gap regression evidence
8 files changed
+332−22
kicad/jlcpcb-2L.kicad_dru+1−7kicad/jlcpcb-4L.kicad_dru+1−7kicad/jlcpcb-6L.kicad_dru+1−7tools/generate.py+1−1verification/clearance-issue/README.md+5verification/clearance-issue/clearance-test.json+98verification/clearance-issue/clearance-test.kicad_pcb+205verification/clearance-issue/test_generator.py+20kicad/jlcpcb-2L.kicad_dru+1−7@@ -26,7 +26,7 @@ (rule "min-clearance" (constraint clearance (min 0.1mm))- (condition "A.type == 'track' && B.type == 'track'"))+ ) (rule "min-hole" (constraint hole (min 0.15mm))@@ -44,9 +44,3 @@ (constraint text_thickness (min 0.15mm)) (layer "*.SilkS") (condition "A.type == 'text' || A.type == 'graphic'"))--# JLCPCB lists 1.0 mm; Adom has tested 0.8 mm and it prints legibly (2026-10-08).-(rule "min-silk-text-height"- (constraint text_height (min 0.8mm))- (layer "*.SilkS")- (condition "A.type == 'text'"))
kicad/jlcpcb-4L.kicad_dru+1−7@@ -26,7 +26,7 @@ (rule "min-clearance" (constraint clearance (min 0.09mm))- (condition "A.type == 'track' && B.type == 'track'"))+ ) (rule "min-hole" (constraint hole (min 0.15mm))@@ -44,9 +44,3 @@ (constraint text_thickness (min 0.15mm)) (layer "*.SilkS") (condition "A.type == 'text' || A.type == 'graphic'"))--# JLCPCB lists 1.0 mm; Adom has tested 0.8 mm and it prints legibly (2026-10-08).-(rule "min-silk-text-height"- (constraint text_height (min 0.8mm))- (layer "*.SilkS")- (condition "A.type == 'text'"))
kicad/jlcpcb-6L.kicad_dru+1−7@@ -26,7 +26,7 @@ (rule "min-clearance" (constraint clearance (min 0.09mm))- (condition "A.type == 'track' && B.type == 'track'"))+ ) (rule "min-hole" (constraint hole (min 0.15mm))@@ -44,9 +44,3 @@ (constraint text_thickness (min 0.15mm)) (layer "*.SilkS") (condition "A.type == 'text' || A.type == 'graphic'"))--# JLCPCB lists 1.0 mm; Adom has tested 0.8 mm and it prints legibly (2026-10-08).-(rule "min-silk-text-height"- (constraint text_height (min 0.8mm))- (layer "*.SilkS")- (condition "A.type == 'text'"))
tools/generate.py+1−1@@ -387,7 +387,7 @@ def gen_kicad_dru(vendor, rec): "", '(rule "min-clearance"', f" (constraint clearance (min {fmm(sp)}mm))",- " (condition \"A.type == 'track' && B.type == 'track'\"))",+ " )" if vendor == "JLCPCB" else " (condition \"A.type == 'track' && B.type == 'track'\"))", "", '(rule "min-hole"', f" (constraint hole (min {fmm(dr)}mm))",
verification/clearance-issue/README.mdadded+5@@ -0,0 +1,5 @@+# JLCPCB all-copper clearance regression++Native KiCad 10.0.3 on arav-rog: two 1 mm square SMD pads on B.Cu, different nets, centers 1.09 mm apart. The corrected 2-layer min-clearance rule reports actual 0.0900 mm versus required 0.1000 mm. The fixture and native JSON report are included. Generator applies the same unconditioned constraint to JLCPCB 2/4/6-layer profiles. Other vendors are unchanged and need independent review.++Publication attempted 2026-10-28 but rejected with HTTP 401. This is a tested local candidate, not a published repair.
verification/clearance-issue/clearance-test.jsonadded+98@@ -0,0 +1,98 @@+{ + "$schema": "https://schemas.kicad.org/drc.v1.json", + "coordinate_units": "mm", + "date": "2026-10-28T07:44:35", + "ignored_checks": [ + { + "description": "Footprint has no courtyard defined", + "key": "missing_courtyard" + }, + { + "description": "Track endpoint not centered on via", + "key": "track_not_centered_on_via" + }, + { + "description": "Tuning profile track geometries", + "key": "tuning_profile_track_geometries" + }, + { + "description": "Footprint doesn't match symbol's footprint filters", + "key": "footprint_filters_mismatch" + }, + { + "description": "Footprint component type doesn't match footprint pads", + "key": "footprint_type_mismatch" + } + ], + "included_severities": [ + "error", + "warning" + ], + "kicad_version": "10.0.3", + "schematic_parity": [], + "source": "clearance-test.kicad_pcb", + "unconnected_items": [], + "violations": [ + { + "description": "Clearance violation (rule 'min-clearance' clearance 0.1000 mm; actual 0.0900 mm)", + "items": [ + { + "description": "Pad 1 [NET1] of J1 on B.Cu", + "pos": { + "x": 11.09, + "y": 10.0 + }, + "uuid": "03bdc0ac-05c9-489c-983b-beeb96a41a81" + }, + { + "description": "Pad 1 [NET0] of J0 on B.Cu", + "pos": { + "x": 10.0, + "y": 10.0 + }, + "uuid": "519bf385-b4ed-4e13-943a-89df909228d4" + } + ], + "severity": "error", + "type": "clearance" + }, + { + "description": "Board has malformed outline (no edges found on Edge.Cuts layer)", + "items": [ + { + "description": "PCB", + "pos": { + "x": 0.0, + "y": 0.0 + }, + "uuid": "0882aa43-9176-45bd-a336-d7e81786066f" + } + ], + "severity": "error", + "type": "invalid_outline" + }, + { + "description": "Silkscreen clearance", + "items": [ + { + "description": "Reference field of J0", + "pos": { + "x": 0.0, + "y": 0.0 + }, + "uuid": "023cbaa5-a95c-4e74-9f8f-062a913f6175" + }, + { + "description": "Reference field of J1", + "pos": { + "x": 0.0, + "y": 0.0 + }, + "uuid": "f6235f1c-5638-4ede-a14a-1315440cbc51" + } + ], + "severity": "warning", + "type": "silk_overlap" + } + ] +}
verification/clearance-issue/clearance-test.kicad_pcbadded+205@@ -0,0 +1,205 @@+(kicad_pcb + (version 20260206) + (generator "pcbnew") + (generator_version "10.0") + (general + (thickness 1.6) + (legacy_teardrops no) + ) + (paper "A4") + (layers + (0 "F.Cu" signal) + (2 "B.Cu" signal) + (9 "F.Adhes" user "F.Adhesive") + (11 "B.Adhes" user "B.Adhesive") + (13 "F.Paste" user) + (15 "B.Paste" user) + (5 "F.SilkS" user "F.Silkscreen") + (7 "B.SilkS" user "B.Silkscreen") + (1 "F.Mask" user) + (3 "B.Mask" user) + (17 "Dwgs.User" user "User.Drawings") + (19 "Cmts.User" user "User.Comments") + (21 "Eco1.User" user "User.Eco1") + (23 "Eco2.User" user "User.Eco2") + (25 "Edge.Cuts" user) + (27 "Margin" user) + (31 "F.CrtYd" user "F.Courtyard") + (29 "B.CrtYd" user "B.Courtyard") + (35 "F.Fab" user) + (33 "B.Fab" user) + (39 "User.1" user) + (41 "User.2" user) + (43 "User.3" user) + (45 "User.4" user) + ) + (setup + (pad_to_mask_clearance 0) + (allow_soldermask_bridges_in_footprints no) + (tenting + (front yes) + (back yes) + ) + (covering + (front no) + (back no) + ) + (plugging + (front no) + (back no) + ) + (capping no) + (filling no) + (pcbplotparams + (layerselection 0x00000000_00000000_55555555_5755f5ff) + (plot_on_all_layers_selection 0x00000000_00000000_00000000_00000000) + (disableapertmacros no) + (usegerberextensions no) + (usegerberattributes yes) + (usegerberadvancedattributes yes) + (creategerberjobfile yes) + (dashed_line_dash_ratio 12) + (dashed_line_gap_ratio 3) + (svgprecision 4) + (plotframeref no) + (mode 1) + (useauxorigin no) + (pdf_front_fp_property_popups yes) + (pdf_back_fp_property_popups yes) + (pdf_metadata yes) + (pdf_single_document no) + (dxfpolygonmode yes) + (dxfimperialunits yes) + (dxfusepcbnewfont yes) + (psnegative no) + (psa4output no) + (plot_black_and_white yes) + (sketchpadsonfab no) + (plotpadnumbers no) + (hidednponfab no) + (sketchdnponfab yes) + (crossoutdnponfab yes) + (subtractmaskfromsilk no) + (outputformat 1) + (mirror no) + (drillshape 1) + (scaleselection 1) + (outputdirectory "") + ) + ) + (footprint "" + (layer "F.Cu") + (uuid "1116bb2d-52af-428e-a075-6afba36fb78e") + (at 0 0) + (property "Reference" "J1" + (at 0 0 0) + (layer "F.SilkS") + (uuid "f6235f1c-5638-4ede-a14a-1315440cbc51") + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "" + (at 0 0 0) + (layer "F.Fab") + (uuid "5298cbe7-e2b4-4b1e-ba25-e3af0fa1ecee") + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (layer "F.Fab") + (hide yes) + (uuid "087a3179-7487-4028-aa52-2da8af83de0f") + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Description" "" + (at 0 0 0) + (layer "F.Fab") + (hide yes) + (uuid "e20245b0-80ed-4f1b-8161-1662d484701a") + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (duplicate_pad_numbers_are_jumpers no) + (pad "1" smd rect + (at 11.09 10) + (size 1 1) + (layers "B.Cu") + (net "NET1") + (thermal_bridge_angle 45) + (uuid "03bdc0ac-05c9-489c-983b-beeb96a41a81") + ) + (embedded_fonts no) + ) + (footprint "" + (layer "F.Cu") + (uuid "dcd297b0-9c88-4252-806e-01b5a2f48971") + (at 0 0) + (property "Reference" "J0" + (at 0 0 0) + (layer "F.SilkS") + (uuid "023cbaa5-a95c-4e74-9f8f-062a913f6175") + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "" + (at 0 0 0) + (layer "F.Fab") + (uuid "5d812ac9-eda4-45f7-9554-0f9e8a629a13") + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (layer "F.Fab") + (hide yes) + (uuid "2b9b886a-ba93-45a9-aca0-a7b85af8a630") + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Description" "" + (at 0 0 0) + (layer "F.Fab") + (hide yes) + (uuid "3680dc08-2834-42f5-8318-deafb83e282b") + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (duplicate_pad_numbers_are_jumpers no) + (pad "1" smd rect + (at 10 10) + (size 1 1) + (layers "B.Cu") + (net "NET0") + (thermal_bridge_angle 45) + (uuid "519bf385-b4ed-4e13-943a-89df909228d4") + ) + (embedded_fonts no) + ) + (embedded_fonts no) +)
verification/clearance-issue/test_generator.pyadded+20@@ -0,0 +1,20 @@+"""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()