| Topic |
|---|
| Sketcher |
| Level |
| Beginner |
| Time to complete |
| 30 minutes |
| Authors |
| Mark Stephen (Quick61) and vocx |
| FreeCAD version |
| 0.19 |
| Example files |
| Sketcher Constraints practices |
| See also |
| None |
This tutorial was originally written by Quick61, and it was rewritten and reillustrated by vocx.
This tutorial is designed to help the new user become familiar with the best practices of constraining a Sketch in the workflow of the Sketcher Workbench.
There is a general rule for constraints: the fewer datum constraints (dimensions), the better.
It is preferable to use a geometric constraint in place of a dimensional constraint if possible. This has to do with the internal workings of the Sketcher's constraint solver.
1. Open FreeCAD, create a new empty document with File → New Document.
Some actions to remember:
2. Click on New Sketch.
Note: in the Task Panel expand the Sketch Edit section and in its
settings menu turn off grid snap and the display of the grid. Also expand the Constraints section and in its
settings menu turn off Auto constraints.
3. We will draw a fully constrained square, centered at the origin.
Unconstrained rectangular sketch.
20 mm.20 mm.10 mm.10 mm.Left: datum constraints for the sides. Right: additional datum constraints for the interior dimensions.
Looking at the Constraints section in the Task Panel, we see that the constraints are too many; they also clutter the view of the sketch. These constraints are also computationally intensive for the solver; while this is not an issue with a simple shape, it can become one with more complex shapes.
4. We will draw the same square fully constrained, and centered at the origin. When you create the new sketch, make sure the Auto constraints option is disabled.
Geometrical horizontal and vertical constraints.
20 mm. We see that the other horizontal line changes size at the same time.20 mm. We see that the other vertical line changes size at the same time.10 mm.10 mm.Left: datum constraints for only two sides. Right: additional datum constraints for only two interior dimensions.
This is a better constrained sketch than the first one. The horizontal and vertical geometric constraints allow us to use fewer datum constraints, so our sketch looks less cluttered.
5. We will draw the same square fully constrained, and centered at the origin. When you create the new sketch, make sure the Auto constraints option is disabled.
Geometrical horizontal and vertical constraints.
Left: symmetric constraint for only two corner points. Right: additional equal constraint for only two adjacent sides.
20 mm. Due to the symmetric and equal constraints previously added, we see that all sides become equal at the same time.All geometric constraints applied, and a single datum constraint for a side.
This is the best way to constrain this sketch, as we only used one datum (dimensional) constraint.