Sandbox:Piffpoof9

Introduction
This tutorial is meant to introduce the reader to the basic workflow of the Sketcher Workbench used in conjunction with the Part Design workbench to make a model with 3 different pieces. This will be done using Sketches and the Pad function of the Part Design workbench,

The Sketcher workbench exists as a standalone module, but it is also accessible from within the PartDesign Workbench when it is required to create a profile.



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 want to make sure some of them are visible:

- combo viewer

- Data tab

Creating a Sketch

 * 1) Switch to the Part Design Workbench
 * 2) Create a new document
 * 3) Select [[Image:Sketcher_NewSketch.png‎‎|32px]] 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

Creating Geometry With Constrants
The Sketcher is a two dimensional editor. When creating Sketches in the Sketcher, it is beneficial to either centre the drawing over the XY origin or to place one corner or edge of the drawing along either the origin or one axis.

As this is an intoductory tutorial, we will not use External Geometry which is covered in other tutorials (XXX XXX XXX). Rather, we will define the position and dimensions of our Sketch in reference to the origin.
 * 1) Select [[Image:Sketcher_Rectangle.svg|32px]] Rectangle
 * 2) Create the rectangle somewhere near the origin with arbitrary lengths.
 * 3) 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.
 * 4) Click on [[Image:Constraint Symmetric.svg|32px]] Symetric Constraint
 * 5) The two sides of the rectangle are now equi-distant from the Y-axis.
 * 6) Repeat the previous steps with the upper-left corner, the lower-left corner, and the X axis and click on [[Image:Constraint Symmetric.svg|32px]] Symetric Constraint
 * 7) The box is now symmetrically constrained around the XY origin. It can be made wider, narrower, taller, shorter but any changes will be mirrored on the other side of the axis.
 * 8) It's now a good time to exit the Sketcher and have the previous steps closed. Click on the Close button at the top of the Tasks Tab of the Combo View

Constraints
Constraints are used to constrain the Degrees of Freedom of points and curves within sketcher.

Geometric Constraints
They are used to establish relations between points and curves without the use of dimensions.


 * 1) Select all five construction lines.
 * 2) Select [[Image:Constraint_EqualLength.png|32px]] Equal Length


 * 1) Select all five arcs centered on an endpoint of a line.
 * 2) Select [[Image:Constraint_EqualLength.png|32px]] Equal Length
 * 3) Repeat for all five arcs that are not centered on an endpoint.


 * 1) Select the construction line that is closest to the vertical axis.
 * 2) Select  [[Image:Constraint_Vertical.png|32px]] Vertical


 * 1) Select the endpoint of an arc and the endpoint closest to it.
 * 2) Select [[Image:Constraint_Tangent.png|32px]] Tangent
 * 3) Repeat for each endpoint, until a closed profile is created.

As of this step, we have now created a closed profile that can be adjusted with the desired dimensions.

Datum Constraints
These are used to specify the distance between points in a particular direction and the dimensions of curves.


 * 1) Select the vertically constrained construction line.
 * 2) Select  [[Image:Constraint_VerticalDistance.png|32px]] Vertical Distance
 * 3) Set the length to 30 mm.


 * 1) Select the vertical construction line and the line closest to it
 * 2) Select  [[Image:Constraint_InternalAngle.png|32px]] Internal Angle
 * 3) Set the angle to 72°
 * 4) Repeat the same procedure for each pair of adjacent lines.


 * 1) Select one of the arcs centered on the endpoint of a line.
 * 2) Select [[Image:Constraint_Radius.png|32px]] Radius
 * 3) Set the radius to 8 mm.
 * 4) Do the same for an arc not centered on an endpoint. Set the radius to 11 mm.
 * 5) Set the center circle radius to 10 mm.

You should end up with a fully constrained sketch. It can be comfirmed by noticing the change in color of all curves.

We are now finished with the basic workflow for the Sketcher Module.