Causes of Over-Constrained FreeCAD Sketches
An over-constrained sketch in FreeCAD occurs when the sketch solver receives more geometric or dimensional rules than necessary to define the geometry, resulting in mathematical conflicts or redundancy. This article explains the primary causes of over-constrained sketches, including conflicting dimensions, redundant geometric rules, aggressive auto-constraints, and how FreeCAD's solver reacts to these inputs.
The Role of Degrees of Freedom
Every point, line, and arc in FreeCAD begins with a specific number of degrees of freedom (DoF), representing the ways the element can move, rotate, or resize. The Sketcher solver works by eliminating these DoFs until the sketch is fully constrained (indicated by the geometry turning green).
When a sketch reaches zero degrees of freedom, its shape and position are completely locked. If you add any further constraint to an already fixed element, the solver has more equations than variables. FreeCAD flags this state by turning the problematic elements orange or red, indicating an over-constrained status.
Primary Causes of Over-Constrained Sketches
1. Redundant Dimensional Constraints
The most common mistake is applying a dimension to a feature that is already mathematically determined by other dimensions. For example:
- Dimensioning all three sides of a right triangle, plus the hypotenuse.
- Defining the overall length of a stepped part while also defining the length of each individual sub-segment.
- Providing both an angle constraint and coordinate constraints that already dictate that exact angle.
2. Auto-Constraint Conflicts
FreeCAD includes an auto-constraint feature enabled by default in the Sketcher workbench. As you draw, the cursor automatically infers and adds constraints such as:
- Point-on-object or coincidence
- Horizontal or vertical alignment
- Perpendicularity or tangency
If FreeCAD automatically applies a vertical constraint to a slightly slanted line you intended to dimension at an angle later, adding the angle constraint will cause an over-constraint conflict.
3. Conflicting Geometric Rules
A conflict occurs when two geometric constraints cannot physically coexist. Common examples include:
- Applying both a Parallel and a Perpendicular constraint to the same pair of lines.
- Applying a Horizontal constraint to a line that is also constrained Tangent to a vertical line.
- Adding a Symmetry constraint between two points across an axis while simultaneously giving each point independent, non-matching distance constraints from that same axis.
4. Over-Defining Arcs and Tangencies
Curved geometry introduces complex mathematical relationships that easily trigger solver errors:
- Defining the radius of an arc that is constrained tangent to two fixed, non-parallel lines. The radius is mathematically fixed by the distance and angle between the lines; applying a manual radius constraint causes an over-constraint.
- Applying an arc-length constraint alongside a radius and an included-angle constraint.
5. Equality Overuse
Using the Equality constraint enforces identical lengths or radii across multiple elements. If you apply an Equality constraint between two lines, but later place explicit length dimensions on both lines, the solver sees two competing instructions dictating the size of the second line.
How to Identify and Clear the Conflict
When a sketch becomes over-constrained, FreeCAD's Tasks panel displays an error message stating: "Over-constrained: remove at least one constraint."
- Check the Solver Messages: FreeCAD highlights the conflicting constraints in blue or red in the 3D view and lists their constraint numbers in the Tasks panel.
- Select and Delete: Click the highlighted constraint
reference in the solver list to locate it immediately in the sketch,
then press the
Deletekey. - Use Reference Dimensions: If you need a dimension for informational or modeling reference without restricting the geometry, convert it into a "Driving/Driven" (Reference) dimension by toggling the dimension mode toolbar button before or after placing it. Reference dimensions do not count against degrees of freedom and cannot cause over-constraint errors.