Sandbox:Piffpoof9-2a

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.



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: All of this will be done using the Part workbench.
 * the key shaft
 * the teeth of the key
 * the handle of the key

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. 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:, , , , , , , , 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 [[Image:Workbench_PartDesign.svg‎‎|24px]] Part Design workbench.
 * 2) Click on [[Image:Document-new.svg‎‎|24px]] to create a new document.
 * 3) Select [[Image:Sketcher_NewSketch.png‎‎|24px]] 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 [[Image:Sketcher_Circle.svg|24px]] 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 [[Image:Constraint PointOnObject.svg|24px]] 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 [[Image:Constraint VerticalDistance.svg|24px]] 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 [[Image:Constraint Radius.svg|24px]] 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.
 * 19) Now enter the text  and press.
 * 20) Single-click the 'key shaft sketch' in the Combo View to select it
 * 21) Single-click on  [[Image:PartDesign_Pad.svg‎‎|24px]] 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.
 * 28) Now enter the text  and press.
 * 29) Save your work: select the menu option, or click the [[Image:Document-save.svg‎‎|24px]] Save icon; or press -.

Create Rough Key Teeth
new sketch YZ offset=-3 click on either side edge and enter 25 click on the top or bottom edge and enter 20 click on LLH and vert=5 click on LLH and hor=10 hit Close change name to 'key teeth rough sketch' click to select click Pad L=6 change name to 'key teeth rough' command-Save

Create Cutouts for Key Teeth
Click on 'key teeth rough' to select it new Sketch new Rectangle vert=8 hor=10 click on LLH and vert = 5 click on LLH and hori = 17 new Rectangle vert=8 hor=10 click on LLH and vert = 22 click on LLH and hori = 17 hit Close change name to 'key teeth cutouts sketch'

Pocket to Create Finished Key Teeth
click Pocket Type = Through All hit OK change name to 'key teeth cutouts'

Creating the Key Handle
new sketch YZ offset=-5 new Circle r=9 vert=103 hor=1 new Circle r=6 make centres coincident new Circle r=9 vert=103 hor=19 new Circle r=6 make centres coincident hit Close change name to 'key handle sketch' click Pad hit OK change name to 'key handle'

Further Ideas

 * Animate the key (see tutorial YYY)

Summary
We used the following tools in this tutorial:

Further Information

 * To learn more about the Sketcher and Part Design Workbenches, see Sketcher Workbench, Part Design Workbench