Base ExampleCommandModel.png Tutorial

Topic
{{{Topic}}}
Level
Intermediate
Time to complete
20 minutes
Author
piffpoof
FreeCAD version
0.14 or above
Example File(s)
[1] example data set #5


Introduction

In this tutorial we will continue on from XXX. In the previous tutorial we used the Sketcher and the Part Design workbench to create a housing for a lock. This tutorial will make a key to fit the housing but will exclusively use the Part workbench so as to show how to bring these two different approached together into one model.

Tutorial example screen snapshot2.jpg

Problem Background

Nominally we're setting out to create a key for our lock housing from the previous tutorial. We will integrate the key which we produce with the Part workbench with objects created previously using the Sketcher and Part Design workbench.

One thing to realise is that there is no "geometry" or formulas that we can use to control the positioning of the different parts. We will place the key at the correct location, we will do this manually. Should the lock housing ever be moved, then the key would have to be moved manually at that time.

Our key will not be overly realistic as this tutorial is really focussing on producing results using more than one workbench.

We will make the key in 3 pieces:

  • the key shaft
  • the teeth of the key
  • the handle of the key

All of this will be done using the Part workbench.

Preparation

FreeCAD has numerous facilities and features. To make our work easier in this tutorial, we need to make sure some of them are visible. From the menu bar at the top of the screen select the option View->Views->Combo View. This will produce the Combo View which is a browser with two panes, one above the other. The upper pane has two tabs Model and Tasks - select Model. The lower pane also has two tabs View and Data - select Data.

Viewing Work in Progress

While working through the tutorial, utilise the Standard View icons built into FreeCAD which will allow you to manipulate your viewpoint and so therefore better see what is being done. The icons are: View-zoom-all.svg, View-zoom-selection.svg, View-axometric.svg, View-front.svg, View-top.svg, View-right.svg, View-rear.svg, View-bottom.svg, View-left.svg all of which are described on the page Standard View Menu. Manipulating the viewpoint does not effect any of the objects being constructed. The very nature of 3-dimensional modeling means that often some of the result of an operation will be on an aspect of the model not currently visible. Judicious use of the viewpoint allows the modeler to fully appreciate the model being developed.

Creating the Key Shaft

  1. Switch to the Workbench Part.svg Part workbench.
  2. Click on Document-new.svg to create a new document.
  3. Click on Part Cylinder.svg Cylinder, a new cylinder will be created at the origin.
  4. In the Combo View click on the Cylinder and press Return.
  5. Now enter the text key shaft and press Return.
  6. In the bottom pane of the Combo View, click to the left of the Placement, Angle, Axis and Position should become visible.
  7. Click to the left of Position, x, y, and z should become visible.
  8. In the y field either enter 10 or use the small arrows to the right to decrement the existing value (which will be 0).
    Note: this manually places the key shaft at 0,10,0 which is the centre of the hole of the previously made lock housing.
  9. In the Radius field, enter 4.
  10. In the Height field, enter 100.
  11. Save your work: select the menu option File->Save, or click the Document-save.svg Save icon; or press Command-S.

Creating the Key Teeth

First a bit of preparation before we model the teeth of the key.

  1. In the Combo View, click on the 'Sides' to select it.
  2. Press the Space to toggle the visibility of the selected object - in this case it will make the object 'Sides' invisible.
  3. At any time, 'sides' can be made visible again by selecting it and pressing the Space key.

With the 'sides' not being visible, we can now see into the lock housing so we can observe the modeling of the teeth of the key.

Create Rough Key Teeth

  1. Click on Part Box.svg Cube, a new cube will be created at the origin.
  2. In the Combo View click on the Cube and press Return.
  3. Now enter the text key teeth rough and press Return.
  4. In the bottom pane of the Combo View, click to the left of the Placement, Angle, Axis and Position should become visible.
  5. Click to the left of Position, x, y, and z should become visible.
  6. In the x field, either enter -3 or use the small arrows to the right to decrement the existing value (which will be 0).
  7. In the y field either enter -10 or use the small arrows to the right to decrement the existing value (which will be 0).
  8. In the z field either enter 5 or use the small arrows to the right to increment the existing value (which will be 0).
  9. In the Length field, enter 6.
  10. In the Width field, enter 20.
  11. In the Height field, enter 25.

Create Cutouts for Key Teeth

We will now create some cutouts on the key teeth.

  1. Click on Part Box.svg Cube, a new cube will be created at the origin.
  2. In the Combo View click on the Cube and press Return.
  3. Now enter the text key teeth cutout#1 and press Return.
  4. In the bottom pane of the Combo View, click to the left of the Placement, Angle, Axis and Position should become visible.
  5. Click to the left of Position, x, y, and z should become visible.
  6. In the x field, either enter -3 or use the small arrows to the right to decrement the existing value (which will be 0).
  7. In the y field either enter -6 or use the small arrows to the right to decrement the existing value (which will be 0).
  8. In the z field either enter 22 or use the small arrows to the right to increment the existing value (which will be 0).
  9. In the Length field, enter 6.
  10. In the Width field, enter 10.
  11. In the Height field, enter 8.

    We will re-use key tooth cutout#1 to make a second cutout:

  12. Single-click on key teeth cutout#1, once it is Selected, Copy it (Command-C or Edit->Copy).
  13. Paste it (Command-V or Edit->Paste). It will receive a name something like key teeth cutout#002. The actual name is not that important, as long as it is different from the first cutout we created.
  14. Single-click key teeth cutout#002 and press Return. Change the name to key teeth cutout#2 and press Return to exit Edit mode.
    Note: The copy of the original will have all the Placement values of the original - in other words, the two objects will be both existing in the same physical space.
  15. In the bottom pane of the Combo View, click to the left of the Placement, Angle, Axis and Position should become visible.
  16. Click to the left of Position, x, y, and z should become visible.
  17. In the z field enter 5.

