So, I wrote this little program in C++ that reads through a KiCAD PCB file to create “stubless vias”. Quoting from a previous message I posted here:
I’m trying to achieve stubless vias (vias that do not produce a stub in inner layers due to KiCAD’s inability to have pads of different diameters for different layers). Using notation ( d , h ) to denote a via with pad’s diameter d and hole’s diameter h , I am writing a program that scans the
.kicad_pcbfile and replaces every via ( d , h ) with a via ( h + 0.002mm, h ) + pads (of diameter d ) on outer layers + pads on any layer where a track connects to the via.
For the pads, I noticed that KiCAD accepts tracks of length 0, so it seems like the most effective way to put a round pad: just create a track of width d (the diameter of the original via) and length 0 (i.e., the track goes from the position of the via, to the position of the via).
One obvious issue with this: how can I tell that my program did not introduce any defects when modifying the board file?
One obvious “candidate answer” to the above is: run the DRC on the resulting board. But I think that does not provide a strong guarantee. For example, one defect I can think of is that the program could fail to detect a trace that connects to a via in an inner layer, and then leaving the h + 0.002mm pad where the trace connects. This is definitely a defect (which maybe the manufacturer might detect and flag), but certainly the DRC in 5.1.10 does not flag it as an error (I just tested, manually crafting such situation).
The other even-more-obvious candidate answer is: just visually inspect it and ensure that the resulting board is correct. I don’t think I have to go too much into how this is a very very weak answer to the above question.
I guess my question for the forum (or more of an invitation to share any thoughts/insights that may come to mind) has two parts:
- Can you think of defects that such a program could be likely to introduce, and how could I watch for / avoid those defects? (say, if I’m inspecting the resulting PCB or the Gerbers visually)
- Are there any automated tools that I could use? (e.g., to analyze Gerbers, perhaps compare Gerbers?)