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 Sketcher and Part Design workbenches 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 PartDesign.svg Part Design workbench.
  2. Click on Document-new.svg to create a new document.
  3. Select Sketcher NewSketch.png New sketch
  4. Select the first option for the Sketch to be created in the XY plane
  5. Notice that the offset value is 0, which is where we will leave it
  6. Click OK
  7. Select Sketcher Circle.svg Circle
  8. Your first click will place the centre of the circle, your second click will set the radius of the circle. Place the centre somewhere near the Y axis.
  9. Click on the centre of the circle, then click on the Y-axis.
  10. Click on Constraint PointOnObject.svg Point on Object Constraint. The circle centre is now constrained to remain on the Y-axis.
  11. Click on the centre of the circle then on the X axis.
  12. Click on Constraint VerticalDistance.svg Vertical Distance Constraint
  13. A small query box asking for the Length will appear, enter the number 10 into it and click OK
  14. Click on the circle
  15. Click on Constraint Radius.svg Radius Constraint
  16. A small query box asking for the Radius will appear, enter the number 4 into it and click OK
  17. Click on the Close button at the top of the Tasks Tab of the Combo View
  18. In the Combo View click on the Cube and press Return.
  19. Now enter the text key shaft sketch and press Return.
  20. Single-click the 'key shaft sketch' in the Combo View to select it
  21. Single-click on PartDesign Pad.svg Pad
  22. A dialogue box will appear in the Tasks tab of the Combo View, it will have a field to enter with the label Length. Enter 100 into this and click OK. Our Sketch will receive a 3rd dimension along the orthogonal axis (which in Z for our Sketch which lies in the XY plane).
  23. We have now generated a 3-dimensional model which is 100mm high.
  24. You will notice that our Sketch has disappeared. Also a new object is appearing in the Combo View, one called Pad.
  25. To the immediate left of Pad is a small triangle point rightwards, click once on that.
  26. Now you will see both the Sketch which we created and the Pad which we created from the Sketch. Both objects are there, for ease of management the one is concealed within the other, but is always there.
  27. In the Combo View click on the Sketch and press Return.
  28. Now enter the text key shaft and press Return.
  29. 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

We will create the teeth of the key in 2 steps.

Create Rough Key Teeth

  1. Select Sketcher NewSketch.png New sketch
  2. Select the third option for the Sketch to be created in the YZ plane
  3. In the Offset field, enter -3.
  4. Click OK
  5. Select Sketcher Rectangle.svg Rectangle
  6. Create the rectangle somewhere near the origin with arbitrary lengths.
  7. Click on either side edge of the rectangle.
  8. Click on Constraint VerticalDistance.svg Vertical Distance Constraint
  9. A small query box asking for the Length will appear, enter the number 25 into it and click OK
  10. Click on either the top or bottom edge of the rectangle
  11. Click on Constraint HorizontalDistance.svg Horizontal Distance Constraint
  12. A small query box asking for the Length will appear, enter the number 20 into it and click OK
  13. Click on the lower lefthand corner of the rectangle, then click on the origin.
  14. Click on Constraint VerticalDistance.svg Vertical Distance Constraint.
  15. A small query box asking for the Length will appear, enter the number 5 into it and click OK.
  16. Click on the lower lefthand corner of the rectangle, then click on the origin.
  17. Click on Constraint HorizontalDistance.svg Horizontal Distance Constraint
  18. A small query box asking for the Length will appear, enter the number 10 into it and click OK
  19. Click on the Close button at the top of the Tasks Tab of the Combo View
  20. In the Combo View click on the Cube and press Return.
  21. Now enter the text key teeth rough sketch and press Return.
  22. Single-click the 'key teeth rough sketch' in the Combo View to select it
  23. Single-click on PartDesign Pad.svg Pad
  24. A dialogue box will appear in the Tasks tab of the Combo View, it will have a field to enter with the label Length. Enter 6 into this and click OK. Our Sketch will receive a 3rd dimension along the orthogonal axis (which in Z for our Sketch which lies in the XY plane).
  25. We have now generated a 3-dimensional model which is 6mm high.
  26. You will notice that our Sketch has disappeared. Also a new object is appearing in the Combo View, one called Pad.
  27. To the immediate left of Pad is a small triangle point rightwards, click once on that.
  28. Now you will see both the Sketch which we created and the Pad which we created from the Sketch. Both objects are there, for ease of management the one is concealed within the other, but is always there.
  29. In the Combo View click on the Pad and press Return.
  30. Now enter the text key teeth rough and press Return.
  31. Save your work: select the menu option File->Save, or click the Document-save.svg Save icon; or press Command-S.

