This was discussed recently at /t/time-lapse-routing-video/19749, but I do not think any obviously easy solutions were suggested.
I prepared a small script that prepares a timelapse for the project I am working on. It is a project that will be used for STEM outreach and education, so it was particularly important to have that type of materials.
The short version is that I used the python interface to set the plotter to produce SVG files and then used inkscape from within the script to clean up the SVGs. In my case I applied it to a completed project, working backwards and “faking” a timelapse, but you can also run the script periodically in the background and record your actual progress.
Feedback would be appreciated and I would be happy to expand upon the current functionality.
I have never tried to make a plugin for kicad, so I am not certain. Reading https://github.com/KiCad/kicad-source-mirror/blob/master/Documentation/development/pcbnew-plugins.md makes me believe it would be very easy. However, it would be helpful if someone can point me to an API documentation that says how to find the current file name and working directory of pcbnew from within the python plugin code.
import pcbnew
import os
board = pcbnew.GetBoard()
full_path_to_layout_file os.path.abspath(board.GetFileName()
import os
path_to_current_working_directory = os.getcwd()
You could also make the GUI with which one could control where the images are written and start, pause and stop recording. For ideas look into implementation of Length stats plugin
I did remember a good Pcbnew Action Script tutorial. But basically you have to load the dialog/code/python module though a __init__.py file and use the as use are already using in python.
@stefank, Nice video. I like it! Welcome to the forum. Thank you for posting hypertext links to your code and to your motivation on your blog. I think it would be an nice if you added an option of how long to wait, in seconds, between successive displays (frames) of the routing process you are documenting. For example, if the time now is 0.25 s, or 4 frames a second, it would be nice if you could vary the time between 0.25 s and 30 s. Additionally, I think it would also be nice to give the video ( a sequence of photographs played in rapid succession that gives the viewer an impression of motion) viewer a way to stop and replay the video in order to contemplate your layout method.
I program in C and C++. Your excellent example program and MitjaN’s post push me toward learning Python as well.
@hermit, Thank you for posting your FAQ URLs. I will look through them and maybe learn something I didn’t know.
I am using last Nightly on Ubuntu 20 using Python3 (also the decrepit Nightly of Ubuntu 16.04 using Python2).
Follow the script version that I am using pcb2gif.py (5.6 KB)
Maybe you are simply running out of RAM? (I have used the script only for rather simple boards, but for a large board one might need to do skip 9 out of 10 steps to make it reasonable) I will try your example pcb file later today.
Could it be but I doubt that is the computer limitation, maybe some Python memory limitation, since this work computer mine have large RAM and the load indicator doesn’t change during the script execution.
But yes, we could design a function with this all option and after add the “Pcbnew action plugin” capability for others users.