Gasman2014 / KiCad-Diff

Scripts for performing image diffs between pcbnew layout revisions
MIT License
236 stars 41 forks source link

KiCad PCBNew plugin #1

Closed hildogjr closed 4 years ago

hildogjr commented 5 years ago

Could be interesting the installation as a PCBNew plugin, allow the check of the current PCB with other file.

Gasman2014 commented 5 years ago

The plotting routing is too slow using this technique to make an action plugin viable. I think the approach that Thomas Pointhuber has started working on is likely to be more fruitful especially if it can use the native canvas. An action plugin with the ability to select two diffs and view in the native viewer would be awesome

https://forum.kicad.info/t/net-aware-pcb-diff-tool-kicad-python-demo/12270 https://forum.kicad.info/t/net-aware-pcb-diff-tool-kicad-python-demo/12270

The .kicad_pcb file has three main sections. The first is all page setup stuff which doesnt tend to move around and is easy to diff.

The second section is a list of footprints with some positional parameters., This SHOULD be easy to diff except that kicad moves sections around seemingly at random, which makes it tricky to produce a meaningfull diff.

The third section is a list of tracks/zones etc which is much harder to diff meaningfully but the tracks are tagged with the Net name so a better approach would be to outline net sections and see where/if they were coincident.

It would be more helpful to diff section 1 in a conventional manner. Ideally section two needs some way of plotting the footprints in a native canvas and then comparing the differences in the s-expression tree to identify which pads etc have moved. (like the link I have added above) Finally, the affected nets need to be walked through and highlighted where they diverge.

I have used a slightly convoluted way of plotting the gerbers to svg, converting to png and doing a compare procedure using image magick - it is very accurate - you can use resolutions of as much as 1000dpi but that slows things down and a more reasonable compromise is 300dpi. Nevertheless, a Eurocard size board takes 40 seconds or so to render - this is fine for a one off but it isn't really suitable for quick comparisons. If you don’t go down a native parser route, I think doing something by directly overlaying SVG files might be more productive as then you have only to use a native svg plotting routine in Kicad.

Here are a series of professional EDA software comparison tools - most use a tree type approach to identify differences. (from Thomas Pointhuber)

Some examples of commercial EDA diff-tools:

On 3 Oct 2018, at 17:25, Hildo Guillardi Júnior notifications@github.com wrote:

Could be interesting the installation as a PCBNew plugin, allow the check of the current PCB with other file.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Gasman2014/KiCad-Diff/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AIAyuWX1HWyihSok1AlRH_Vb_Ayu66FSks5uhOT0gaJpZM4XGZS-.

Gasman2014 commented 4 years ago

When I have re-written the GUI in wxPython, I will re-consider doing this. Launching from within PCBnew would be quite handy but the current modality allows comparisons between any two commits so is slightly more flexible. Having the output in a webpage, allows the user to look at the layout and the diff - if you have a big enough monitor.