Basic Sketcher Tutorial

From FreeCAD Documentation
Revision as of 22:53, 22 February 2020 by Vocx (talk | contribs) (New image, some rewording)
Tutorial
Topic
Sketcher
Level
Beginner
Time to complete
30 minutes
Authors
Drei
FreeCAD version
0.16 or above
Example files
See also
None

Introduction

This tutorial is meant to introduce the reader to the basic workflow of the Sketcher Workbench.

The Sketcher Workbench exists as a standalone module, so it can be used to draw generic 2D (planar) objects. However, it is mostly used in conjunction with the PartDesign Workbench. A closed sketch is normally used to create a face or a profile which will be subsequently extruded into a solid body with an operation such as PartDesign Pad.

The reader will practice:

  • Creating construction geometry
  • Creating real geometry
  • Applying geometric constraints
  • Applying datum constraints
  • Obtaining a closed profile

Final result of the sketch, with all geometry fully constrained, including construction geometry for support.

Setup

1. Open FreeCAD, create a new empty document with File → New.

1.1. Switch to the Sketcher Workbench from the workbench selector, or the menu View → Workbench → Sketcher.

Some actions to remember:

  • Press the right mouse button, or press Esc in the keyboard once, to deselect the active tool in edit mode.
  • To exit the sketch edit mode, press the Close button in the task panel, or press Esc twice in the keyboard.
  • To enter again edit mode, double click on the sketch in the tree view, or select it, and then click on Edit sketch.

Create a sketch

2. Click on New sketch.

2.1. Choose the sketch orientation, that is, one of the base XY, XZ, or YZ planes. Also choose if you want an inverted orientation, and an offset from the base plane.
2.2. We will use the default plane and options.
2.3. Click OK to start constructing the sketch.

We are now inside the sketch edit mode. Within it, we're able to make use of the majority of the tools of this workbench.

Note: the tree view will switch to the task panel; in this interface expand the Edit controls section, and make sure the Auto constraints option is enabled. Other options can be changed including the size of the visible grid, and whether we want to snap to it; in this tutorial we will not snap to the grid and we will also hide it. In other sections of the task panel you can also see which geometrical elements and constraints have been defined.

File:01.png

Construction geometry

3. Construction geometry is used to guide the creation of "real" geometry. Real geometry will be the one shown outside of the sketch edit mode, while construction geometry will only be shown inside the edit mode. Therefore, you can use as much construction geometry as you need to build real shapes.

3.1. Click on Toggle construction. Now geometrical elements will be drawn in Construction mode.
3.2. Click on Create line.
3.3. Approach the origin of the sketch, the point should highlight and near your cursor the coincident constraint icon will appear.
3.4. Click on the point and extend the line diagonally up to an arbitrary length to around 30 mm. You don't have to be too precise in this step; later we will set the correct distances.
3.5. Repeat this procedure four more times to place construction lines in a star pattern. Don't worry too much about their size or position, just extend them in the four quadrants.
3.6. To exit construction mode, simply click again on Toggle construction.

Note: up to this point the line tool is still active. This means we can keep clicking on the 3D view to draw as many lines as we want. If we wish to exit this tool, we can press the right mouse button, or press Esc in the keyboard once. By doing this the pointer won't create lines any more, it will just be a pointer. In this pointer mode we can pick and drag the endpoints of each line to adjust its placement.

Note 2: do not press Esc a second time as this will exit the sketch edit mode. If you do this, re-enter the edit mode by double clicking on the sketch in the tree view.

Take a look at the task panel again. Look at the Constraints and Elements sections to see the new listed constraints and lines. Once your sketches have many elements, it may be difficult to select them in the 3D view, so you can use these lists to select the object that you wish exactly.

File:T05 Sketcher basic tutorial 02.png

Real geometry

Real geometry must make a closed shape if it is to be used as a profile that can be extruded by tools such as PartDesign Pad.

4. Create a circle.

4.1. Click on Create circle.
4.2. Click on the origin of the sketch to position its center point.
4.3. Click anywhere in the 3D view to set the circumference radius as a distance from the origin. Make it approximately of 10 mm.

5. Create a series of arcs.

5.1. Click on Create arc.
5.2. Approach the endpoint of one of the construction lines, and click on it. This will set the center point of the circular arc to be coincident with this endpoint.
5.3. Click once in the 3D view at an arbitrary location to set simultaneously the radius of the arc, and the first endpoint of it. Define an approximate radius of 8 mm.
5.4. Move the pointer in an anti-clockwise direction to trace an arc that has its concavity pointing towards the origin of the sketch. Click to set the final endpoint of the arc, defining a circular arc that approximately sweeps 180° or half a circle.
5.5. Repeat these steps with each construction line, so that each of them has a circular arc at its tip. We will call these A-arcs.

File:03.png

6. Create an arc between each pair of the previous A-arcs.

6.1. Still with the Create arc tool active, click somewhere between two A-arcs to set the center point of a new arc.
6.2. Click somewhere close to the endpoint of one A-arc, and move the pointer to sweep another arc finishing close to another endpoint of a different A-arc; the approximate radius should be of 11 mm. This time the concavity must point away from the origin.
6.3. Repeat these steps, so that each pair of A-arcs has a new arc between them. We will call these B-arcs.
6.4. The A-arcs should have their concavity pointing towards the origin of the sketch, while the B-arcs should have their concavity pointing away from the same origin.

File:04.png

Geometric constraints

Constraints are used to fix the degrees of freedom (DOF) of shapes within the sketch. These shapes are controlled by the position of the points, lines, and curves that form the geometry. There are two principal types of constraints:

  • geometric constraints define characteristics of the shapes without specifying exact dimensions, for example, horizontality, verticality, parallelism or perpendicularity.
  • datum constraints define characteristics of the shapes by specifying dimensions, for example, a numeric length or an angle.

7. Geometrically constrain the arcs.

7.1 Select all five construction lines. You only need to click on one line once to select it.
7.2. Press Equal length.
7.3. Select all five A-arcs, those centered on an endpoint of a construction line.
7.4. Press Equal length.
7.5. Repeat with all B-arcs, those between the A-arcs.

8. Geometrically constrain the construction lines.

8.1. Select the construction line that is closest to the vertical axis.
8.2. Press Vertical.

9. Apply tangency to the arcs.

9.1. Select one endpoint of an A-arc and then the closest endpoint of the adjacent B-arc.
9.2. Press Tangent.
9.3. Repeat for all endpoints of the A-arcs and B-arcs to obtain a closed profile.

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

While the dimensions remain unfixed, you can select a point and drag it with the pointer to observe how the entire sketch changes.

Datum constraints

These constraints specify the distance between two points, and thus the length of the lines and curves.

10. Adjust the size of the construction lines.

10.1. Select the vertically constrained construction line.
10.2. Press Vertical distance.
10.3. Set the length to 30 mm.

11. Adjust the angle between the construction lines.

11.1. Select the vertical construction line and the line closest to it.
11.2. Press Angle.
11.3. Set the angle to 72°.
11.4. Repeat the same procedure for each pair of construction lines.

12. Adjust the size o the arcs.

12.1. Select one of the arcs centered on the endpoint of a line.
12.2. Press Radius.
12.3. Set the radius to 8 mm.
12.4. Do the same for an arc not centered on an endpoint. Set the radius to 11 mm.
12.5. Set the center circle radius to 10 mm.

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

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

Further Reading


Template:Tutorials navi