Sandbox:Piffpoof9-1c

Introduction
This tutorial is meant to introduce the reader to the basic workflows of the Part Workbench,  Part Design Workbench, and Sketcher Workbench. The Pocket tool is used to make a model comprised of 2 different pieces.



Problem Background
We're going to construct a model of a housing for a lock - like the lock on a door. After looking at the task, we have decided we will make this in 3 pieces: And because this is a Sketcher tutorial, we will use the Sketcher workbench, but we will use it from the Part Design workbench
 * a plate at the back of the lock housing
 * the sides of the lock housing
 * the front plate of the lock housing which will have the aperture through which the key passes

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 Lock Housing

 * 1) Switch to the [[Image:Workbench_Part.svg‎‎|24px]] Part workbench.
 * 2) Click on [[Image:Document-new.svg‎‎|24px]] to create a new document.
 * 3) Click on [[Image:Part_Box.svg|24 px]] Cube, a new cube will be created at the origin.
 * 4) In the Combo View click on the Cube and press.
 * 5) Now enter the text  and press.
 * 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 x field, either enter   or use the small arrows to the right to decrement the existing value (which will be 0).
 * 9) In the y field either enter   or use the small arrows to the right to decrement the existing value (which will be 0).
 * 10) In the z field either enter  or use the small arrows to the right to increment the existing value (which will be 0).
 * 11) In the Length field, enter.
 * 12) In the Width field, enter.
 * 13) In the Height field, enter.

Pocket Lock Housing and Key Shaft Aperature
We will now create a Sketch and use it to Pocket the Lock Housing.
 * 1) Switch to the [[Image:Workbench_PartDesign.svg‎‎|24px]] Part Design workbench.
 * 2) Click on the top face of the solid to select it.
 * 3) Select [[Image:Sketcher_NewSketch.svg‎‎|24px]] New sketch Note: If a face is selected then the Sketcher will create the new sketch on that face.
 * 4) Select [[Image:Sketcher_Rectangle.svg|24px]] Rectangle
 * 5) Create the rectangle somewhere near the origin with arbitrary lengths.
 * 6) Click on the lower-left corner of the rectangle, then on the lower-right corner, then finally on the Y axis. Both points and the Y axis should now be selected.
 * 7) Click on [[Image:Constraint Symmetric.svg|24px]] Symmetric Constraint
 * 8) The two sides of the rectangle are now equi-distant from the Y-axis.
 * 9) Click on the upper-left corner, then on the lower-left corner
 * 10) Click on [[Image:Constraint VerticalDistance.svg|24px]] Vertical Distance Constraint
 * 11) A small query box asking for the Length will appear, enter the number 76 into it and click OK
 * 12) Click on the lower-left corner, then on the lower-right corner
 * 13) Click on [[Image:Constraint HorizontalDistance.svg|24px]] Horizontal Distance Constraint
 * 14) A small query box asking for the Length will appear, enter the number 56 into it and click OK
 * 15) Click on the Close button at the top of the Tasks Tab of the Combo View
 * 16) Click on [[Image:PartDesign_Pocket.png|24px]] Pocket
 * 17) In the Length field, enter 30.
 * 18) Click   Now we will pocket the aperture for the key shaft in the bottom of the lock housing.
 * 19) Click on the top face of the bottom of the box to select it.
 * 20) Select [[Image:Sketcher_NewSketch.svg‎‎|24px]] New sketch
 * 21) Select [[Image:Sketcher_Circle.svg|24px]] Circle
 * 22) 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.
 * 23) Click on the centre of the circle, then click on the Y-axis.
 * 24) Click on [[Image:Constraint PointOnObject.svg|24px]] Point on Object Constraint. The circle centre is now constrained to remain on the Y-axis.
 * 25) Click on the centre of the circle then on the X axis.
 * 26) Click on [[Image:Constraint VerticalDistance.svg|24px]] Vertical Distance Constraint
 * 27) A small query box asking for the Length will appear, enter the number 10 into it and click OK
 * 28) Click on the circle
 * 29) Click on [[Image:Constraint Radius.svg|24px]] Radius Constraint
 * 30) A small query box asking for the Radius will appear, enter the number 5 into it and click OK
 * 31) Click on the Close button at the top of the Tasks Tab of the Combo View
 * 32) Click on [[Image:PartDesign_Pocket.png|24px]] Pocket
 * 33) In the Length field, enter 2.
 * 34) Click
 * 35) Save your work: select the menu option, or click the [[Image:Document-save.svg‎‎|24px]] Save icon; or press -.

