hashgraph-online/awesome-codex-plugins / plugins/aklofas/kicad-happy/skills/kicad
kicad
VerifiedAnalyze KiCad projects and PDF schematics: schematics, PCB layouts, Gerbers, footprints, symbols, netlists, and design rules. Reviews designs for bugs, traces nets, cross-references schematic to PCB, extracts BOM data, checks DRC/ERC, DFM, power trees, and regulator circuits. Every finding carries a confidence label and evidence source with trust_summary rollup. Analyzes PDF schematics from dev boards, reference designs, eval kits, and datasheets. Supports KiCad 5–10. Use whenever the user mentions .kicad_sch, .kicad_pcb, .kicad_pro, PCB design review, schematic analysis, PDF schematics, reference designs, Gerber files, DRC/ERC, netlist issues, BOM extraction, signal tracing, power budget, DFM, or wants to understand, debug, compare, or review any hardware design. Also for "check my board", "review before fab", "what's wrong with my schematic", "is this ready to order", "check my power supply", "verify this circuit", OSHWA certification readiness, or any electronics/PCB design question.
scripts/kicad_core/coords.py
View on GitHub"""Schematic coordinate identity in KiCad internal units (kicad_core).
KiCad schematics store every coordinate as an integer of 100 nm (1e4 per mm) and join
connection points only when those integers are equal. Analyzer output keeps millimetre
floats; these helpers give the integer identity used for joining.
"""
IU_PER_MM = 10000
def to_iu(mm: float) -> int:
"""Millimetres to schematic internal units, rounded half away from zero as KiCad's KiROUND."""
v = mm * IU_PER_MM
return int(v + 0.5) if v >= 0 else int(v - 0.5)
def _sq_distance(p, a, b) -> int:
"""Squared distance from point p to segment a-b, in IU squared, rounded as KiCad's SEG."""
abx, aby = b[0] - a[0], b[1] - a[1]
apx, apy = p[0] - a[0], p[1] - a[1]
e = apx * abx + apy * aby
if e <= 0:
return apx * apx + apy * apy
f = abx * abx + aby * aby
if e >= f:
bpx, bpy = p[0] - b[0], p[1] - b[1]
return bpx * bpx + bpy * bpy
cross = abx * apy - aby * apx
q, r = divmod(cross * cross, f)
return q + (1 if 2 * r >= f else 0)
def segment_hit_iu(p, a, b, dist_iu: int) -> bool:
"""Whether integer point p lies within dist_iu of segment a-b (KiCad's TestSegmentHit).
dist_iu == 0 is KiCad's IsPointOnSegment: p exactly on the segment, ends included.
"""
px, py = p
ax, ay = a
bx, by = b
if dist_iu == 0:
sx, sy = bx - ax, by - ay
vx, vy = px - ax, py - ay
if sx * vy - sy * vx:
return False
return sx * vx + sy * vy >= vx * vx + vy * vy
xmin, xmax = (ax, bx) if ax <= bx else (bx, ax)
ymin, ymax = (ay, by) if ay <= by else (by, ay)
if ymin - py > dist_iu or py - ymax > dist_iu:
return False
if xmin - px > dist_iu or px - xmax > dist_iu:
return False
if ax == bx and ymin < py < ymax:
return abs(ax - px) <= dist_iu
if ay == by and xmin < px < xmax:
return abs(ay - py) <= dist_iu
return _sq_distance(p, a, b) < (dist_iu + 1) ** 2
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |