Geometric constraint

Also known as: sketch constraint

On this page 7

A geometric constraint is a rule applied inside a CAD sketch that fixes the relationship between sketch entities, such as two lines being parallel, an arc being tangent to a line or a point lying exactly on a circle. Also called a sketch constraint, it describes shape and orientation without stating any size, which is the job of dimensional constraints.

In CAD for makers, geometric constraints are the foundation of parametric modeling for 3D printing & making: they turn a loose drawing into a predictable, editable profile that survives later changes to dimensions, tolerances and features without collapsing.

How a geometric constraint works in the sketch solver

A geometric constraint works by adding an equation to the sketch solver that restricts the possible positions of points, lines and curves. Every unconstrained point in a 2D sketch has two degrees of freedom (x and y), a line segment has four, and a circle has three (center x, center y and radius).

Each constraint removes one or more of these freedoms. A horizontal constraint on a line removes one freedom, a coincident constraint between two points removes two, and a fix or lock constraint removes all freedoms of the selected entity. The solver, typically a numerical iterative algorithm based on Newton-Raphson methods, repositions the geometry until all equations are satisfied at once.

When every freedom is removed, the sketch is fully constrained (often shown in black or a distinct color). When freedoms remain, it is under-constrained and parts of it can still be dragged. When two rules conflict or one repeats another, the sketch is over-constrained, and the software reports an error or refuses the new constraint.

Common types of geometric constraints

Most CAD programs offer a similar core set of constraints, although icons and names differ between Autodesk Fusion, Onshape, FreeCAD and SOLIDWORKS. The table below lists the constraints used most often in sketches for printable parts.

ConstraintWhat it enforcesFreedoms removedTypical use
CoincidentTwo points share a location, or a point lies on a curve1 or 2Closing profiles, snapping to origin
Horizontal / verticalA line aligns with a sketch axis1Base edges, walls of enclosures
ParallelTwo lines keep the same direction1Opposite sides of slots and brackets
PerpendicularTwo lines meet at 90 degrees1Corners of mounting plates
TangentA curve meets another curve or line smoothly1Rounded slots, cam profiles
ConcentricCircles or arcs share a center2Bosses around screw holes
EqualLines share a length or circles share a radius1Hole patterns, symmetric ribs
SymmetricTwo entities mirror about a line2Clips and snap-fit joints
MidpointA point sits at the middle of a line1Centering features on edges
Fix / lockAn entity cannot move at allAllImported reference geometry
Core geometric constraints and the freedoms they remove

Some programs add specialized constraints such as collinear, curvature-continuous (G2) for splines, or pierce constraints that tie a sketch point to a 3D edge. FreeCAD and Onshape also allow constraints to reference external geometry projected from existing faces.

Geometric versus dimensional constraints

A geometric constraint defines shape and orientation, while a dimensional constraint defines size and position as a number. A robust sketch uses both, and the usual workflow is to apply geometric rules first and dimensions last, because geometry removes the freedoms that would otherwise need many redundant numbers.

AspectGeometric constraintDimensional constraint
DefinesRelationship between entitiesLength, angle, radius or distance
ValueNo numeric valueNumeric value or expression
Edited byAdding or deleting the ruleChanging the number or parameter
Design intentCaptures how parts must relateCaptures how big parts must be
Link to parametersIndirectDirect, often driven by variables
Comparison of geometric and dimensional constraints

The distinction matters for design intent. If a bracket must stay rectangular whatever its size, perpendicular and parallel constraints express that intent permanently, whereas four angle dimensions of 90 degrees express it only as numbers that someone may later change by mistake.

Applying geometric constraints to printable parts

Good constraint practice produces sketches that update cleanly when parameters change, which is the main advantage of parametric modeling over direct modeling. Makers who iterate on fit, for example by adjusting clearances after a test print, benefit most from a disciplined approach.

  • Anchor the sketch to the origin with a coincident or midpoint constraint so the part does not drift in later features.
  • Use symmetry about a construction line instead of duplicating dimensions on both sides of a part.
  • Prefer equal constraints for repeated holes so one diameter change updates every hole for heat-set inserts.
  • Keep sketches simple and push detail into features such as fillets and chamfers rather than drawing them in the profile.
  • Check that the sketch is fully constrained before extruding, especially in profiles that will drive other features in the feature tree.

The decision table below suggests which constraint expresses a common design requirement most directly.

RequirementRecommended constraintReason
Slot must stay centered on a plateSymmetric about centerlineSurvives any plate width change
Screw holes share one sizeEqual radiusOne edit updates all holes
Lid lip follows the box outlineOffset with coincident anchorsClearance stays uniform
Rounded end of a slotTangent arc to both sidesPrevents kinks in the toolpath or print
Boss around an insert holeConcentric circlesWall thickness remains even
Choosing a constraint for a design requirement

Typical errors and how to fix them

Most sketch failures come from conflicting or missing constraints rather than from the solver itself. Recognizing the symptom shortens debugging considerably, particularly in long feature trees where one broken sketch can invalidate many downstream features.

SymptomLikely causeFix
Sketch jumps or flips after an editUnder-constrained geometryAdd constraints until fully defined
Solver rejects a new ruleRedundant or conflicting constraintDelete the duplicate relationship
Profile will not extrudeOpen contour from a missing coincidentClose the gap at the endpoints
Features fail after a face changeReferences to unstable external edgesConstrain to planes or origin instead
Tangent arc inverts directionSolver chose another valid solutionDrag near the intended shape, then re-solve
Constraint problems, causes and fixes

A subtle problem is that a sketch can have more than one valid solution. The solver usually picks the one closest to the current geometry, so a large dimension change can make an arc or line flip to an unintended configuration. Changing values in smaller steps or adding a guiding constraint usually prevents this.

Mesh-based formats such as STL and 3MF do not store constraints at all. A part exported to these formats loses its parametric history, so the source CAD file, or at least a STEP export, should be kept alongside every printable model.

Stripped to the essentials

A geometric constraint is a rule that tells a drawing how its pieces must sit together. It might say that two lines always stay parallel, or that a hole always stays in the middle of a plate. It says nothing about size, only about shape and position.

Think of it like the hinges and rails of a folding table. The table can change size, but the legs always stay straight and the top stays flat. Constraints keep a design behaving sensibly when you change it later.

Where it is applied

A hobbyist designs a wall mount for a 60 mm router in parametric CAD. The base sketch is a rectangle anchored to the origin with a symmetric constraint about the vertical axis, two mounting holes set equal in radius, and a slot whose rounded ends are tangent to its straight sides.

The first print in PETG shows the router fits too tightly. The maker changes a single clearance parameter from 0.2 mm to 0.4 mm, and the constrained sketch updates the cradle, keeps the slot centered and leaves the hole spacing unchanged. The second print fits on the first attempt, and the same file later produces a version for a 65 mm device after one more dimension edit.