Almost every part in FreeCAD starts as a 2D sketch. A good sketch is the difference between a model you can easily change and one that breaks. This guide explains how constraints work and how to find and fix problems.
Geometry and constraints
A sketch contains geometry (lines, arcs, circles, B-splines, points) and constraints that fix their size and position. There are two kinds of constraints:
- Geometric constraints describe relationships: coincident, horizontal, vertical, parallel, perpendicular, tangent, equal, symmetric, point on object.
- Dimensional constraints give values: distance, horizontal and vertical distance, radius, diameter, angle.
Degrees of freedom
Every piece of geometry can move in certain ways. A point can move in two directions, so it has two degrees of freedom (DoF). Each constraint removes one or more of them. The Sketcher's solver messages show how many degrees of freedom are left.
- Under-constrained: some elements can still move. With the default colours they are shown in white. Dragging an element shows you which way it is free to move.
- Fully constrained: zero degrees of freedom. The sketch turns green. This is what you should aim for.
- Over-constrained or conflicting: the solver reports redundant or conflicting constraints and highlights them. Delete one of the listed constraints to fix it.
Working with unconstrained elements
While you draw, FreeCAD adds some constraints automatically (for example coincident when you click on an existing point, or horizontal for nearly horizontal lines). Sometimes you want geometry without these automatic constraints, for example to place it freely and constrain it later. You can switch off automatic constraints in the Sketcher settings or edit controls. Unconstrained elements are not an error, but a part built from them can change shape unexpectedly when you edit another value, so constrain them before you build features on the sketch.
Construction geometry
Construction geometry is helper geometry (shown in blue by default) that is used for constraints but is not part of the final profile. Typical uses: centre lines, a circle to place holes on a bolt circle, or a diagonal to centre a rectangle. Toggle construction mode before drawing, or convert existing geometry with the construction toggle.
Tips for robust sketches
- Attach the sketch to the origin with at least one constraint, so it cannot drift.
- Keep sketches simple: several simple sketches and features are easier to edit than one huge sketch.
- Use names for important constraints and reuse them in expressions, so one value can drive several dimensions.
- Closed profiles are required for Pad and Pocket. If a feature fails, check for small gaps or overlapping lines.
Practise these ideas in the first part tutorial.