What Does the Lock Sketch Tool Do in FreeCAD?
The Lock constraint tool in FreeCAD's Sketcher Workbench fixes a selected sketch point to a specific coordinate location relative to the sketch origin. This article explains the core functionality of the Lock tool, how it works behind the scenes, ideal use cases, and best practices for using it within parametric design workflows.
Core Function of the Lock Tool
The Lock tool (represented by a padlock icon in the Sketcher toolbar) serves as a quick-positioning constraint. When you select a vertex or point in your sketch and click the Lock tool, FreeCAD automatically fixes that point in its current two-dimensional position.
Rather than introducing an entirely unique constraint type, FreeCAD creates two standard constraints simultaneously:
- A Horizontal Distance constraint from the origin \((0,0)\) to the selected point.
- A Vertical Distance constraint from the origin \((0,0)\) to the selected point.
By defining both horizontal (\(X\)) and vertical (\(Y\)) coordinates relative to the base coordinate system, the point loses both of its degrees of freedom, preventing it from moving when other geometry is adjusted.
How to Use the Lock Tool
- Open a sketch in the Sketcher Workbench.
- Select a single vertex, line endpoint, or center point of an arc or circle.
- Click the Constraint Lock icon or use the shortcut key assigned to it.
- Two dimensional constraints will appear on the canvas showing the horizontal and vertical distances from the origin to the locked point.
- Double-click either dimensional value to modify the coordinate location manually.
Common Use Cases
- Anchoring a Starting Geometry: When drafting a complex shape, locking the primary base corner or center point prevents the sketch from drifting across the plane while applying subsequent constraints.
- Rapid Prototyping: If you need to evaluate a shape quickly without fully calculating parametric relationships, locking key vertices allows you to quickly achieve a fully constrained sketch status.
- Preventing Solver Instability: If adding a tangent or angle constraint causes the sketch solver to jump into an inverted or unwanted configuration, temporarily locking key vertices forces the solver to move only the desired components.
Best Practices and Limitations
While convenient, relying heavily on the Lock tool is generally discouraged in strict parametric modeling.
- Loss of Intent: The Lock tool ties geometry directly to absolute coordinates rather than describing functional geometric relationships (such as symmetry, equality, or tangency). If the origin or reference geometry changes, locked points remain rigid and will not adapt.
- Editing and Removal: Because the Lock tool simply generates standard horizontal and vertical constraints, removing the "lock" requires selecting and deleting both distance constraints from the sketch or the elements list in the Tasks panel.