Sketcher ConstrainAngle/cs: Difference between revisions

From FreeCAD Documentation
No edit summary
(Updating to match new version of source page)
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
{{GuiCommand|Name=Constraint InternalAngle|Workbenches=[[Sketcher Workbench|Sketcher]], [[PartDesign Workbench|PartDesign]]|Shortcut=A|MenuLocation=Sketch → Sketcher constraints → Constrain angle|SeeAlso=[[Constraint Length]], [[Constraint Perpendicular]]}}
{{Docnav
|[[Sketcher_ConstrainDiameter|Constraint Diameter]]
|[[Sketcher ConstrainSnellsLaw|Snell's Law]]
|[[Sketcher_Workbench|Sketcher]]
|IconL=Sketcher ConstrainDiameter.svg
|IconC=Workbench_Sketcher.svg
|IconR=Constraint_SnellsLaw.svg
}}


<div class="mw-translate-fuzzy">
====Popis====
{{GuiCommand/cs|Name=Constraint InternalAngle|Name/cs=Constraint InternalAngle|Workbenches=[[Sketcher Workbench/cs|Sketcher]], [[PartDesign Workbench/cs|PartDesign]]|Shortcut=A|MenuLocation=Sketch → Sketcher constraints → Constrain angle|SeeAlso=[[Constraint Length/cs|Constraint Length]], [[Constraint Perpendicular/cs|Constraint Perpendicular]]}}
Tento nástroj nastavi vazbu mezi dvěma vybranými přímkami v náčrtu tak aby měly zadaný úhel. Obecně se dělá vazba na vnitřní úhel, t.j. na menší z úhlů, které jsou vytvořeny protínajícími se přímkami (nebo jejich prodloužením).<br />
</div>
Je-li vybrána pouze jedna přímka je vazba nastavena relativně k vodorovné ose roviny vybraného náčrtu.


====Postup====
==Description==
Vyberte jednu nebo dvě přímky v náčrtu tak, že na ně postupně kliknete. Jejich barva se změní na tmavězelenou. Směr přímky od počátečního ke koncovému bodu je významný pro výpočet úhlu mezi přímkami.<br /><br />
[[File:ConstrainAngle1.png|256px|<span title="Selected lines"></span>]]<br /><br />
Potom klikněte na ikonu Vazba úhlu ([[Image:Constraint_InternalAngle.png|16px]]) v pracovní ploše Náčrt nebo Návrh dílu nebo vyberte položku Vazba úhlu ze submenu Vazby náčrtu z menu pracovní plochy Náčrt nebo Návrh Dílu a přidejte vazbu. <br /><br />
Vazba je nejprve nastavena na aktuální vnitřní úhel mezi přímkami a je přidána do záložky úloh (Tasks) v rozbalovacím pohledovém panelu.<br /><br />
[[File:ConstrainAngle2.png|256px|<span title="Constraint applied"></span>]]<br /><br />
Dvojklikem na záložku úloh (Tasks) vyvoláte dialogové okno, ve kterém může být hodnota upravena na požadovanou velikost. Alternativně lze vyvolat dialogové okno pro nastavení hodnoty i dvojklikem na textovu hodnotu v 3D pohledu.<br /><br />
[[File:ConstrainAngle3.png|256px|<span title="Editing value"></span>]]<br /><br />
[[File:ConstrainAngle4.png|256px|<span title="Constraint applied"></span>]]<br /><br />
Hodnota může být nastavena na hodnoty větší než 180 (dokonce i větší než 360). V takovém případě se úhel stává vnějším a je interpretován jako modulo 360 stupňů.<br /><br />
Absolutní mód je vyvolán pouze výběrem jedné přímky před aplikací této vazby.<br /><br />
[[File:ConstrainAngle5.png|256px|<span title="Constraint applied"></span>]]<br /><br />
Aplikováním vazby je úhel nastaven relativně k horizontální ose vybrané roviny náčrtu.<br /><br />
[[File:ConstrainAngle6.png|256px|<span title="Constraint applied"></span>]]<br /><br />
Výběrem druhé přímky, která byla nakreslena zprava nahoře vlevo dolu.<br /><br />
[[File:ConstrainAngle7.png|256px|<span title="Constraint applied"></span>]]<br /><br />
A aplikováním vazby jako předešle,<br /><br />
[[File:ConstrainAngle8.png|256px|<span title="Constraint applied"></span>]]<br /><br />
je přímka nyní vazbena tak, aby měla hodnotu relativní ke směru horizontální osy ve směru hodinových ručiček (hodnotu úhlů jsou omezeny na 180 stupňů proti směru hodinových ručiček).<br /><br />
Stejně jako předtím dvojklik na vazbu buď v záložce úloh (Tasks) rozbalovacího pohledu nebo na vazbu ve 3D pohledu umožní editaci hodnoty vazbeného úhlu.


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.
<languages/>

==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:
# 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|[[File:Sketcher_ConstrainAngle.svg|16px]] [[Sketcher_ConstrainAngle|Constrain angle]]}} button in the toolbar.
#* Using the {{KEY|A}} keyboard shortcut. ('''A''' is for '''A'''ngle)
#* Using the {{MenuCommand|Sketch → Sketcher constraints → [[File:Sketcher_ConstrainAngle.svg|16px]] 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 {{Button|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

[[Image:Sketcher ConsraintAngle mode1.png|600px]]

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

[[Image:Sketcher ConsraintAngle mode2.png|600px]]

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

===Between lines===

'''Accepted selection:''' line + line

[[Image:Sketcher ConsraintAngle mode3.png|600px]]

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

[[Image:Sketcher ConsraintAngle mode4.png|600px]]

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 ([[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==

Angle Constraint can be created from [[macros]] and from the python console by using the following:
{{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))
}}
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')}})

{{Docnav
|[[Sketcher_ConstrainDiameter|Constraint Diameter]]
|[[Sketcher ConstrainSnellsLaw|Snell's Law]]
|[[Sketcher_Workbench|Sketcher]]
|IconL=Sketcher ConstrainDiameter.svg
|IconC=Workbench_Sketcher.svg
|IconR=Constraint_SnellsLaw.svg
}}

{{Sketcher Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Revision as of 21:23, 27 September 2020

Constraint InternalAngle

Umístění Menu
Sketch → Sketcher constraints → Constrain angle
Pracovní stoly
Sketcher, PartDesign
Výchozí zástupce
A
Představen ve verzi
-
Viz také
Constraint Length, 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 Constrain angle 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'))