12 Dec 2014: Revision 3.2 CAD/CAM using Blender and OpenSCAD

After nearly finishing the revision 3.1 PCB layout, a screenshot was overlaid onto the Blender CAD/CAM and found to be completely wrong. The layout therefore had to be redone (again), with the lesson learned to include the casework layout as part of the iterative process.

The actual original development of the blender file took weeks, however now that all the parts exist actual modifications are relatively quick and simple, meaning that iterations between three separate programs (PADS, Blender and OpenSCAD using pyopenscad) is not a huge challenge once underway. The first screenshot below shows how two (opaqued) images help ensure that 3D blender blocks are placed in suitable locations. There are two images: the first is (another) screenshot of the PADS PCB components, whilst the other is a picture of the touch panel. Both images are set to near-transparent levels so that the lines (bright red) of the blender-rendered components can be created and adjusted to fit the PCB images. For example: along the top edge it can be seen that the film connector from the touch panel is arranged to line up with the 10-way connector of the PCB.

After exporting to an STL file, which may be imported with pyopenscad, a second screenshot shows how the casework can be fitted around the internal components. As the layout of the casework is done in python, adjustments are incredibly easy to iterate, and are much easier than using GUI tools (such as Blender). The problem with using a mouse is that it is not only inaccurate but also there is often absolutely no control over linking even two numbers together so as to avoid either mistakes or extra work. By specifying numbers as variables in python it is possible to simply substitute those into functions. Simple, straightforward, accurate, efficient and effective, and with key re-mapped bindings used in vim to not only save the file but also to run the python interpreter to re-generate the OpenSCAD file (where OpenSCAD is set to automatically recompile) iterations are fast, as well. The vim key binding is as follows: :map , <Esc>:w<CR>:!python car_model.py<CR><CR>