自动推断
Onshape 草图编辑器可以自动为某些图元指定约束。例如,如果创建一条线并将光标悬停在原点上方的一个端点上,会出现一条虚线,指示该端点与原点之间的竖直推断。
绘制草图时,Onshape 会显示关于一个图元与原点和/或另一个图元之间的水平和竖直对齐方式的推断。在某些情况下,只有将光标移近另一个图元以“唤醒”两个图元之间的推断时才会发生推断。一些常用的唤醒推断包括:水平、竖直、中点、平行和重合。



Constraints are added to a sketch either through automatic inferencing or manually.
Automatic inferencing is a quick way to add basic constraints while sketching. It applies to items within the active sketch or entities of the face the sketch is on
Hover over one or more sketch entities with the cursor to wake up inference points.
The type of inferred constraint it is suggesting is shown below the cursor. For vertices and midpoints, it indicates with a yellow highlight. For vertical or horizontal constraints, it indicates with an orange dashed line.
Left-click while these indicators are showing to accept the inferred constraint.
Inferencing is enabled by default but can be temporarily disabled by holding down the Shift key.
Releasing the Shift key makes automatic inferencing available again.
Drag existing sketch entities to utilize automatic inferencing after placement.
For example, dragging the center point of a circle vertically to the origin automatically adds a vertical constraint.
You can also make constraints manually. To add one constraint at a time, pre-select the sketch entities to constrain, then click the constraint that you want in the toolbar.
To add multiple constraints of the same type, select the constraint from the toolbar first, then click on the sketch geometry to constrain.
his keeps the constraint active until it is deselected.
To evaluate the sketch’s definition, there are a couple methods for the constraints you have already applied. To show the constraints applied to an individual sketch entity, hover over it with the cursor.
To see what entities a constraint is applied to, hover the cursor over the constraint icon.
This highlights the sketch geometry associated with that constraint.
Press and hold the Shift key while moving the cursor to retain visible constraint icons.
This makes it easier to select them. Show all constraints by checking Show constraints in the sketch dialog.
Remove a constraint by left-clicking the constraint icon in the graphics area and pressing the Delete key.
Constraint icons are generally either blue or white.
A white constraint icon indicates a constraint between entities within the same sketch.
A blue constraint icon indicates a constraint that is associated with something outside of the sketch, such as an origin or edge of a previous sketch or feature.
步骤
- 创建相互之间存在垂直约束的两条线。
- 将光标移近线,直到“唤醒”推断。
- 绘制一条线。
绘制草图时,Onshape 将指示与其他草图图元之间的关系。在下图中,底部的(蓝)线是正在绘制的线。与另一条线平行时,它会变成一条虚线,而另一条线将以橙色亮显,表明两者之间存在关系。(在本例中也可以看到平行约束图标。)
要抑制自动推断,请在按住 Shift 键的同时单击鼠标。