This is a question about what features the community would want to see in a web viewer for KiCAD files.
I’ve been using the STEMN beta for about a month, and I’m really liking it. It’s a way to share and collaborate on hardware projects online that uses Dropbox or Google Drive to keep files in sync.
They have in-browser rendering for many file types, and they’re currently discussing how to support more open source file formats: FreeCAD, KiCAD, etc. The EDA renderer is also up for a possible rework. If you scroll down to the 4th comment on this thread you’ll start to see the discussion that sparked this post. There’s also a separate feature request for KiCAD support here.
I’m interested in KiCAD file support in STEMN because one of my projects relies on KiCAD. However, I’m new to KiCAD, so I don’t know what features would be best in a viewer. There’s an online service called eyrie.io that seems to have a good web viewer that supports KiCAD, but again, I’m a newbie (to KiCAD and electronics design in general).
So that leads me to a few questions.
Are people interested in web viewing/rendering of their KiCAD files?
Are there already open source web viewers and/or parsers out there for KiCAD? I found a couple by Googling, but they seem to just be experiments.
What views does a web viewer need to show from the file(s) (schematic, pcb, 3D)?
What features do you feel are most important (mouse interactivity, layer handling, etc)?
How many different versions of the KiCAD file format are there? Are they all backwards-compatible?
Id plot the schematics and/or PCB to svg format. Then it should be easy to compare different versions. GitHub does offer online SVG diff tool.
For PCB to svg all you need is a PCBnew, as all footprints are already part of the PCB file.
For schematics you need also need cache file, and you need to tweak the schematics file to force eeSchema to read from cache first.
Both of these should be doable from console (thus can bi scripted) but I’ve never used console interface to eeSchema or PCBnew. I just heard that it exists.
It would be useful to have a piece of Javascript to display a KiCAD schematic in the browser. Convert it to SVG and let the browser render the SVG. Great for discussion forums. Textbooks and how-to articles could use them. Github should have a viewer for them.
Board layout display isn’t as useful. People discuss and exchange schematics. Board design files go to the fab shop, and if there are problems, you need full EDA tools to deal with them. If you just want to show a board, you post an image.
It seems that somebody was already working on eeschema and pcbnew command line interface, but their work has not been included in the release versions.
I experimented with UI automation and eeSchema (Scott Bezek’s blog post), and hit a major problem (for me anyway). UI automation will work in headless mode when a monitor is not installed, but not in a purely console-only environment. I suspected that when looking at the readme for Scott Bezek’s project, but I went ahead and tried it anyway.
I’m still working through the other links that have been posted, and will check out eeshow next.
I’ve got a script working on Ubuntu Server 16.04 (headless, text-only) which will convert a .sch file to a .svg file.
However, the eeschema file that I create on my Ubuntu 16.04 desktop throws an error about the motors library not being present. I’ve included the version info for each eeschema installation below. My question is how should I set the Ubuntu server KiCAD installation up to minimize the problems that users would have doing a conversion? Are there standard libraries that I need to install? Do I need to force the server to run the latest version of KiCAD? Once this script is working well the next step will be to wrap it in a sample Node.js app so that it can be used as a web service. I’d like to have instructions on how to install KiCAD available so that as many users as possible will be covered.
The -cache.lib file should come along the .sch file. All you need to do is parse .sch files and place the -cache.lib as the topmost library. You should also add -cache.lib to .pro file at the top of the list. This way the eeschema will find all of the symbols. It might still complain about not finding the rest of the libraries.
@MitjaN I’m showing my inexperience with KiCAD here. How do I place the *-cache.lib file as the “topmost library”? I tried creating a lib_sch directory and set the library search path as described in this Hack-a-day post.
When you talk about adding *-cache.lib to the .pro file, do mean adding it as the value for LibDir here in the text of the .pro file?