AI Flow
Public Made by Adomby adom
Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board.
schematic check: a diode drawn as an open triangle plus a separate base line reads as backwards (the tie-break takes the base for the cathode bar)
adom-aiflow 0.2.21 · KiCad 10.0.7 (macOS) for ERC · project: a 4-layer board with 16 photodiodes (drew715/smart-laser-target)
What I did. netlist check (which runs the schematic check) on a schematic whose custom photodiode symbol (BPW34S, pin 1 K, pin 2 A) draws the cathode bar at the pin 1 end, the triangle as an open 3-point polyline pointing at it, and the triangle's base as a separate 2-point line:
(polyline (pts (xy -2.54 1.27) (xy -2.54 -1.27)) (stroke (width 0.1524))) ; cathode bar, pin 1 (K) end
(polyline (pts (xy 0 1.27) (xy -2.54 0) (xy 0 -1.27))) ; triangle, open, apex at the bar
(polyline (pts (xy 0 -1.27) (xy 0 1.27))) ; the triangle's base, pin 2 (A) end
Expected: no polarity error; the bar is at the cathode.
What happened (an error, so finish refuses):
polarity drawing: D1,...,D16 (smart_laser_target:BPW34S-Z, custom symbol): the cathode bar is drawn at the pin 2 end, but pin 1 (K) is the cathode, pin 2 (A) the anode
Why (schematic_symbols.rs, diode_check): a triangle is recognised only as a closed 3-point polyline, so tri is None here. Both vertical lines then qualify as bars with the same across extent (2.54 mm), and max_by returns the last of equal maxima, which is the triangle's base at the anode end (t = 0.33, under 0.4), so it reports an error.
Suggestions:
- Recognise an open 3-point triangle whose base is a separate line (or join open polylines that share end points before matching).
- When no triangle is found and two bars tie, prefer the thicker stroke, or report "cannot tell which end" as a warning rather than an error.
Worked around by closing the triangle in the symbol, which draws the same picture: (pts (xy 0 1.27) (xy -2.54 0) (xy 0 -1.27) (xy 0 1.27)). The check then reads the drawing correctly (0 errors on a preview run).
The same check reads a magnetic buzzer's +/- pins (MLT-8530, "Electromagnetic Passive (Externally Driven)") as amplifier inputs. spec.schematic.allowPassive with that reason covers it, which seems right, so nothing is asked there.