Woodworking designs with FreeCAD

In this article we give an overview on how we design woodworking projects in FreeCAD. The article contains quite a few fixes and workarounds that make the work with FreeCAD easier and more comfortable.

FreeCAD is an open source software that is mainly geared towards mechanical engineers. A lot of the details are clearly more oriented towards products that have few but rather complex parts – not so much a woodworking project that mainly consists out of simple boards. For a more detailed comparison of different software solutions tale a look at our CAD for makers article.

Designing a parametric Japanese Toolbox

As an example we use this Japanese Toolbox design we use in a variety of sizes.

 

The big advantage of FreeCAD is that it is fully parametric and you can change dimensions after finishing the design. We only have to change the parameter in a spreadsheet and the box becomes square. In the same way we could also change the material thickness and create tiny boxes as well as large storage containers.

  

The first step is to create this spreadsheet with all the dimensions. For the box these are the material thickness, as well as the inner width, length and height. We use the Alias Manager Macro to create aliases for these numbers so that we can refer to them by name later. This Macro can be installed over the Addon Manager of FreeCAD.

Part Design

After having saved the file with the spreadsheet under the filename Master comes the part that is quite cumbersome.

We create a new file for each individual board. In the part workbench we add a cube.

To enter a formula for the dimensions we click the blue circle. This cube gets then dimensions from the spreadsheet in the format filename, hashtag, table name, dot, variable name. This would be for example Master#p.Material.

You can also perform calculations when entering the dimensions, e.g. adding four times the material thickness to the overall length.

Assembly with the Assembly 2+ workbench

After creating all the files following the same schema we make sure the Assembly 2 plus workbench is installed. Go to Tools, Addon manager and install the latest version.

For the cutlist functionality we will discuss later you have to change two files of this addon.

First modification: In the directory where the Assembly 2+ workbench is installed (under Linux that is the directory ~/.FreeCAD/Mod/A2plus) replace the file a2p_partlistglobals.py with the one that you can download here.

Second modification: You will also have to modify the file a2p_bom.py in the same directory.  Look for the following two lines in the file. In the current version these lines start at line 113:

 # last entry of partinformations is reserved for filename
partInformation[-1] = os.path.split(linkedSource)[1] #without complete path...

After these two lines paste the following code:

	    # #########################################################
            # add dimensions from the overall bounding box of the file
            # in the last 3 fields before the filename
            bb = FreeCAD.BoundBox();
            dc = FreeCAD.openDocument(linkedSource)
            for object in (dc.findObjects("Part::Feature")):
	               bb.add( object.Shape.BoundBox )
            partInformation[-2] = str(bb.ZLength)
            partInformation[-3] = str(bb.YLength)
            partInformation[-4] = str(bb.XLength)
            FreeCAD.closeDocument(dc.Label)
	    # #########################################################

This will add the dimensions of each board in the table discussed later in the article.

Also make sure that in Edit, Preferences, A2plus the checkboxes for “Recalculate imported parts before updating them” and “Use experimental topological naming” are enabled.

After switching to the A2plus workbench we can now import the individual parts one by one with the button that shows a plus sign . These parts can be aligned with one another in a variety of ways.

For woodworking projects most of the assemblies can be solved by making planes coincident.

Just select two faces that you want to align, click on the plane coincidence button and decide if the two objects are opposed or aligned with one another.

After aligning three faces a board is locked in place. Assembling a project this way is fast and actually quite fun.

Creating a Cutlist

After everything is assembled we create a cutlist with the part list button. If the dimensions are not listed please modify the A2plus workbench as described above.

We import the cutlist in libreoffice so that it is easy to calculate square footage, price, weight and other data.

You can also export the data to another software such as Cut List Optimizer, a free (but not open source) optimization program that helps you to optimize sheet good usage.

When we use hardware such as hinges or knobs for a project we add information about a part directly in the cad file. To do so just select the part info button from the assembly 2 plus workbench and you can add various information.

All this information will at the end show up in the part list and makes cost calculations and ordering parts easy and convenient.

Creating a drawing

Besides the cutlist a drawing is quite helpful when building the final piece. In the TechDraw workbench we create a new drawing and are now free to insert different views.

We can also select only part of the assembly as for example the lid and generate a drawing of only these elements.

We scale them and add measurements that will help us when assembling the parts.

Rendering the object

Sometimes it’s nice to get a better visualization than what the CAD application can offer. With a few clicks we change to the raytracing workbench, add a new povray project and add our objects to that rendering.

 

With the default settings the rendering looks bad as it is missing any texture.

In the following we describe how to use a different template file and how to fine tune the result so that it looks like this picture:

Optimizing povray renderings in FreeCAD

We start with downloading a few files that will help us improving the rendering quality:

  1. Download the file WayofWood.pov and save it in the directory ~/.FreeCAD/data/Mod/Raytracing/Templates
  2. Download the Python script texturepov.py and save it somewhere on your local machine
  3. Download the Colormatching PDF and print it as a reference

In order to create a nice looking rendering quickly just follow these steps:

Create a new cube withe the Part workbench, then switch to the Raytracing workbench and select the new WayofWood Template:

Next select the cube and the povray object and use the button with the yellow square to add the cube to the rendering:

When you now hit the blue rendering button you get already a nice white cube sitting on the floor:

Click the cube view object within the povray project (not the one in the main part) and select one of the colors that are shown in the color match PDF. It’s important that you select the identical color as shown in the PDF. As an example we select magenta. Rendering the image again should result in a cube like this:

We can further improve this cube image by saving the povray file to the disk with this icon: to a file test.pov. We open the command prompt go to the directory where the file is stored and type:

$ python texturepov.py test.pov > test2.pov
$ povray test2.pov

This provides already a nice visualization without fiddling too much with the povray file:

By using other colors in the file you can easily create other wood textures. These renderings are not perfect but the povray files offer you the possibility to tweak them in detail, change the textures or add additional objects.

Under Linux you could go even one step further and create that little shell script:

#!/bin/bash
python ~/bin/texturepov.py "${@: -1}" > /tmp/povwrap.tmp 2>/tmp/povwrap.err
cp /tmp/povwrap.tmp "${@: -1}"
/usr/bin/povray "$@"

Then just replace the povray executable in Edit -> Preference by this script and you get textured renderings right within FreeCAD.

Summary

Desining for woodworking with FreeCAD is not ideal.  The assembly of the parts is cumbersome and it’s not convenient to distribute the parts among several files. The cutlist functionality is working with the hacks described above but it’s a bit tricky to use.

But for the assembly as for the rendering: The great advantage of an open source solution is that one can modify everything and add new features. Maybe you also give FreeCAD a try and let us know what you think about it.

One Comment on “Woodworking designs with FreeCAD”

Leave a Reply

Your email address will not be published. Required fields are marked *