(This is not about a plugin, but I can’t find a better category for this.)
One reason I wrote the render
script described in Deterministic scripted generation of schematic PDFs and Gerbers was to make it easy to view the schematic and board layout of the project without having to install KiCad and clone the repo. And additionally, of course, be able to grab the Gerbers and just send them to a PCB fab without having to use KiCad to generate them.
The schematic thing is solved; I create a PDF and commit it, and anybody browsing the project on GitHub (or wherever) can easily view it in their browser. (Well, actually, at the moment for GitHub stuff you click it, it downloads, and then you need to open the downloads dropdown and drag it to your browser display area to open it that way.)
But viewing the board layout is more difficult. My initial thought was to render the top and bottom (or both together) to a PNG or similar image, but then you have to decide on a size (which is always going to be too large or too small for certain purposes), and you have yet more generated files being committed, and so on.
But then it occurred to me, there are plenty of on-line Gerber viewers, both from the PCB fabs and stand-alone. And especially nice is that for some of them you can just give them a URL whence to download a ZIP file, rather than having to download the Gerbers yourself and then upload them again to the site. The open source site Tracespace view is one of these. (And, interestingly, several PCB fabs seem to be re-using that code.)
That site has an unfortunate problem, however: though the ZIP I generate for JLCPCB is rendered quite nicely in it, it’s unable to download it from a standard GitHub “raw download” link because that doesn’t actually link directly to the file: it goes through one or two HTTP 302 redirects and tracespace.io’s download code can’t follow redirects.
I solved this (for some definition of “solved” :-P) by writing yet another script, ghdl-url
. You can run this at the command line and give it the path to any file in your Git repo and it will construct a standard github.com
“raw download” link and then chase it down through all the redirects to give you the final raw.githubusercontent.com
link that actually gives you the file. You can then paste this into tracespace.io and immediately see the Gerbers both as layers and rendered board top and bottom sides. (All completely zoomable and the like.)
So that gets me to the point where I can put something like the following in the README for a project:
You can download the schematic in PDF format and a ZIP of the Gerbers. The latter has been tested with JLCPCB, and you can also give that URL to tracespace.io to view them.
So, not bad, but the one thing that would be super-nice would be able to give a link that could go directly to an on-line Gerber viewer and load the ZIP from that URL directly, rather than the user having to copy and paste it. It would need something like a ?url=
parameter in the link that would let me specify this.
This wouldn’t be too hard to add to tracespace.io (which is open source), but unfortunately that project appears no longer to be accepting any changes. I suppose I could fork it and host my own version of it, but before I get too deep into considering that, does anybody know of any currently maintained on-line Gerber viewers that accept a URL parameter to load a ZIP file from the web?
I’m also interested in any other thoughts on the general idea of how to make “quick views” of KiCad projects easily available to those who don’t want to do the “install KiCad and clone the repo” thing.
Constructive criticisim on any of this is welcome; I’d prefer that people who hate this whole idea not post because that seems to lead to threads just being closed.