Sketcher ConstrainAngle: Difference between revisions

From FreeCAD Documentation
(initial editing stages - lots of edits!)
 
(Marked this version for translation)
(34 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<languages/>
{{GuiCommand|Name=Constraint_InternalAngle|Workbenches=[[Sketcher Workbench|Sketcher]], [[PartDesign Module|PartDesign_Workbench]]|MenuLocation=Sketcher → Constrain angle|SeeAlso=[[Constraint distance]], [[Constraint perpendicular]]}}
<translate>
<!--T:25-->
{{Docnav
|[[Sketcher_ConstrainRadius|Radius]]
|[[Sketcher ConstrainSnellsLaw|Snell's Law]]
|[[Sketcher_Workbench|Sketcher]]
|IconL=Constraint_Radius.svg
|IconC=Workbench_Sketcher.svg
|IconR=Constraint_SnellsLaw.svg
}}


<!--T:1-->
====Description====
{{GuiCommand
|Name=Constraint InternalAngle
|Workbenches=[[Sketcher Workbench|Sketcher]]
|Shortcut={{KEY|A}}
|MenuLocation=Sketch → Sketcher constraints → Constrain angle
|SeeAlso=[[Sketcher ConstrainDistance|Constrain distance]], [[Sketcher ConstrainPerpendicular|Constraint Perpendicular]]
}}


==Description== <!--T:4-->
<WRONG> This tool draws an arc by picking three points: the center, the start angle along the radius, and the end angle.
Angle constraint is a [[Sketcher_Workbench#Sketcher Constraints|datum constraint]] intended to fix angles in sketch. It is capable of setting slopes of individual lines, angles between lines, angles of intersections of curves, and angle spans of circular arcs.


==Usage== <!--T:5-->
When starting the tool, the mouse pointer changes to a white cross with a red arc icon. The coordinates of the pointer are shown beside it in blue in real time.


<!--T:29-->
[[Image:Sketcher_ArcExample1.png|The center has been selected, dragging to set the radius‎]] [[Image:Sketcher_ArcExample2.png|407x360px|The center and start angle have been selected, dragging to set end angle‎]] </WRONG>
There are four different ways the constraint can be applied:
* to individual lines
* between lines
* to intersections of curves
* to arcs of circles


<!--T:6-->
====Usage====
To apply angle constraint, one should the follow the steps:
# Select one, two or three entities in the sketch. The mode will be chosen depending on the selection.
# Invoke the constraint using several methods:
#* Pressing the {{Button|[[Image:Constraint_InternalAngle.svg|16px]]}} button in the toolbar.
#* Using the {{KEY|A}} keyboard shortcut. ('''A''' is for '''A'''ngle)
#* Using the {{MenuCommand|Sketch → Sketcher constraints → Constrain angle}} form the top menu entry
# A datum edit dialog box pops up.
# Modify the angle if necessary. '''Note:''' The angle can be entered as an expression that will be evaluated and the result will be stored.
# Click {{KEY|OK}}


<!--T:7-->
<WRONG> * Pick points on an empty area of the 3D view, or on an existing object (auto constraints must be active in TaskView).
As with any datum constraint, it is possible to change the angle value later by double-clicking the constraint in constraint list or 3d view. Entering a negative value will cause the angle direction to flip.
* Pressing {{KEY|ESC}} or clicking the right mouse button cancels the function. </WRONG>


==Constraint modes== <!--T:8-->
===line slope angle===
'''Accepted selection:''' line


<!--T:9-->
{{languages | {{es|Sketcher_Arc/es}} }}
[[Image:Sketcher ConsraintAngle mode1.png|600px]]

<!--T:10-->
The constraint sets the polar angle of line's direction. It is the angle between the line and X axis of the sketch.

===arc span (v0.15)=== <!--T:11-->
'''Accepted selection:''' arc of circle

<!--T:12-->
[[Image:Sketcher ConsraintAngle mode2.png|600px]]

<!--T:13-->
In this mode, the constraint fixes angular span of a circular arc.

===between lines=== <!--T:14-->
'''Accepted selection:''' line + line

<!--T:15-->
[[Image:Sketcher ConsraintAngle mode3.png|600px]]

<!--T:16-->
In this mode, the constraint sets the angle between two lines. It is not required that the lines intersect.

===between curves at intersection (angle-via-point) (v0.15)=== <!--T:17-->
'''Accepted selection:''' any line/curve + any line/curve + any point

<!--T:18-->
[[Image:Sketcher ConsraintAngle mode4.png|600px]]

<!--T:19-->
In this mode, angle between two curves is constrained at the point of their intersection. The intersection point can be on curves' extensions. The point should be specified explicitly, since curves typically intersect in more than one point.

<!--T:20-->
For the constraint to work correctly, the point must be on both curves. So, as the constraint is invoked, the point will be automatically constrained onto both curves ([[Sketcher helper constraint|helper constraints]] will be added, if necessary), and the angle between curves will be constrained at the point. These [[Sketcher helper constraint|helper constraints]] are plain regular constraints. They can be added manually, or deleted. There are no helper constraints on the example picture above, because the point selected is already the intersection of curves.

==Scripting== <!--T:21-->

<!--T:22-->
Angle Constraint can be created from [[macros]] and from the python console by using the following:
</translate>
{{Code|code=
# line slope angle
Sketch.addConstraint(Sketcher.Constraint('Angle',iline,angle))

# angular span of arc
Sketch.addConstraint(Sketcher.Constraint('Angle',iarc,angle))

# angle between lines
Sketch.addConstraint(Sketcher.Constraint('Angle',iline1,pointpos1,iline2,pointpos2,angle))

# angle-via-point (no helper constraints are added automatically when from python)
Sketch.addConstraint(Sketcher.Constraint('AngleViaPoint',icurve1,icurve2,geoidpoint,pointpos,angle))
}}
<translate>
<!--T:23-->
where:
:* {{incode|Sketch}} is a sketch object
:* {{incode|iline, iline1, iline2}} are integers specifying the lines by their ordinal numbers in {{incode|Sketch}}.
:* {{incode|pointpos1, pointpos2}} should be 1 for start point and 2 for end point. The choice of endpoints allows to set internal angle (or external), and it affects how the constraint is drawn on the screen.
:* {{incode|geoidpoint}} and {{incode|pointpos}} in {{incode|AngleViaPoint}} are the indexes specifying the point of intersection.
:* {{incode|angle}} is the angle value in radians. The angle is counted between tangent vectors in counterclockwise direction. Tangent vectors are pointing from start to end for the lines (or vice versa if ending point is supplied in angle between lines mode), and along counterclockwise direction for circles, arcs and ellipses. Quantity is also accepted as an angle (e.g. {{incode|App.Units.Quantity('45 deg')}})


<!--T:26-->
{{Docnav
|[[Sketcher_ConstrainRadius|Radius]]
|[[Sketcher ConstrainSnellsLaw|Snell's Law]]
|[[Sketcher_Workbench|Sketcher]]
|IconL=Constraint_Radius.svg
|IconC=Workbench_Sketcher.svg
|IconR=Constraint_SnellsLaw.svg
}}

<!--T:27-->
{{Sketcher Tools navi}}

<!--T:28-->
{{Userdocnavi}}

</translate>
{{clear}}

Revision as of 18:15, 14 February 2020

Constraint InternalAngle

Menu location
Sketch → Sketcher constraints → Constrain angle
Workbenches
Sketcher
Default shortcut
A
Introduced in version
-
See also
Constrain distance, Constraint Perpendicular

Description

Angle constraint is a datum constraint intended to fix angles in sketch. It is capable of setting slopes of individual lines, angles between lines, angles of intersections of curves, and angle spans of circular arcs.

Usage

There are four different ways the constraint can be applied:

  • to individual lines
  • between lines
  • to intersections of curves
  • to arcs of circles

To apply angle constraint, one should the follow the steps:

  1. Select one, two or three entities in the sketch. The mode will be chosen depending on the selection.
  2. Invoke the constraint using several methods:
    • Pressing the button in the toolbar.
    • Using the A keyboard shortcut. (A is for Angle)
    • Using the Sketch → Sketcher constraints → Constrain angle form the top menu entry
  3. A datum edit dialog box pops up.
  4. Modify the angle if necessary. Note: The angle can be entered as an expression that will be evaluated and the result will be stored.
  5. Click OK

As with any datum constraint, it is possible to change the angle value later by double-clicking the constraint in constraint list or 3d view. Entering a negative value will cause the angle direction to flip.

Constraint modes

line slope angle

Accepted selection: line

The constraint sets the polar angle of line's direction. It is the angle between the line and X axis of the sketch.

arc span (v0.15)

Accepted selection: arc of circle

In this mode, the constraint fixes angular span of a circular arc.

between lines

Accepted selection: line + line

In this mode, the constraint sets the angle between two lines. It is not required that the lines intersect.

between curves at intersection (angle-via-point) (v0.15)

Accepted selection: any line/curve + any line/curve + any point

In this mode, angle between two curves is constrained at the point of their intersection. The intersection point can be on curves' extensions. The point should be specified explicitly, since curves typically intersect in more than one point.

For the constraint to work correctly, the point must be on both curves. So, as the constraint is invoked, the point will be automatically constrained onto both curves (helper constraints will be added, if necessary), and the angle between curves will be constrained at the point. These helper constraints are plain regular constraints. They can be added manually, or deleted. There are no helper constraints on the example picture above, because the point selected is already the intersection of curves.

Scripting

Angle Constraint can be created from macros and from the python console by using the following:

# line slope angle
Sketch.addConstraint(Sketcher.Constraint('Angle',iline,angle))

# angular span of arc
Sketch.addConstraint(Sketcher.Constraint('Angle',iarc,angle))

# angle between lines
Sketch.addConstraint(Sketcher.Constraint('Angle',iline1,pointpos1,iline2,pointpos2,angle))

# angle-via-point (no helper constraints are added automatically when from python)
Sketch.addConstraint(Sketcher.Constraint('AngleViaPoint',icurve1,icurve2,geoidpoint,pointpos,angle))

where:

  • Sketch is a sketch object
  • iline, iline1, iline2 are integers specifying the lines by their ordinal numbers in Sketch.
  • pointpos1, pointpos2 should be 1 for start point and 2 for end point. The choice of endpoints allows to set internal angle (or external), and it affects how the constraint is drawn on the screen.
  • geoidpoint and pointpos in AngleViaPoint are the indexes specifying the point of intersection.
  • angle is the angle value in radians. The angle is counted between tangent vectors in counterclockwise direction. Tangent vectors are pointing from start to end for the lines (or vice versa if ending point is supplied in angle between lines mode), and along counterclockwise direction for circles, arcs and ellipses. Quantity is also accepted as an angle (e.g. App.Units.Quantity('45 deg'))