All articles tagged as:

python

Automating PCB Layout for Milling

This post describes pcbpack, a Python script that automates the process of laying out multiple PCBs on a single panel for CNC milling. The tool is part of my gctools package, a Python framework and set of tools for manipulating gcode available on GitHub. When I started learning how to mill PCBs with a CNC I was making a single board at a time which turned out to be time consuming and prone to error. Each board needed to be positioned and aligned, the blank PCB needed to be trimmed to size and every milling operation presented it's own unique set of issues. Given that blank boards come in stand…

Read more »

Massage Your Gcode With Python

Since I first acquired my CNC machine I started building a set of tools in Python to let me generate and manipulate gcode files. I have now released this code on GitHub under a Creative Commons Attribution-ShareAlike license in the hope it will be useful to others as well. Disclaimer: Please be careful before using any of the gcode generated by these tools on your actual machine. Although I use it successfully myself on a range of projects I cannot guarantee that it won't damage your machine or behave differently in your environment. A good check is to run the resulting code through OpenSCAM…

Read more »

Source Code Visualisation

I've always been enthralled by those code visualisation videos produced with gource and recently I had the opportunity to generate one for the code base for our new product at the company I work for. Unfortunately I can't show you that one but I was inspired to generate one for my own code. For my video I took a slightly different route. Rather than concentrate on a single project I modified this script to scan for all GIT repositories under the working directory and create a combined log file (with duplicate repos removed) that can be fed into gource (you can find my modified version here). I…

Read more »

Diversions: A Corkboard Generation Script

Miserable wet weather and other commitments have prohibited me from getting out to the Lab to work on the AVR programmer and I don't have any code in a bloggable format yet so I had to come up with something else to write about. In a previous post I played around a bit with Photoshop to simulate the old Polaroid style instant film stock posted on a corkboard. You can see that image on the right. I think it's a really nice way of showing a bunch of images in a single embedded image - a lot easier on the eye than trying to put all the individual images on one page and very well suited when you w…

Read more »