Archive for June 2015

Fasteners workbench for FreeCAD

Update 21-Jul-2015: Updated to Ulrich’s V2.0 screw_maker. More fasteners and nuts!

Update 01-Oct-2015: Add Bill-Of-Material generation

Many times when I design parts in FreeCAD (Specially Sheet Metal) I need to add standard fasteners such as screws, press-nuts, stand-offs etc… I used to add them manually, usually just as a rough shape, just to have it in the drawing for clearance. Fortunately, volunteers from the FreeCAD community begun to release addons  to generate such standard parts automatically. One of these addons is the very nice macro by Ulrich Brammer, that generates several types of screws with high accuracy and conformance with the standard.

To make it easier to use, and also conform with parametric nature of FreeCAD, I decided to write a simple workbench wrapper with WYSIWYG Icons and some controls.


Starting from Frecad 0.17, The installation is simple and done using FreeCad’s Add-on manager (Under ‘Tools’ menu)

For off-line manual installations:
Download this file: FastenersWb
Extract the file into FreeCAD Mod directory.
(On Windows its somewhere like “C:\Program Files\FreeCAD 0.18\Mod”, On Linux: “~/.FreeCAD/Mod”  , create it if not exist)
That’s it.
Under the Mod directory you should see a new directory called Fasteners:


How to use:

Usage is pretty straightforward:

Start a new document in FreeCAD. Select the Fasteners workbench from the drop-down list.

A series of screws will show on the toolbar:

Simple Usage:
Clicking on any of the screws will create this screw in the origin position with default size. To change size/length select the newly created screw, then go to the data tab in the property panel, there you can change diameter and length. (For now it is in metric standard):


Changing the “thread” property to “true” will render the screw threads as well. Please note that generating threads takes considerable amount of time, during which, FreeCAD will not be responsive.
The invert and offset properties are only applicable to attached fasteners. See next.

Attached fasteners:
Fasteners can also be attached to features in other parts. To attache a screw to a part, the part must have features with circular edges, such as holes. To attach screws to holes, select the desired circular edge or several edges (You can also select a face if you want to select all holes in that face):

Now click on the desired screw. A screw will be placed on each of the selected features, trying to match the screw size to the hole size:

You can now, like before, change diameter and length from the properties panel. If you wish the screw to hover above the hole, you can set the “offset” property  to the desired distance. Sometimes the screw does not detect the direction correctly and appears upside down. To correct this change the “invert” property to true, or select the screw and press the Flip button (FSFlip) in the toolbar.

To attach an existing fastener to a different feature, select the screw, then control-select the new feature:

Now press the Move button (FSMove) in the toolbar. The screw will move to the new location:

An attached screw will move with the part it is attached to. If you wish to detach the screw from the parent part, simply select only the screw, then press the move button. The screw is now detached and can be moved individually.

Simplifying objects

It is important to note that if you wish to share FCStd files that contains fasteners (or parts from other custom parametric workbenches)  with other people, they must install these workbenches as well, or else they will get errors when trying to use them.
However, if you just want to share the resulting parts, with no need to change object’s parameters, you can use the Simplify (SimplifyObj) function, to convert the fasteners to simple shapes. They will appear as new Shape parts in the model tree. You can then delete the original fasteners and save as a simple FCStd that can be read and used on any FreeCAD installation.

Source Code:

For those who are interested, GitHub code can be found here.

Future planned features:

The current workbench is just a wrapper to the screw_maker macro. As so it shows only screws (and a washer). I hope to soon add some press-nuts(added), studs(added) and stand-offs(added).

Once again, many thanks to Ulrich Brammer for his great screw maker macro.

That’s all folks!
Hope it helps.


Sheet metal Addon for FreeCAD

Update 29 Apr 2016: Updated Ulrich Brammer’s Unfolding tool to ver 17. Thank you Ulrich!

As part of doing home made projects one needs some kind of CAD software to design mechanical parts. As a fan of open source software I use FreeCAD which is a great alternative to the market’s highly expensive Solid CAD software.

One thing I use a lot, is designing Sheet Metal parts. As there is no special support for it in FreeCAD, it tends to take time to design Sheet Metal parts, as I need to manually add sketches, extrude walls, and add fillets. Furthermore, If I found something to be wrong in the base part, I have to go over the entire process to fix it.

This is where open source software shines. If I need a new feature, I can just go ahead and add it. Turns out FreeCAD is very friendly to extensions. So I decided to add a sheet metal extension and share it with others. One thing worth mentioning: there is this guy who is working on a sheet metal extension which will probably be far better then mine, but until he releases it, my extension can help speed up part design.

Installing the extension

Starting from Frecad 0.17, The installation is simple and done using FreeCad’s Add-on manager (Under ‘Tools’ menu)

For older versions:
To use the sheet metal extension, first you need to install the latest version of FreeCAD (0.16 at the time of writing) if yo dont have it already.
Now go ahead and download the extension: SheetMetal_V0.0.18
Extract this zip file into the Mod directory under the FreeCAD installation path. (on Windows it’s something like “C:\Program Files\FreeCAD 0.16\Mod”)
You should now see a new directory under Mod: SheetMetal.
That’s all for installation.

Working with the Sheet Metal extension

To simply understand how to work with the Sheet Metal extension, here is a sample workflow:

Start with thin layer solid shape, either by extruding a sketch, or creating a thin Box. From the workbench drop-down select “Sheet Metal”. Now select one of the side faces of your objects:


The Sheet Metal workbench shows 2 command icons:

BendIcon Bend: Add bended extension

ExtrudeIcon Extrude: Add a strait extrusion of the face

Click the Bend tool:


A 90 degrees bended extension with default values will be added. You can now play with the bend parameters by selecting the Bend part in the model tree, and then the Data tab underneath. In the parameters table, change the length to 7mm and add a 2mm gap on both sides:


Let’s extend the bended flap sideways. Select both side faces of the new wall. (Press and hold Control to select multiple faces). Now click the Extrude tool:


Shape the result: In the parameters panel, set length to 5mm and gap2 to 1mm:


Now let’s add more bended extensions. This time select 2 side faces of the base to make 2 symmetric bends. Click Bend. Set the length to 7mm:


That’s it, you can continue now and add more bends and extrusions until you get you desired final part. The nice thing about it all that the final part is fully parametric. This means that any change in a parent part will immediately propagate to the dependent parts, without the need to redo them. Click the gray “Cube” part from the model tree, and change the Length to 60mm. See how all the bends adjusts accordingly:


The parameters of the Bend give you lots of flexibility. You can for example add just the bend, by setting the Length to zero, or even just add the relief cuts, by setting the bend angle to zero as well:


Upon completion of the sheet metal part, you can select the OpenScad workbench and use the Refine (RefineIcon) tool to cleanup the geometry.

Here is a sample part made with several symmetric bends:


That’s all! Hope it helps someone. Over time I will try to add some more features and keep the above updated. You are welcome to leave comments and suggestions.

Update 13 Jun 2015: Ulrich Brammer’s Unfolding tool Added. Thank you Ulrich!

Ulrich Brammer’s great unfolding tool is now integrated into the workbench. Many thanks for the developer. To use it, simply select any one of the faces of the folded sheet metal and press the Unfold (UnfoldIcon) icon