Creating the Lock Housing Lid

 * 1) Click on [[Image:Part_Box.svg|24 px]] Cube, a new cube will be created at the origin.
 * 2) In the Combo View click on the Cube and press.
 * 3) Now enter the text  and press.
 * 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   or use the small arrows to the right to decrement the existing value (which will be 0).
 * 7) In the y field either enter   or use the small arrows to the right to decrement the existing value (which will be 0).
 * 8) In the z field either enter  or use the small arrows to the right to increment the existing value (which will be 0).
 * 9) In the Length field, enter.
 * 10) In the Width field, enter.
 * 11) In the Height field, enter.
 * 12) Save your work: select the menu option, or click the [[Image:Document-save.svg‎‎|24px]] Save icon; or press -.

Pocket Lock Housing Lid
We will now create a Sketch and use it to Pocket the Lock Housing.
 * 1) Switch to the [[Image:Workbench_PartDesign.svg‎‎|24px]] Part Design workbench.
 * 2) Click on the top face of the lid to select it.
 * 3) Select [[Image:Sketcher_NewSketch.svg‎‎|24px]] New sketch Note: If a face is selected then the Sketcher will create the new sketch on that face.
 * 4) Select [[Image:Sketcher_Circle.svg|24px]] Circle
 * 5) 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.
 * 6) Click on the centre of the circle, then click on the Y-axis.
 * 7) Click on [[Image:Constraint PointOnObject.svg|24px]] Point on Object Constraint. The circle centre is now constrained to remain on the Y-axis.
 * 8) Click on the centre of the circle then on the X axis.
 * 9) Click on [[Image:Constraint VerticalDistance.svg|24px]] Vertical 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 circle
 * 12) Click on [[Image:Constraint Radius.svg|24px]] Radius Constraint
 * 13) A small query box asking for the Radius will appear, enter the number 5 into it and click OK
 * 14) Click on the Close button at the top of the Tasks Tab of the Combo View
 * 15) Click on [[Image:PartDesign_Pocket.png|24px]] Pocket
 * 16) In the Length field, enter 2.
 * 17) Click
 * 18) Click on the top face of the lid to select it.
 * 19) Select [[Image:Sketcher_NewSketch.svg‎‎|24px]] New sketch
 * 20) Select [[Image:Sketcher_Rectangle.svg|24px]] Rectangle
 * 21) Create the rectangle somewhere near the origin with arbitrary lengths.
 * 22) Click on the lower-left corner of the rectangle, then on the lower-right corner, then finally on the Y axis. Both points and the Y axis should now be selected.
 * 23) Click on [[Image:Constraint Symmetric.svg|24px]] Symmetric Constraint
 * 24) The two sides of the rectangle are now equi-distant from the Y-axis.
 * 25) Click on the upper-left corner, then on the lower-left corner
 * 26) Click on [[Image:Constraint VerticalDistance.svg|24px]] Vertical Distance Constraint
 * 27) A small query box asking for the Length will appear, enter the number 76 into it and click OK
 * 28) Click on the lower-left corner, then on the lower-right corner
 * 29) Click on [[Image:Constraint HorizontalDistance.svg|24px]] Horizontal Distance Constraint
 * 30) A small query box asking for the Length will appear, enter the number 56 into it and click OK
 * 31) Click on the Close button at the top of the Tasks Tab of the Combo View
 * 32) Click on [[Image:PartDesign_Pocket.png|24px]] Pocket
 * 33) In the Length field, enter 2.
 * 34) Click
 * 35) Save your work: select the menu option, or click the [[Image:Document-save.svg‎‎|24px]] Save icon; or press -.

Further Ideas

 * Create a key to fit this lock (see tutorial XXX)
 * Model some working of real lock inside our lock housing - now that would be complex!

Summary
We used the following tools in this tutorial:
 * Sketcher
 * Constraints within the Sketcher
 * Pad from the Part Design workbench

Further Information

 * To learn more about the Sketcher, see Sketcher Workbench

To Do On Tutorial

 * constrain the rectangle on the 3rd Sketch
 * 0.16 specific changes
 * View->Views->Combo View becomes View->Panels->Combo View