Constraints
Constraints say what must stay true (this line is horizontal, these two points meet) and dimensions say how big things are. Together they remove the sketch's degrees of freedom until nothing can move by accident.
The readout
The Sketch Palette shows, at its top, where the sketch stands:
- N dimensions or constraints required: the sketch can still move in N ways.
- Fully constrained: nothing can move.
- A red line such as constraints conflict or did not converge: the solver cannot satisfy what it has been given.
The geometry is coloured to match: one colour while anything can still move, another once nothing can, and red for entities in a conflict. Construction geometry is dashed, projected reference geometry purple, fixed points green.
A sketch does not have to be fully constrained to extrude.
Constraints inferred while you draw
As you draw, Anvil looks for what you probably mean and shows a glyph beside the cursor before you click. Click, and that constraint is added for you.
| Glyph | Meaning |
|---|---|
* |
Coincident with an existing point |
H |
Horizontal from the previous point |
V |
Vertical from the previous point |
M |
At the midpoint of a line |
// |
Parallel to an existing line |
L |
Perpendicular to an existing line |
T |
Tangent to the circle or arc the line starts on |
O |
Concentric with an existing circle or arc |
x |
On a circle or arc |
Hold Ctrl while you click to draw without inference. To keep the glyphs but stop the cursor jumping to inferred positions, untick Snap in the palette.
A rectangle drawn with the 2-Point or Center Rectangle comes with its sides already horizontal and vertical. A 3-Point Rectangle, which can lie at any angle, comes with one corner perpendicular and its opposite sides parallel instead.
Adding a constraint yourself
- With no tool armed, select the geometry. Shift-click to select more than one thing.
- Click the constraint in the CONSTRAINTS panel of the SKETCH tab.
A button is greyed until the right number of things is selected; a wrong kind of selection gets a message saying what is needed.
| Constraint | Select | Result |
|---|---|---|
| Horizontal/Vertical | One line | Whichever of the two the line is already nearer to. |
| Coincident | Two points | The points meet. |
| Tangent | Two curves, at least one a circle or arc | They touch without crossing. |
| Equal | Two lines; two circles or arcs; or a line and an arc | Equal length, or equal radius. |
| Parallel, Perpendicular | Two lines | |
| Concentric | Two circles or arcs | They share a centre. |
| Collinear | Two lines | Both lie on one infinite line. |
| Symmetry | Two points, then the line to mirror about | The points mirror each other across the line. |
| Midpoint | A point, then a line | The point sits at the middle of the line. |
| Fix/Unfix | Anything | Holds the selection where it is; on something already fixed, lets it go. |
For Symmetry and Midpoint the order you select in matters: points first, the line last.
Curvature is greyed; it belongs to splines, which are not in v1.
The docked Sketch panel (right-hand side) has the geometric constraints as buttons, with Horizontal and Vertical separate, plus Point on entity, which puts a point on a curve. Collinear and Fix/Unfix are on the toolbar's CONSTRAINTS panel only.
Seeing and removing constraints
With Show constraints ticked in the Sketch Palette, the constraints already in the sketch are marked on the geometry with the same glyphs as above, plus = equal, -- collinear, S symmetric and F on a point you have fixed. A constraint between curves puts a mark on each of them, so both of two parallel lines show //.
To remove one, open the docked Sketch panel and expand Constraints: every constraint and dimension is listed. Right-click one and choose Delete.
Conflicts
If you add a constraint that contradicts the others, the readout turns red, the entities involved are drawn in red, and the Sketch panel says how many constraints conflict or are redundant and lists them in red. Delete one of the listed constraints, or press Ctrl+Z, and the sketch solves again.
A common cause is dimensioning something twice: a second dimension on a length that is already fixed is redundant, not an edit. To change a value, double-click the dimension; see Dimensions and expressions.
Testing a sketch by dragging
With no tool armed, drag a point: what is constrained holds.
- Home
- Getting started
- Sketching
- Modelling
- Files
- Printing
- Working with an AI assistant
- Reference
Written for Anvil 0.2.0. Units are millimetres. Repository · Issue tracker