Create Cutouts for Key Teeth

  1. Single-click the 'key teeth rough' in the Combo View to select it
  2. Select Sketcher NewSketch.png New sketch
  3. Select Sketcher Rectangle.svg Rectangle
  4. Create the rectangle somewhere near the origin with arbitrary lengths.
  5. Click on either side edge of the rectangle.
  6. Click on Constraint VerticalDistance.svg Vertical Distance Constraint
  7. A small query box asking for the Length will appear, enter the number 8 into it and click OK
  8. Click on either the top or bottom edge of the rectangle
  9. Click on Constraint HorizontalDistance.svg Horizontal Distance Constraint
  10. A small query box asking for the Length will appear, enter the number 10 into it and click OK
  11. Click on the lower lefthand corner of the rectangle, then click on the origin.
  12. Click on Constraint VerticalDistance.svg Vertical Distance Constraint.
  13. A small query box asking for the Length will appear, enter the number 5 into it and click OK.
  14. Click on the lower lefthand corner of the rectangle, then click on the origin.
  15. Click on Constraint HorizontalDistance.svg Horizontal Distance Constraint
  16. A small query box asking for the Length will appear, enter the number 17 into it and click OK
  1. Select Sketcher Rectangle.svg Rectangle
  2. Create the rectangle somewhere near the origin with arbitrary lengths.
  3. Click on either side edge of the rectangle.
  4. Click on Constraint VerticalDistance.svg Vertical Distance Constraint
  5. A small query box asking for the Length will appear, enter the number 8 into it and click OK
  6. Click on either the top or bottom edge of the rectangle
  7. Click on Constraint HorizontalDistance.svg Horizontal Distance Constraint
  8. A small query box asking for the Length will appear, enter the number 10 into it and click OK
  9. Click on the lower lefthand corner of the rectangle, then click on the origin.
  10. Click on Constraint VerticalDistance.svg Vertical Distance Constraint.
  11. A small query box asking for the Length will appear, enter the number 22 into it and click OK.
  12. Click on the lower lefthand corner of the rectangle, then click on the origin.
  13. Click on Constraint HorizontalDistance.svg Horizontal Distance Constraint
  14. A small query box asking for the Length will appear, enter the number 17 into it and click OK
  15. Click on the Close button at the top of the Tasks Tab of the Combo View.
  16. In the Combo View click on the Sketch and press Return.
  17. Now enter the text key teeth cutouts sketch and press Return.

Pocket to Create Finished Key Teeth

  1. Click on PartDesign Pocket.png Pocket
  2. In the Type field, select 'Through All'.
  3. Click OK
  4. In the Combo View click on the Pocket and press Return.
  5. Now enter the text key teeth cutouts and press Return.
  6. 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

  1. Select Sketcher NewSketch.png New sketch
  2. Select the third option for the Sketch to be created in the YZ plane
  3. In the Offset field, enter -5.
  4. Click OK
  5. Select Sketcher Circle.svg Circle
  6. Your first click will place the centre of the circle, your second click will set the radius of the circle. Place the centre somewhere near the Y axis.
  7. Click on the circle to select it.
  8. Click on Constraint Radius.svg Radius Constraint
  9. A small query box asking for the Radius will appear, enter the number 9 into it and click OK
  10. Click on the centre of the circle then on the X axis.
  11. Click on Constraint VerticalDistance.svg Vertical Distance Constraint
  12. A small query box asking for the Length will appear, enter the number 103 into it and click OK
  13. Click on the centre of the circle then on the Y axis.
  14. Click on Constraint HorizontalDistance.svg Horizontal Distance Constraint
  15. A small query box asking for the Length will appear, enter the number 1 into it and click OK
  16. Select Sketcher Circle.svg Circle
  17. Your first click will place the centre of the circle, your second click will set the radius of the circle. Place the centre somewhere near the Y axis.
  18. Click on the circle to select it.
  19. Click on Constraint Radius.svg Radius Constraint
  20. A small query box asking for the Radius will appear, enter the number 6 into it and click OK
  21. Click on the centre of the first circle to select it.
  22. Click on the centre of the second circle to select it.
  23. Click on Constraint PointOnPoint.svg Coincident Point Constraint
  24. Select Sketcher Circle.svg Circle
  25. Your first click will place the centre of the circle, your second click will set the radius of the circle. Place the centre somewhere near the Y axis.
  26. Click on the circle to select it.
  27. Click on Constraint Radius.svg Radius Constraint
  28. A small query box asking for the Radius will appear, enter the number 9 into it and click OK
  29. Click on the centre of the circle then on the X axis.
  30. Click on Constraint VerticalDistance.svg Vertical Distance Constraint
  31. A small query box asking for the Length will appear, enter the number 103 into it and click OK
  32. Click on the centre of the circle then on the Y axis.
  33. Click on Constraint HorizontalDistance.svg Horizontal Distance Constraint
  34. A small query box asking for the Length will appear, enter the number 19 into it and click OK
  35. Select Sketcher Circle.svg Circle
  36. Your first click will place the centre of the circle, your second click will set the radius of the circle. Place the centre somewhere near the Y axis.
  37. Click on the circle to select it.
  38. Click on Constraint Radius.svg Radius Constraint
  39. A small query box asking for the Radius will appear, enter the number 6 into it and click OK
  40. Click on the centre of the third circle to select it.
  41. Click on the centre of the fourth circle to select it.
  42. Click on Constraint PointOnPoint.svg Coincident Point Constraint
  43. Click on the Close button at the top of the Tasks Tab of the Combo View
  44. In the Combo View click on the Sketch and press Return.
  45. Now enter the text key handle sketch and press Return.
  46. Single-click on PartDesign Pad.svg Pad
  47. A dialogue box will appear in the Tasks tab of the Combo View, it will have a field to enter with the label Length. Enter 10 into this and click OK.
  48. In the Combo View click on the Pad and press Return.
  49. Now enter the text key handle and press Return.

Results

Further Ideas

  • Animate the key (see tutorial YYY)

Summary

We used the following tools in this tutorial:

Further Information

To Do On Tutorial