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.
| Constraint | What it enforces | Freedoms removed | Typical use |
|---|---|---|---|
| Coincident | Two points share a location, or a point lies on a curve | 1 or 2 | Closing profiles, snapping to origin |
| Horizontal / vertical | A line aligns with a sketch axis | 1 | Base edges, walls of enclosures |
| Parallel | Two lines keep the same direction | 1 | Opposite sides of slots and brackets |
| Perpendicular | Two lines meet at 90 degrees | 1 | Corners of mounting plates |
| Tangent | A curve meets another curve or line smoothly | 1 | Rounded slots, cam profiles |
| Concentric | Circles or arcs share a center | 2 | Bosses around screw holes |
| Equal | Lines share a length or circles share a radius | 1 | Hole patterns, symmetric ribs |
| Symmetric | Two entities mirror about a line | 2 | Clips and snap-fit joints |
| Midpoint | A point sits at the middle of a line | 1 | Centering features on edges |
| Fix / lock | An entity cannot move at all | All | Imported reference geometry |
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.
| Aspect | Geometric constraint | Dimensional constraint |
|---|---|---|
| Defines | Relationship between entities | Length, angle, radius or distance |
| Value | No numeric value | Numeric value or expression |
| Edited by | Adding or deleting the rule | Changing the number or parameter |
| Design intent | Captures how parts must relate | Captures how big parts must be |
| Link to parameters | Indirect | Direct, often driven by variables |
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.
| Requirement | Recommended constraint | Reason |
|---|---|---|
| Slot must stay centered on a plate | Symmetric about centerline | Survives any plate width change |
| Screw holes share one size | Equal radius | One edit updates all holes |
| Lid lip follows the box outline | Offset with coincident anchors | Clearance stays uniform |
| Rounded end of a slot | Tangent arc to both sides | Prevents kinks in the toolpath or print |
| Boss around an insert hole | Concentric circles | Wall thickness remains even |
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.
| Symptom | Likely cause | Fix |
|---|---|---|
| Sketch jumps or flips after an edit | Under-constrained geometry | Add constraints until fully defined |
| Solver rejects a new rule | Redundant or conflicting constraint | Delete the duplicate relationship |
| Profile will not extrude | Open contour from a missing coincident | Close the gap at the endpoints |
| Features fail after a face change | References to unstable external edges | Constrain to planes or origin instead |
| Tangent arc inverts direction | Solver chose another valid solution | Drag near the intended shape, then re-solve |
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.