• Home
  • Blog
  • Mastering FreeCAD Sketcher Constraints: The Key to Parametric 3D Modeling

Mastering FreeCAD Sketcher Constraints: The Key to Parametric 3D Modeling

Mastering FreeCAD Sketcher Constraints: The Key to Parametric 3D Modeling

How geometric and dimensional constraints turn a rough sketch into a rock-solid, fully parametric 2D profile — the foundation of every good FreeCAD model.

If there's one skill that separates a frustrating FreeCAD experience from a smooth one, it's understanding the Sketcher. Almost every 3D feature in FreeCAD — a pad, a pocket, a revolve — starts life as a 2D sketch. And the thing that makes a sketch reliable, editable, and "parametric" instead of a fragile pile of lines is its constraint system.

In this post, we'll break down exactly what constraints are, the difference between geometric and dimensional constraints, how degrees of freedom work, and how to avoid the classic beginner mistake of an under- or over-constrained sketch.

What Is a Constraint, Really?

A constraint is a rule you apply to your sketch geometry that removes ambiguity about its size, shape, or position. Without constraints, a line you draw is just floating in space — nothing stops it from moving, stretching, or rotating when you edit something else.

Constraints lock that geometry down. Once a sketch is fully constrained, every point, line, and curve has an exact, predictable position, and the sketch turns solid green in FreeCAD's Sketcher — a visual confirmation that there's no ambiguity left.

Why this matters: A fully constrained sketch means that when you go back later and change one dimension, the entire model updates predictably instead of breaking or distorting in unexpected ways.

Degrees of Freedom (DoF): The Core Concept

Every piece of geometry you draw has a number of "degrees of freedom" — ways it's still free to move or change. A constraint's job is to remove degrees of freedom, one or more at a time, until none are left.

2 DoF for a single point (X, Y position)
4 DoF for a line (2 endpoints)
0 DoF when fully constrained

FreeCAD shows your remaining degrees of freedom in the task panel and status bar as you sketch, so you always know how much work is left. A sketch can be in one of three states:

State Color Meaning
Under-constrained White / normal Some geometry can still move freely — DoF remaining
Fully constrained Green Zero DoF — geometry is completely locked
Over-constrained / conflicting Red / orange Contradictory or redundant constraints applied

Geometric Constraints

Geometric constraints define relationships between elements — not exact sizes, but how things relate to each other spatially. These are usually applied first, to establish the overall shape.

Constraint What It Does
Coincident Snaps two points to the exact same location
Horizontal / Vertical Forces a line to align to the X or Y axis
Parallel Keeps two lines running in the same direction
Perpendicular Forces two lines to meet at 90°
Tangent Makes a line or curve touch a circle/arc smoothly
Equal Forces two elements to share the same length or radius
Symmetric Mirrors two points/lines about an axis or point
Point on Object Locks a point so it must lie on a line or curve

Dimensional Constraints

Dimensional constraints, on the other hand, define exact measurable values — lengths, angles, radii, and distances. These are what let you type in "25mm" and have your geometry snap to that precise size.

Constraint What It Does
Distance Sets the length between two points, or a line's length
Horizontal Distance Sets distance measured only along the X axis
Vertical Distance Sets distance measured only along the Y axis
Radius / Diameter Sets the exact size of a circle or arc
Angle Sets the angle between two lines
Best practice: Apply geometric constraints first to "rough in" the correct shape and relationships, then layer dimensional constraints on top to lock in exact sizes. This mirrors how experienced CAD users think — shape first, numbers second.

A Simple Workflow: Constraining a Rectangle

  1. Draw four connected lines roughly forming a rectangle.
  2. Apply Horizontal to the top and bottom lines.
  3. Apply Vertical to the two side lines.
  4. Apply Coincident at each corner (if not already snapped).
  5. Add a Distance constraint for width, and another for height.
  6. Optionally, anchor one corner to the origin with a Coincident constraint so the whole sketch is positioned predictably.

Once you've done this, the rectangle turns fully green — zero degrees of freedom remain, and it's ready to be padded into a 3D solid with total confidence that it won't shift later.

Common Beginner Mistakes

Over-constraining: Applying redundant constraints (like adding both a Horizontal constraint and a vertical Distance that already implies horizontality) causes FreeCAD to flag conflicts in red. When this happens, delete the redundant constraint rather than forcing more onto the sketch.
Leaving a sketch under-constrained: It's tempting to stop once the shape "looks right," but any remaining DoF means edits elsewhere in your model can unexpectedly distort this sketch. Aim for fully constrained (green) whenever possible.
Not using the origin: Beginners often forget to anchor their sketch to the origin point/axes. This makes the whole sketch free to drift, since nothing ties it to a fixed reference.

Handy Tips for Working Faster

  • Use FreeCAD's auto-constraint feature while sketching — it applies obvious constraints (like coincident or horizontal) automatically as you draw.
  • Keep an eye on the DoF counter in the Elements panel; it tells you exactly how many constraints you still need.
  • Use the keyboard shortcuts (e.g. H for horizontal, V for vertical, C for coincident) to speed up constraint application dramatically.
  • Right-click a constraint in the Elements list to quickly delete or rename it if your sketch is getting cluttered.
  • Name important constraints (like key dimensions) so they're easy to find and edit later, especially in complex parametric models.

Wrapping Up

Mastering the Sketcher's constraint system is one of the highest-leverage skills you can build in FreeCAD. It's the difference between models that update gracefully when you tweak a dimension, and models that fall apart with every small change. Start every sketch with a clear plan: rough in geometry, apply geometric constraints to define relationships, then lock in dimensions — and always aim for that satisfying fully-constrained green.

Ready to Go From Confused to Confident in FreeCAD?

If sketches, constraints, and parametric modeling still feel overwhelming, our complete beginner course walks you through everything step by step — no prior CAD experience needed.

Enroll in the Complete FreeCAD for Beginners Course →