スケッチャー簡易チュートリアル - 拘束の実践方法
| 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 |
Introduction
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.
Setup
1. Open FreeCAD, create a new empty document with File → New Document.
- 1.1. Switch to the Sketcher Workbench from the workbench selector, or the menu View → Workbench → Sketcher.
Some actions to remember:
- Press the right mouse button, or press Esc in the keyboard once, to deselect the active tool in edit mode.
- To exit the sketch edit mode, press the Close button in the Task Panel, or press Esc twice in the keyboard.
- To enter again edit mode, double click on the sketch in the Tree View, or select it, and then click on
Edit Sketch.
Create a sketch
2. Click on New Sketch.
- 2.1. Choose the sketch orientation, that is, one of the base XY-, XZ-, or YZ-planes. We will use the default plane and options.
- 2.2. Click OK to start constructing the 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.
First approach: datum constraints
3. We will draw a fully constrained square, centered at the origin.
- 3.1. Click on
Polyline, then trace four lines in the general shape of a rectangle around the origin.
Unconstrained rectangular sketch.
- 3.2. Select one horizontal line, and press
Horizontal Dimension, then enter
20 mm. - 3.3. Select the other horizontal line, and repeat the constraint with the same dimension.
- 3.4. Select one vertical line, and press
Vertical Dimension, then enter
20 mm. - 3.5. Select the other vertical line, and repeat the constraint with the same dimension.
- 3.6. Select one bottom corner point (a), and the origin of the sketch, and press
Horizontal Dimension, then enter
10 mm. - 3.7. Select the top corner point (b) above the previous corner point (a), and the origin of the sketch, and repeat the constraint with the same dimension.
- 3.8. Select the other bottom corner point (c), and the origin of the sketch, and press
Vertical Dimension, then enter
10 mm. - 3.9. Select the top corner point (b) again, and the origin of the sketch, and repeat the constraint with the same dimension.
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.
A better way: datum and geometric constraints
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.
- 4.1. Click on
Polyline, then trace four lines in the general shape of a rectangle around the origin.
- 4.2. Select one horizontal line, and press
Horizontal Constraint.
- 4.3. Select the other horizontal line, and repeat the constraint.
- 4.4. Select one vertical line, and press
Vertical Constraint.
- 4.5. Select the other vertical line, and repeat the constraint.
Geometrical horizontal and vertical constraints.
- 4.6. Select one horizontal line, and press
Horizontal Dimension, then enter
20 mm. We see that the other horizontal line changes size at the same time. - 4.7. Select one vertical line, and press
Vertical Dimension, then enter
20 mm. We see that the other vertical line changes size at the same time. - 4.8. Select one bottom corner point (a), and the origin of the sketch, and press
Horizontal Dimension, then enter
10 mm. - 4.9. Select the top corner point (b) above the previous corner point (a), and the origin of the sketch, and press
Vertical Dimension, then enter
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.
Optimum scheme: mostly geometric constraints
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.
- 5.1. Click on
Polyline, then trace four lines in the general shape of a rectangle around the origin.
- 5.2. Select one horizontal line, and press
Horizontal Constraint.
- 5.3. Select the other horizontal line, and repeat the constraint.
- 5.4. Select one vertical line, and press
Vertical Constraint.
- 5.5. Select the other vertical line, and repeat the constraint.
Geometrical horizontal and vertical constraints.
- 5.6. Select one bottom corner point (a), then the top corner point that is diagonally opposite, and then the origin of the sketch; then press
Symmetric Constraint. The two selected points will be equidistant from the origin.
- 5.7. Select two adjacent sides of the rectangle (connected at one corner), and press
Equal Constrain. Notice that due to the symmetry of the corner points, all sides are now of the same size.
Left: symmetric constraint for only two corner points. Right: additional equal constraint for only two adjacent sides.
- 5.8. Select one horizontal line, and press
Horizontal Dimension, then enter
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.
Additional resources
- 全般: スケッチを作成、スケッチを編集、スケッチをアタッチ、スケッチの方向を変更、スケッチを検証、スケッチをマージ、スケッチを鏡像化、スケッチの編集を終了、スケッチを表示、セクション表示、グリッドの表示を切り替え、スナップの切り替え、レンダリング順を設定、操作を停止
- スケッチャージオメトリー: 点を作成、ポリライン(折れ線)を作成、線分を作成、中心点から円弧を作成、3点指定円弧を作成、楕円弧を作成、双曲線の円弧を作成、放物線の円弧を作成、中心を指定して円を作成、3点で円を作成、中心点を指定して楕円を作成、3点を指定して楕円を作成、長方形を作成、中心配置長方形、角丸長方形、正三角形, 正方形、正五角形、正六角形、正七角形、正八角形、正多角形、長円形を作成、円弧状の長円形を作成、制御点によるBスプライン, 制御点によるBスプライン、制御点によるBスプライン、ノットによる周期的Bスプライン、構築ジオメトリの切り替え
- スケッチャー拘束:
- 寸法拘束: 寸法、水平距離拘束、垂直距離拘束、距離拘束、半径/直径を自動拘束、半径拘束、直径拘束、角度を拘束、ロック拘束
- 幾何拘束: 一致拘束(統合)、一致拘束、点がオブジェクト上にある拘束、水平/垂直拘束、水平拘束、垂直拘束、 並行拘束, 直角拘束、正接拘束または共線拘束、等値拘束、対称拘束、固定拘束
- その他の拘束: 屈折率拘束(スネルの法則)
- 拘束ツール: 駆動拘束/参照拘束の切り替え、駆動拘束/参照拘束の切り替え
- スケッチャーツール フレットを作成、面取りを作成、エッジをトリム、エッジを分割、エッジを延長、外部ジオメトリを作成、カーボンコピーを作成、原点を選択, 水平軸を選択、垂直軸を選択、配列変換, 軸周変換、スケール変換、オフセット、対称、軸方向の拘束を解除、すべてのジオメトリーを削除, すべての拘束を削除
- スケッチャーBスプラインツール: ジオメトリをB-スプラインに変換、Bスプラインの次数を増やす、Bスプラインの次数を減らす、ノット多重度を増やす, ノット多重度を減らす、ノットを挿入、曲線を結合
- スケッチャー表示ツール: 未拘束の自由度を選択、関連する拘束を選択、関連する要素を選択、冗長な拘束を選択、競合する拘束を選択、円弧の補助円を表示/非表示、Bスプライン次数の表示/非表示, Bスプライン制御ポリゴンの表示/非表示、Bスプライン曲率コームの表示/非表示、Bスプラインノット多重度の表示/非表示、Bスプライン制御点重みの表示/非表示、内部ジオメトリの表示/非表示、仮想スペース切り替え
- はじめてみよう
- インストール: ダウンロード、Windowsへのインストール、Linuxへのインストール、Macへのインストール、付加機能のインストール、Dockerでのコンパイル、AppImage、Ubuntu Snap
- 基本: FreeCADについて、ユーザー・インタフェース、Mマウス・ナビゲーション、オブジェクトの選択方法、オブジェクトの名前、設定、ワークベンチ、FreeCADファイルの構造、プロパティ、FreeCADへの貢献、寄付
- ヘルプ: チュートリアル、チュートリアル動画
- ワークベンチ: 共通ツール、アセンブリー、BIM、CAM、ドラフト、FEM、インスペクション、マテリアル、メッシュ、OpenSCAD、 パート、パートデザイン、ポイント、リバースエンジニアリング、ロボット、スケッチャー、スプレッドシート、サーフェス、テックドロー、テストフレームワーク
- 情報ハブ: ユーザー向けハブ、パワーユーザー向けハブ、開発者向けハブ