Sketcher ConstrainEqual: Difference between revisions

From FreeCAD Documentation
(fixed links in GuiCommand)
No edit summary
(41 intermediate revisions by 9 users not shown)
Line 1: Line 1:
<languages/>
{{GuiCommand|Name=Constraint EqualLength|Workbenches=[[Sketcher Workbench|Sketcher]], [[PartDesign Workbench|PartDesign]]|MenuLocation=Sketch → Sketcher constraints → Constrain equal|SeeAlso=[[Constraint Radius]]}}
{{Page_in_progress}}
<translate>


<!--T:6-->
====Description====
{{Docnav
|[[Sketcher_ConstrainTangent|Tangent]]
|[[Sketcher_ConstrainSymmetric|Symmetric]]
|[[Sketcher_Workbench|Sketcher]]
|IconL=Sketcher_ConstrainTangent.svg
|IconR=Sketcher_ConstrainSymmetric.svg
|IconC=Workbench_Sketcher.svg
}}


<!--T:1-->
The Constrain Equal constraint forces two or more line segments in a line , poly-line or rectangle to have equal length. If applied to arcs or circles the radii are constrained to be equal. It cannot be applied to geometry primitives which are not of the same type (e.g. line segments and arcs).
{{GuiCommand
|Name=Sketcher ConstrainEqual
|MenuLocation=Sketch → Sketcher constraints → Constrain equal
|Workbenches=[[Sketcher_Workbench|Sketcher]]
|Shortcut={{KEY|E}}
|SeeAlso=
}}


==Description== <!--T:2-->
====Operation====
The example sketch below contains a number of sketch primitives ( line,poly-line, rectangle, arc and circle).


<!--T:4-->
[[File:EqualConstraint1.png|256px]]
The [[Image:Sketcher_ConstrainEqual.svg|24px]] [[Sketcher_ConstrainEqual|Sketcher ConstrainEqual]] tool constrains edges to have an equal length (lines) or curvature (other edges except [[Sketcher_CreateBSpline|B-splines]]). Selected edges must have the same type. Circles and circular arcs are of the same type (their radii are made equal), and so are ellipses and elliptical arcs (their major and minor radii are made equal).


==Usage==
Select two or more line segments (e.g. line and one side of the rectangle).


See also: [[Sketcher_Workbench#Drawing_aids|Drawing aids]].
[[File:EqualConstraint2.png|256px]]


===[[Sketcher_Workbench#Continue_modes|Continue mode]]===
Click on the Constrain Equal icon [[File:Constraint_EqualLength.png|16px]] in the Sketcher toolbar (in either the Sketcher or Part Design workbenches) or select the Constrain Equal menu item from the Sketcher constraints sub menu item in either the Sketch or Part Design menu item depending upon which workbench is selected (Sketcher or Part Design) to apply the constraint to the selected items.


<!--T:14-->
[[File:EqualConstraint3.png|256px]]
# Make sure there is no selection.
# There are several ways to invoke the tool:
#* Press the {{Button|[[Image:Sketcher_ConstrainEqual.svg|16px]] [[Sketcher_ConstrainEqual|Constrain equal]]}} button.
#* Select the {{MenuCommand|Sketch → Sketcher constraints → [[Image:Sketcher_ConstrainEqual.svg|16px]] Constrain equal}} option from the menu.
#* {{Version|0.22}}: Right-click in the [[3D_view|3D view]] and select the {{MenuCommand|Constrain → [[Image:Sketcher_ConstrainEqual.svg|16px]] Constrain equal}} option from the context menu.
#* Use the keyboard shortcut: {{KEY|E}}.
# The cursor changes to a cross with the tool icon.
# Select two edges of the same type.
# A constraint is added.
# Optionally keep creating constraints.
# To finish, right-click or press {{KEY|Esc}}, or start another geometry or constraint creation tool.


===Run-once mode===
Now select the arc and the circle in the sketch.


# Select two or more edges of the same type.
[[File:EqualConstraint4.png|256px]]
# Invoke the tool as explained above, or with the following additional option:
#* {{Version|0.22}}: Right-click in the [[3D_view|3D view]] and select the {{MenuCommand|[[Image:Sketcher_ConstrainEqual.svg|16px]] Constrain equal}} option from the context menu.
# Depending on the selection one or more constraints are added.


== Scripting == <!--T:28-->
and apply the Constrain Equal [[File:Constraint_EqualLength.png|16px]] constraint as before.


</translate>
[[File:EqualConstraint5.png|256px]]
{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Equal', Edge1, Edge2))}}
<translate>


<!--T:29-->
Now select the line segment, all segments of the poly-line and one of the remaining unconstrained sides of the rectangle
The [[Sketcher_scripting|Sketcher scripting]] page explains the values which can be used for {{incode|Edge1}} and {{incode|Edge2}} and contains further examples on how to create constraints from Python scripts.


[[File:EqualConstraint6.png|256px]]


<!--T:7-->
and apply the Constrain Equal [[File:Constraint_EqualLength.png|16px]] constraint as before.
{{Docnav
|[[Sketcher_ConstrainTangent|Tangent]]
|[[Sketcher_ConstrainSymmetric|Symmetric]]
|[[Sketcher_Workbench|Sketcher]]
|IconL=Sketcher_ConstrainTangent.svg
|IconR=Sketcher_ConstrainSymmetric.svg
|IconC=Workbench_Sketcher.svg
}}


</translate>
[[File:EqualConstraint7.png|256px]]
{{Sketcher_Tools_navi{{#translation:}}}}

{{Userdocnavi{{#translation:}}}}
Select the line segment and the arc

[[File:EqualConstraint8.png|256px]]

and apply the Constrain Equal [[File:Constraint_EqualLength.png|16px]] constraint as before. A pop-up message indicates that the constrained items have to be of the same geometrical type (lines of zero curvature or lines of non-zero curvature).

[[File:EqualConstraint9.png|256px]]


{{languages | {{es|Constraint_EqualLength/es}} }}

Revision as of 07:51, 19 April 2024

This documentation is a work in progress. Please don't mark it as translatable since it will change in the next hours and days.

Sketcher ConstrainEqual

Menu location
Sketch → Sketcher constraints → Constrain equal
Workbenches
Sketcher
Default shortcut
E
Introduced in version
-
See also
None

Description

The Sketcher ConstrainEqual tool constrains edges to have an equal length (lines) or curvature (other edges except B-splines). Selected edges must have the same type. Circles and circular arcs are of the same type (their radii are made equal), and so are ellipses and elliptical arcs (their major and minor radii are made equal).

Usage

See also: Drawing aids.

Continue mode

  1. Make sure there is no selection.
  2. There are several ways to invoke the tool:
    • Press the Constrain equal button.
    • Select the Sketch → Sketcher constraints → Constrain equal option from the menu.
    • introduced in version 0.22: Right-click in the 3D view and select the Constrain → Constrain equal option from the context menu.
    • Use the keyboard shortcut: E.
  3. The cursor changes to a cross with the tool icon.
  4. Select two edges of the same type.
  5. A constraint is added.
  6. Optionally keep creating constraints.
  7. To finish, right-click or press Esc, or start another geometry or constraint creation tool.

Run-once mode

  1. Select two or more edges of the same type.
  2. Invoke the tool as explained above, or with the following additional option:
  3. Depending on the selection one or more constraints are added.

Scripting

Sketch.addConstraint(Sketcher.Constraint('Equal', Edge1, Edge2))

The Sketcher scripting page explains the values which can be used for Edge1 and Edge2 and contains further examples on how to create constraints from Python scripts.