Draw two lines in SolidCraft above, then press C for Coincident or D for a dimension — that's the whole workflow this page explains. SolidCraft is a free, open-source (MIT or Apache-2.0) parametric CAD app, and its sketches are driven entirely by constraints and dimensions, not free-hand lines. New here? Start with the SolidCraft tutorial for a first sketch, or SolidCraft Parametric CAD for how constraints feed the parameter system. This page goes deeper into constraints on their own: every type, AutoConstrain, and what the solver does when a sketch can't be satisfied.
Why constraints instead of free-hand lines
A SolidCraft sketch is never just geometry sitting on a plane. Every line, arc, circle, spline and point can carry constraints that fix its relationship to other geometry, and dimensions that fix its size through a parameter. Drag a constrained line and the sketch resolves every frame as you move the cursor, then the whole model rebuilds once when you release — so you see the result live, not after a recompute. This is the same mechanism that makes SolidCraft's parametric timeline work: change a dimension later, and the sketch (and everything built on it) follows the constraints back to a valid shape instead of needing to be redrawn.
Every constraint type
The SKETCH › CONSTRAINTS group in SolidCraft's command registry lists these geometric constraints:
- Coincident — snaps a point onto another point or curve.
- Horizontal / Vertical / Horizontal/Vertical — locks a line to an axis direction.
- Parallel and Perpendicular — fixes the angle between two lines.
- Tangent — one curve touches another without crossing.
- Curvature (G2) — a stronger version of tangent that also matches curvature, for a seamless blend between two curves.
- Equal — two lines the same length, or two arcs/circles the same radius.
- Concentric — two circles or arcs share a center.
- Collinear — two lines sit on the same infinite line.
- MidPoint — a point sits exactly halfway along a line or curve.
- Symmetry — mirrors geometry about a line or axis; passing
mode:"lines"mirrors the lines while letting their endpoints slide, while the default mirrors endpoints in pairs. - Fix (and its toggle, Unfix) — pins geometry in place so nothing else can move it.
Dimensions are tracked separately but use the same undo step and the same D shortcut (Sketch Dimension: press D, click the geometry, type the value, press Enter). The dimension types are linear, aligned, horizontal, vertical, point-to-line, line-to-circle, point-to-circle, circle-to-circle, radius, diameter, angle, arc sweep, arc length and slot length — and every one of them can be driven by a parameter expression instead of a fixed number, the same unit-aware expressions SolidCraft's parameter system uses elsewhere (2 * width + 5 mm, angle / 2).
AutoConstrain: let SolidCraft add the obvious ones
Rather than clicking Coincident, Horizontal and Tangent by hand on every segment, AutoConstrain (SKETCH › CONSTRAINTS) scans the sketch you've already drawn and adds the relationships it can infer on its own. AutoConstrain from Datum does the same thing relative to a reference datum instead of the sketch's own geometry. Neither command adds dimensions — they only add the geometric relationships; you still dimension the sketch yourself to fix its actual size, since AutoConstrain has no way to know what size you want.
How the solver actually works
SolidCraft's constraint solver is its own, not a wrapped third-party library. Points that the constraints fix relative to already-known geometry are placed exactly by construction — using loci intersections and rigid-cluster decomposition, following the Owen (1991) and Fudos-Hoffmann (1997) methods. Whatever is left after that is solved by Levenberg-Marquardt, a numerical least-squares method, and the rank of its Jacobian matrix tells SolidCraft exactly how many degrees of freedom are still unconstrained. That number is what drives the fully-constrained check: once there are zero degrees of freedom left, the geometry turns black. Anything still able to move under a drag keeps its normal color, so a quick drag test shows you precisely which lines or points are still free — useful when a sketch "looks" finished but a feature built on it keeps shifting.
Over-constraining is refused, not silently broken
Add a constraint that conflicts with what's already fixed, and SolidCraft refuses it outright instead of quietly leaving the sketch in a bad state. The exact message from the modeling reference is that the new constraint "conflicts with the sketch: neither entity can move to satisfy it." A concrete example from SolidCraft's own documentation: if a symmetry constraint already forces two circles to be equal in size, and you'd already fixed their radii apart with separate dimensions, SolidCraft blocks the new constraint rather than breaking one of the old ones. In practice this means a sketch can't drift into an inconsistent state through normal editing — a rejected constraint is a signal to remove or loosen something that's already there, not a bug to work around.
Where constraints show up next
Constraints aren't limited to 2D sketches on a plane. The same relationships extend into SolidCraft's assembly workflow as joints and mates between components, and sketch dimensions are exactly what the SolidCraft Parameters and configurations system exposes as editable variables across a whole design. If you're coming from a mesh-first workflow instead, SolidCraft's mesh.convert command reconstructs closed meshes as parametric solids that you can then constrain and dimension like any native sketch.