pcb_pad_pad_clearance_error
Emitted by tscircuit DRC and placement validation when two PCB pads on the same layer are placed closer together than the allowed minimum clearance rule.
The 'pcb_pad_pad_clearance_error' diagnostic indicates a Design Rule Check (DRC) failure where two copper pads (surface mount pads or through-hole pad rings) on the board do not maintain the required physical isolation distance. The diagnostic structure records the IDs of the offending pads in 'pcb_pad_ids', the computed 'actual_clearance', and the configured 'minimum_clearance' threshold. If left unresolved, insufficient pad spacing creates a direct risk of solder bridging and electrical short circuits during fabrication and component assembly.
tscircuit layout validation routines (such as checkPadPadClearance in @tscircuit/checks) scan the PCB layout elements in Circuit JSON. The checker computes edge-to-edge Euclidean distances between conductive geometries on matching layers. When two distinct pads belonging to different electrical nets (or unconnected nodes) have an edge clearance smaller than the specified manufacturing constraint (e.g., 0.15 mm), the toolchain generates this error element.
import { checkPadPadClearance } from "@tscircuit/checks";
import type { AnyCircuitElement } from "circuit-json";
const circuitJson: AnyCircuitElement[] = [
{
type: "pcb_smtpad",
pcb_smtpad_id: "pad_1",
shape: "rect",
x: 0,
y: 0,
width: 1.0,
height: 1.0,
layer: "top",
pcb_component_id: "resistor_1",
pcb_port_id: "port_1"
},
{
type: "pcb_smtpad",
pcb_smtpad_id: "pad_2",
shape: "rect",
x: 0.5,
y: 0,
width: 1.0,
height: 1.0,
layer: "top",
pcb_component_id: "resistor_2",
pcb_port_id: "port_2"
}
];
const drcErrors = checkPadPadClearance(circuitJson);
console.log(JSON.stringify(drcErrors, null, 2));
Relocate adjacent components or adjust pad geometries to ensure the edge-to-edge spacing between independent pads satisfies the minimum design clearance requirement.
```typescript
import { checkPadPadClearance } from "@tscircuit/checks";
import type { AnyCircuitElement } from "circuit-json";
const circuitJson: AnyCircuitElement[] = [
{
type: "pcb_smtpad",
pcb_smtpad_id: "pad_1",
shape: "rect",
x: 0,
y: 0,
width: 1.0,
height: 1.0,
layer: "top",
pcb_component_id: "resistor_1",
pcb_port_id: "port_1"
},
{
type: "pcb_smtpad",
pcb_smtpad_id: "pad_2",
shape: "rect",
x: 1.5,
y: 0,
width: 1.0,
height: 1.0,
layer: "top",
pcb_component_id: "resistor_2",
pcb_port_id: "port_2"
}
];
const drcErrors = checkPadPadClearance(circuitJson);
console.log(drcErrors); // []
```
circuit-json [email protected] — PcbPadPadClearanceError — retrieved 2026-08-11