Snapping is Constraint (FreeCAD)

Thinking about the Sketcher UI in FreeCAD

Snapping is Temporary Constraint

Sketcher Constraints help us to position a new point coincident with an existing point, or to set the angle of a new line parallel with an existing line, and so on. This relationship is stored, and the actual position is calculated from the relationship.

Draft Snap also helps us to position a new point coincident with an existing point, or to set the angle of a new line parallel with an existing line, and so on. However, only the new position is stored; the fact that this position was determined by a relationship with another object is immediately forgotten.

Notice that there is a lot of overlap in the available kinds of Sketcher constraint and the available kinds of Draft Snap. There are snaps that correspond more or less closely with each kind of constraint, and vice-versa. That should not be surprising.

Coincident 32px-Constraint_PointOnPoint <-> 32px-Snap_Endpoint 32px-Snap_Midpoint 32px-Snap_Center Endpoint / Midpoint / Centre

Point on line 32px-Constraint_PointOnObject <-> 32px-Snap_Near 32px-Snap_Extension Nearest / Extension

Lock X and Y 32px-Sketcher_ConstrainLock <-> 32px-Snap_Grid Grid intersection

Horizontal / Vertical 32px-Constraint_Horizontal 32px-Constraint_Vertical <-> 32px-Snap_Ortho Orthogonal

Parallel / Perpendicular 32px-Constraint_Parallel 32px-Constraint_Perpendicular <-> 32px-Snap_Parallel 32px-Snap_Perpendicular Parallel / Perpendicular

Both Snapping and Constraints have the same purpose: to determine the placement (position and/or orientation) of an object in terms of a relationship with either another object or the world coordinate system. The difference is that a constraint is stored in terms of its definition, whereas with snapping only the resulting placement is stored.

Snapping implies that there is some significant feature to snap to, and that the user wants the new object to have this relationship to that existing feature. A useful, intuitive behaviour would be:

  • snapping is available for every kind of constraint that relates to existing geometry
  • snapping always produces a stored constraint (if the user wants it)

In Sketcher there is an auto-constraint option that produces a stored constraint automatically for some kinds of constraint, including coincident point, point on line, tangent, horizontal, vertical; but not parallel, perpendicular, equal length, etc. One or more icons appear near the cursor to indicate what kind of constraint will be produced.

Sketcher also performs some limited snapping (to a point and to a grid intersection only, AFAICT). Like with Draft Snap, it just stores the resulting position (with no constraints applied) when snapping takes place and auto-constraint is not enabled.

For the record, a couple more features are closely related to constraints:

  • temporarily constraining movement to an axis during an operation such as Move is much the same thing as snapping, and likewise should generate a stored constraint
  • a Draft Dimension is similar to a non-driving constraint

How It Should Work

This is what I’d like to have.

  • Draft and Sketcher should both support snapping in the same way and with all the types of snap;
  • every type of snap should be able to produce a (stored) constraint in Sketcher;
  • consistent naming and icons between snapping and constraints, and between Draft and Sketcher;
  • consistency between Draft Dimensions and Sketcher Dimension Constraints (both driving and non-driving).

Snapping should be an easy, fast and intuitive method of entering most constraints.


Notify of

1 Comment
Inline Feedbacks
View all comments
cremaster says:

Agree 100%. It also makes FreeCAD harder to learn, as I am currently trying to do. It was irritating to see (v0.16) that you can’t just accept the drawn values as constraints.