Constraint

From FreeCAD Documentation
Revision as of 11:42, 13 November 2021 by Roy 043 (talk | contribs)

Introduction

In FreeCAD the word "Constraint" is normally used to refer to a "rule" to draw geometrical shapes inside a Sketch (Sketcher::SketchObject class). A constraint limits the position of a certain geometrical element in different ways, for example, it can specify whether the element is horizontal, vertical, tangent, parallel, perpendicular, coincident with a point, concentric to another object, etc.

There are two big types of constraints:

  • Geometric constraints define characteristics of the shapes without specifying exact dimensions, for example, horizontality, verticality, parallelism, perpendicularity, and tangency.
  • Datum or dimensional constraints define characteristics of the shapes by specifying dimensions, for example, a numeric length or an angle.

See the information in the Sketcher Workbench for a list of all constraints that can be applied. Some of them apply to lines, some to curves, and some to vertices. See also the basic sketcher tutorial.

Usage

  1. Create a sketch either from the Sketcher Workbench or through the PartDesign Workbench.
  2. Press
  3. Double click the created sketch to enter its edit mode.
  4. Draw a series of lines using Create polyline.
  5. Pick one of the lines, and use Constrain vertical.
  6. Pick one of the lines, and use Constrain horizontal.
  7. Pick the vertical line, and use Constrain distance Y; assign a distance.
  8. Pick the horizontal line, and use Constrain distance X; assign a distance.


Notes

  • Constraints are useful to create very precise profiles which can the be turned into solid extrusions by using the PartDesign Pad or Part Extrude operations.
  • Constraints are only used within Sketches; other 2D objects such as those created with the Draft Workbench do not understand about constraints; the latter are simply placed in 3D space, and their properties define their shape and position.