Use Boolean Operations to Create Finished Key Teeth

  1. Single-click the 'key teeth' in the Combo View to select it
  2. Holding down Command, single-click on 'key teeth cutout#1' to select it.
  3. Click on Part Cut.svg Cut to cut the second object from the first. Notice that the resultant is another object called something like 'Cut'. The two objects that were used to form the result are encapsulated within the resulting object. Click to the left of 'Cut" to view the 2 objects used to form it.
  4. Single-click the object 'Cut' just created
  5. Holding down Command, single-click on 'key teeth cutout#2' to select it.
  6. Click on Part Cut.svg Cut to cut the second object from the first. Notice that the resultant is another object called something like 'Cut001'. The two objects that were used to form the result are encapsulated within the resulting object - one being the resultant from the first cut operation.
  7. In the Combo View click on the second Cut resultant and press Return.
  8. Now enter the text key teeth and press Return.
  9. Save your work: select the menu option File->Save, or click the Document-save.svg Save icon; or press Command-S.

Creating the Key Handle

The sides should still be invisible from the previous steps.

  1. Click on Part Cylinder.svg Cylinder, a new cylinder will be created at the origin.
  2. In the Combo View click on the Cylinder and press Return.
  3. Now enter the text key handle part 1 outer and press Return.
  4. In the bottom pane of the Combo View, click to the left of the Placement, Angle, Axis and Position should become visible.
  5. In the Angle field enter 90.
  6. Click to the left of Axis, x, y, and z should become visible (but these are X, Y & Z for the axis, not for the position).
  7. In the y field either enter 1 or use the small arrows to the right to increment the existing value (which will be 0).
  8. In the z field either enter 0 or use the small arrows to the right to increment the existing value (which will be 1). Notice that the cylinder has now changed it orientation. The x axis should remain at 0.
  9. In the x field enter -5.
  10. In the y field enter 1.
  11. In the z field enter 103.
  12. Single-click on key handle part 1 outer, once it is Selected, Copy it (Command-C or Edit->Copy).
  13. Paste it (Command-V or Edit->Paste). It will receive a name something like key handle part outer002. The actual name is not that important, as long as it is different from the first cylinder we created.
  14. In the Combo View click on the cylinder you just pasted and press Return.
  15. Now enter the text key handle part 1 inner and press Return.
  16. In the Radius field enter 6.
  17. Single-click the 'key handle part 1 outer' in the Combo View to select it
  18. Holding down Command, single-click on 'key handle part 1 inner' to select it.
  19. Click on Part Cut.svg Cut to cut the second object from the first. Notice that the resultant is another object called something like 'Cut'.
  20. In the upper pane of the Combo View, click to the left of the Cut object just created, it's component objects (i.e. 'key handle part 1 inner' & 'key handle part 1 outer') should become visible.
  21. In the Combo View click on the Cut you just made and press Return.
  22. Now enter the text key handle part 1 and press Return.

    We will re-use key handle part 1 outer to make a piece of the handle:

  23. Single-click on key handle part 1 outer, once it is Selected, Copy it (Command-C or Edit->Copy).
  24. Paste it (Command-V or Edit->Paste'). It will receive a name something like key handle part 2 outer 001. The actual name is not that important, as long as it is different from the previous cylinder we created.
  25. In the Combo View click on the newly created 'key handle part 2 outer001' and press Return.
  26. Now enter the text key handle part 2 outer and press Return.
  27. In the y field enter 19.
  28. Single-click on key handle part 2 outer, once it is Selected, Copy it (Command-C or Edit->Copy).
  29. Paste it (Command-V or Edit->Paste'). It will receive a name something like key handle part 2 outer002. The actual name is not that important, as long as it is different from the previous cylinder we created.
  30. In the Combo View click on the newly created 'key handle part outer002' and press Return.
  31. Now enter the text key handle part 2 inner and press Return.
  32. In the Radius field enter 6.
  33. Single-click the 'key handle part 2 outer' in the Combo View to select it
  34. Holding down Command, single-click on 'key handle part 2 inner' to select it.
  35. Click on Part Cut.svg Cut to cut the second object from the first.
  36. In the Combo View click on the Cut you just made and press Return.
  37. Now enter the text key handle part 2 and press Return.
  38. Save your work: select the menu option File->Save, or click the Document-save.svg Save icon; or press Command-S.

Results

The twelve objects we have created now constitute a simplistic key, to fit the housing for a lock from the previous tutorial.

There is an example data set #99 which has the results so far. You can download this and compare it to your own results.

Further Ideas

  • Animate the key (see tutorial YYY)

Summary

We used the following tools in this tutorial:

  • Cube, Cylinder and Cut from the Part workbench

Further Information

To Do On Tutorial

  • Groups
  • should the example file hold the lock housing also, or should the tutoiral cover import project...