---
jupyter:
description: 'Constraint sketches in planex2d: draw roughly, constrain with flags and
dimensions, and solve; dimensions by id, Update for parametric parts, and export like
any other sketch.'
---
# Constraint sketches
A constraint sketch, `px.Sketch`, supports every drawing call of `px.QuickSketch`: lines, arcs, circles and splines
from references, construction elements, offsets, trimming and mirroring (see [Quick sketch](../sketch/index.md)). In
addition, it keeps constraints that turn a rough drawing into an exact one, such as a line that must be horizontal, an
arc that must be tangent, or a hole 8 in diameter and 40 from the center. planex2d solves these constraints, moves
every element as little as they allow, and shows what is still free.
Every dimension has an id, and setting a dimension solves the sketch again, so the sketch becomes a parametric part.
Expressions tie dimensions together as design rules. The same solver also moves mechanisms: given a crank angle, it
returns the position of every joint. The solved sketch exports like any other, as faces, wires, OpenCASCADE shapes and
netgen geometries.
In this section
## Constraining
- [Drawing with constraints](drawing.md)
- [Converting sketches](converting.md)
- [Constraints and dimensions](kinds.md)
- [Fully, under- and over-constrained](diagnosis.md)
## Changing the design
- [Changing dimensions](update.md)
- [Expressions: design rules](expressions.md)
- [Formulas: a dipstick for a tank](formulas.md)
## More geometry
- [Symmetry and patterns](symmetry.md)
- [Splines](splines.md)
- [Trim, split and project](trim.md)
- [Offsets and profiles revisited](offsets-profiles.md)
## Beyond drawings
- [Mechanisms: the sketch as a solver](mechanisms.md)