Why Does FreeCAD Show Conflicting Constraints?

A conflicting constraint error in a FreeCAD sketch occurs when the geometric solver is given two or more rules that are mathematically impossible to satisfy simultaneously, or when a feature is redundant and over-defines the shape. This article explains the primary causes of conflicting constraints in the Sketcher workbench, how the solver interprets them, and the direct steps you can take to diagnose and resolve these conflicts quickly.

What Causes Conflicting Constraints?

FreeCAD relies on a mathematical solver to calculate the exact position, size, and orientation of every vertex and line in a sketch. When constraints conflict, the solver cannot find a valid mathematical solution. The most common reasons include:

  • Direct Contradictions: Applying mutually exclusive rules to the same geometry, such as making two lines both parallel and perpendicular, or constraining a single line to have two different lengths.
  • Redundant Constraints (Over-Constraining): Adding dimensions or relationships that are already fully determined by existing constraints. For example, if three angles in a triangle are defined, adding a fourth constraint to define the sum or an already fixed angle triggers an over-constraint conflict.
  • Accidental Auto-Constraints: While sketching, FreeCAD automatically infers and applies constraints (such as horizontal, vertical, or point-on-object) based on cursor position. If an automatic constraint snaps to an unintended entity, subsequent manual dimensions may contradict it.
  • External Geometry Clashes: Linking a sketch to external 3D geometry via the "External Geometry" tool imports fixed positions. Adding sketch dimensions that disagree with the dimensions of the referenced 3D model will cause immediate conflicts.
  • Mathematical Impossibilities: Imposing rules that violate basic geometry, such as setting three sides of a triangle to lengths where the two shorter sides do not sum to more than the longest side.

How to Identify and Fix the Conflict

When a conflict occurs, FreeCAD turns the conflicting sketch elements orange or red and updates the Tasks panel under the Solver messages section. Follow these steps to clear the error:

  1. Check the Solver Messages: Open the Tasks tab on the left panel. FreeCAD explicitly lists the indices of the problematic constraints (e.g., "Conflicting constraints: Constraint12, Constraint15").
  2. Highlight the Culprit: Click the blue constraint links directly inside the solver message list. FreeCAD will highlight the corresponding constraint in the 3D view and in the constraints list.
  3. Delete Redundant or Conflicting Rules: Select the highlighted constraint in the sketch or the Constraints list and press Delete. Often, deleting just one of the conflicting rules allows the solver to recalculate successfully.
  4. Use Reference Dimensions: If you need to view a measurement without restricting the geometry, select the constraint and toggle it into a Reference Constraint (indicated in blue). Reference constraints measure geometry without driving it, preventing solver conflicts.
  5. Disable Auto Constraints Temporarily: If automatic snapping continues to create conflicting constraints during drawing, uncheck "Auto constraints" in the Sketcher Edit task panel while placing lines, then apply the required constraints manually.