Sketcher ConstrainTangent/ru: Difference between revisions

From FreeCAD Documentation
(Created page with "==Описание== Ограничение касательности делает две кривые касающимися друг друга. Линии полагают...")
(Updating to match new version of source page)
 
(64 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages/>
<languages/>

{{Docnav/ru|
{{Docnav/ru
[[Sketcher_ConstrainPerpendicular/ru|Perpendicular]]|
|[[Sketcher_ConstrainPerpendicular/ru|Ограничение перпендикулярности]]
[[Sketcher_ConstrainEqual/ru|Equal Length]]|
|[[Sketcher_ConstrainEqual/ru|Ограничение эквивалентностью]]
[[Sketcher_Workbench/ru|Sketcher]]|
|[[Sketcher_Workbench/ru|Sketcher]]
IconL=Constraint_Perpendicular.png|IconC=Workbench_Sketcher.svg|IconR=Constraint_EqualLength.png
|IconL=Sketcher_ConstrainPerpendicular.svg
|IconR=Sketcher_ConstrainEqual.svg
|IconC=Workbench_Sketcher.svg
}}
}}


<div class="mw-translate-fuzzy">
{{GuiCommand/ru
{{GuiCommand/ru
|Name/ru=Ограничение касательности
|Name=Sketcher ConstrainTangent
|Name=Sketcher_ConstrainTangent
|Name/ru=Sketcher ConstrainTangent
|Workbenches=[[Sketcher Workbench/ru|Sketcher]]
|MenuLocation=Sketch → Ограничения эскиза → Ограничение касательности
|MenuLocation=Sketch → Ограничения эскиза → Ограничение касательности
|Workbenches=[[Sketcher_Workbench/ru|Sketcher]]
|Shortcut=T
|Shortcut={{KEY|T}}
|SeeAlso=[[Sketcher ConstrainPointOnObject/ru|Constraint point on object]]
|SeeAlso=[[Sketcher_ConstrainPointOnObject/ru|Зафиксировать точку на объекте]]
}}
}}
</div>


<span id="Description"></span>
==Описание==
==Описание==
Ограничение касательности делает две кривые касающимися друг друга. Линии полагаются бесконечными, а дуги как полные окружности или эллипсы. Ограничение так же может соединять две кривые, заставляя их идти по касательной в точке соединения, делая переход гладким.


<div class="mw-translate-fuzzy">
==How to use==
Ограничение касательности делает две кривые касающимися друг друга. Линии полагаются бесконечными, а дуги как полные окружности или эллипсы. Ограничение также может соединять две кривые, заставляя их идти по касательной в точке соединения, делая переход гладким.
There are four different ways the constraint can be applied:
</div>
# between two curves (available not for all curves)
# between two endpoints of a curve, making a smooth joint
# between a curve and an endpoint of another curve
# between two curves at user-defined point


<span id="Usage"></span>
To apply tangent constraint, one should the follow the steps:
==Применение==
* Select two or three entities in the sketch.
* Invoke the constraint by clicking its icon on the toolbar, or selecting the menu item, or using keyboard shortcut.


See also: [[Sketcher_Workbench#Drawing_aids|Drawing aids]].
===Between two curves (direct tangency)===

===[[Sketcher_Workbench#Continue_modes|Continue mode]]===

# Make sure there is no selection.
# There are several ways to invoke the tool:
#* Press the {{Button|[[Image:Sketcher_ConstrainTangent.svg|16px]] [[Sketcher_ConstrainTangent|Constrain tangent or collinear]]}} button.
#* Select the {{MenuCommand|Sketch → Sketcher constraints → [[Image:Sketcher_ConstrainTangent.svg|16px]] Constrain tangent or collinear}} option from the menu.
#* {{Version|1.0}}: Right-click in the [[3D_view|3D view]] and select the {{MenuCommand|Constrain → [[Image:Sketcher_ConstrainTangent.svg|16px]] Constrain tangent or collinear}} option from the context menu.
#* Use the keyboard shortcut: {{KEY|T}}.
# The cursor changes to a cross with the tool icon.
# Do one of the following:
#* Select two edges. The edges can be any edge except a B-spline.
#* Select a point and two edges (in that order).
#* Select an edge, a point and another edge (idem).
# A Tangent constraint is added. If a point and two edges have been selected, up to two [[Sketcher_ConstrainPointOnObject|Point on object constraints]] can also be added. See [[#Between_two_edges_at_point|Examples]].
# Optionally keep creating constraints.
# To finish, right-click or press {{KEY|Esc}}, or start another geometry or constraint creation tool.

===Run-once mode===

# Do one of the following:
#* Select two edges (see above).
#* Select two endpoints belonging to different edges.
#* Select an edge and the endpoint of another edge (in any order).
#* Select a point and two edges (idem).
# Invoke the tool as explained above, or with the following additional option:
#* {{Version|1.0}}: Right-click in the [[3D_view|3D view]] and select the {{MenuCommand|[[Image:Sketcher_ConstrainTangent.svg|16px]] Constrain tangent or collinear}} option from the context menu.
# A Tangent constraint is added. If a point and two edges have been selected, up to two [[Sketcher_ConstrainPointOnObject|Point on object constraints]] can also be added. See [[#Between_two_edges_at_point|Examples]].

==Examples==

<span id="Between_two_edges"></span>
<div class="mw-translate-fuzzy">
===Между двумя кривыми (прямое касание)===
[[Image:Sketcher ConsraintTangent mode1.png|600px]]
[[Image:Sketcher ConsraintTangent mode1.png|600px]]
</div>


[[Image:Sketcher_ConsraintTangent_mode1.png|400px]]
Two curves will be made tangent, and the point of tangency will be implicit. This mode is applied if two curves were selected.


The two edges are made tangent. If one of the edges is a [[Sketcher_Workbench#Sketcher_CompCreateConic|conic]], a [[Sketcher_CreatePoint|Point object]] that has a [[Sketcher_ConstrainPointOnObject|Point on object constraint]] with both (extended) edges is added.
'''Accepted selection:'''
* line + line, circle, arc, ellipse, arc-of-ellipse
* circle, arc + circle, arc
If direct tangency between selected curves is not supported (e.g. between a circle and an ellipse), a helper point will be added to sketch automatically, and tangency-via-point will be applied.


<div class="mw-translate-fuzzy">
It is not recommended to reconstruct the point of tangency by creating a point and constraining it to lie on both curves. It will work, but the convergence will be seriously slower, jumpier, and will require about twice as many iterations to converge than normal. Use other modes of this constraint if the point of tangency is needed.
Не рекомендуется реконструировать точку касания созданием точки и установкой принадлежности её обоим кривым. Это будет работать, но конвергенция будет значительно медленнее, сложнее, и потребует вдвое больше итераций чем в норме. Используйте другие режимы этого ограничения, если нужна точка касания.
</div>


<span id="Between_two_endpoints"></span>
===Between two endpoints (point-to-point tangency)===
<div class="mw-translate-fuzzy">
===Между двумя конечными точками (касание точка-к-точке)===
[[Image:Sketcher ConsraintTangent mode2.png|600px]]
[[Image:Sketcher ConsraintTangent mode2.png|600px]]
</div>


[[Image:Sketcher_ConsraintTangent_mode2.png|400px]]
In this mode, the endpoints are made coincident, and the joint is made tangent (C1-smooth, or "sharp", depending on the placement of curves before the constraint is applied). This mode is applied when two endpoints of two curves were selected.


The endpoints are made coincident, and the angle between the edges at that point is set to 180° (smooth joint) or 0° (sharp joint), depending on the placement of the edges before the constraint is applied.
'''Accepted selection:'''
* endpoint of line/arc/arc-of-ellipse + endpoint of line/arc/arc-of-ellipse (i.e., two endpoints of any two curves)


<span id="Between_edge_and_endpoint"></span>
===Between curve and endpoint (point-to-curve tangency)===
<div class="mw-translate-fuzzy">
===Между кривой и конечной точкой (касательная точки к кривой)===
[[Image:Sketcher ConsraintTangent mode3.png|600px]]
[[Image:Sketcher ConsraintTangent mode3.png|600px]]
</div>


[[Image:Sketcher_ConsraintTangent_mode3.png|400px]]
In this mode, an endpoint of one curve is constrained to lie on the other curve, and the curves are forced tangent at the point. This mode is applied when a curve and an endpoint of another curve were selected.


<div class="mw-translate-fuzzy">
'''Accepted selection:'''
В этом режиме конечная точка одной кривой ограничивается лежать на другой кривой так, чтобы обе кривые были касательными в этой точке. Этот режим применяется, когда выделены кривая и конечная точка другой кривой.
* line, circle, arc, ellipse, arc-of-ellipse + endpoint of line/arc/arc-of-ellipse (i.e., any curve + endpoint of any curve)
</div>


<span id="Between_two_edges_at_point"></span>

<div class="mw-translate-fuzzy">
===Between two curves at point (tangent-via-point) (v0.15)===
===Между двумя кривыми в точке (касательная через точку) (v0.15)===
[[Image:Sketcher ConsraintTangent mode4.png|600px]]
[[Image:Sketcher ConsraintTangent mode4.png|600px]]
</div>


[[Image:Sketcher_ConsraintTangent_mode4.png|400px]]
In this mode, two curves are made tangent, and the point of tangency is tracked. This mode is applied when two curves and a point were selected.


<div class="mw-translate-fuzzy">
'''Accepted selection:'''
В этом режиме две кривые делаются касательными и отслеживается точка касания. Этот режим применяется, когда выделены две кривые и точка.
* any line/curve + any line/curve + any point
</div>
"Any point" can be a lone point, or a point of something, e.g. a center of a circle, an endpoint of an arc, or the origin.


<div class="mw-translate-fuzzy">
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 curves will be forced tangent at the point. These [[Sketcher helper constraint|helper constraints]] are plain regular constraints. They can be added manually, or deleted.
В сравнении с прямой касательностью, это ограничение медленнее, поскольку привлекается большее число степеней свободы, но если нужна точка касания, это рекомендованный режим, поскольку он предлагает лучшую сходимость в сравнении к прямому касанию + точке на двух кривых.
</div>


<span id="Between_two_lines"></span>
Compared to direct tangency, this constraint is slower, because there are more degrees of freedom involved, but if the point of tangency is needed, it is the recommended mode because it offers better convergence compared to direct tangency + point on two curves.
<div class="mw-translate-fuzzy">
===Между двумя линиями (коллинеарно)===
</div>


[[Image:Sketcher_ConstraintTangent_mode5.png|400px]]
The placement of the point before the constraint is applied is a hint for the solver for where the tangency should be. With this constraint, one can constrain two ellipses to touch each other in two places.


The two lines are made collinear.
==Scripting==


<span id="Scripting"></span>
Tangent Constraint can be created from [[macros]] and from the python console by using the following:
==Программирование==

Ограничение касательности может создаваться из [[Macros/ru|макросов]] и из консоли [[Python/ru|Python]] следующим образом:
{{Code|code=
{{Code|code=
# direct tangency
# direct tangency
Line 90: Line 141:
Sketch.addConstraint(Sketcher.Constraint('TangentViaPoint',icurve1,icurve2,geoidpoint,pointpos))
Sketch.addConstraint(Sketcher.Constraint('TangentViaPoint',icurve1,icurve2,geoidpoint,pointpos))
}}
}}
Где:
where:
:* <tt>Sketch</tt> is a sketch object
:* {{incode|Sketch}} это объект эскиза
:* {{incode|icurve1}}, {{incode|icurve2}} это два целых идентификатора кривых, которые станут касательными. Целые это индексы в эскизе (значения, возвращаемые {{incode|Sketch.addGeometry}}).
:* <tt>icurve1, icurve2</tt> are two integers identifying the curves to be made tangent. The integers are indexes in the sketch (the value, returned by Sketch.addGeometry).
:* <tt>pointpos1, pointpos2</tt> should be 1 for start point and 2 for end point.
:* {{incode|pointpos1}}, {{incode|pointpos2}} должны быть 1 для начальной и 2 для конечной точки.
:* <tt>geoidpoint</tt> and <tt>pointpos</tt> in TangentViaPoint are the indexes specifying the point of tangency.
:* {{incode|geoidpoint}} и {{incode|pointpos}} в {{incode|TangentViaPoint}} это индексы, указывающие точку касания.


На странице [[Sketcher_scripting/ru|Программирование в Sketcher]] объясняются значения, которые можно использовать для {{incode|incurve1}}, {{incode|incurve2}}, {{incode|pointpos1}}, {{incode|pointpos2}}, {{incode|geoidpoint}} и {{incode|pointpos}} а также содержатся дополнительные примеры того, как создавать ограничения из сценариев Python.
{{Docnav|[[Sketcher_ConstrainPerpendicular|Perpendicular]]|[[Sketcher_ConstrainEqual|Equal Length]]|[[Sketcher_Workbench|Sketcher]]|IconL=Constraint_Perpendicular.png|IconC=Workbench_Sketcher.svg|IconR=Constraint_EqualLength.png}}


{{Sketcher Tools navi}}


{{Docnav/ru
{{Userdocnavi}}
|[[Sketcher_ConstrainPerpendicular/ru|Ограничение перпендикулярности]]
|[[Sketcher_ConstrainEqual/ru|Ограничение эквивалентностью]]
|[[Sketcher_Workbench/ru|Sketcher]]
|IconL=Sketcher_ConstrainPerpendicular.svg
|IconR=Sketcher_ConstrainEqual.svg
|IconC=Workbench_Sketcher.svg
}}


{{Sketcher_Tools_navi{{#translation:}}}}
{{clear}}
{{Userdocnavi{{#translation:}}}}

Latest revision as of 15:01, 23 April 2024

Ограничение касательности

Системное название
Sketcher_ConstrainTangent
Расположение в меню
Sketch → Ограничения эскиза → Ограничение касательности
Верстаки
Sketcher
Быстрые клавиши
T
Представлено в версии
-
См. также
Зафиксировать точку на объекте

Описание

Ограничение касательности делает две кривые касающимися друг друга. Линии полагаются бесконечными, а дуги как полные окружности или эллипсы. Ограничение также может соединять две кривые, заставляя их идти по касательной в точке соединения, делая переход гладким.

Применение

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 tangent or collinear button.
    • Select the Sketch → Sketcher constraints → Constrain tangent or collinear option from the menu.
    • introduced in version 1.0: Right-click in the 3D view and select the Constrain → Constrain tangent or collinear option from the context menu.
    • Use the keyboard shortcut: T.
  3. The cursor changes to a cross with the tool icon.
  4. Do one of the following:
    • Select two edges. The edges can be any edge except a B-spline.
    • Select a point and two edges (in that order).
    • Select an edge, a point and another edge (idem).
  5. A Tangent constraint is added. If a point and two edges have been selected, up to two Point on object constraints can also be added. See Examples.
  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. Do one of the following:
    • Select two edges (see above).
    • Select two endpoints belonging to different edges.
    • Select an edge and the endpoint of another edge (in any order).
    • Select a point and two edges (idem).
  2. Invoke the tool as explained above, or with the following additional option:
  3. A Tangent constraint is added. If a point and two edges have been selected, up to two Point on object constraints can also be added. See Examples.

Examples

Между двумя кривыми (прямое касание)

The two edges are made tangent. If one of the edges is a conic, a Point object that has a Point on object constraint with both (extended) edges is added.

Не рекомендуется реконструировать точку касания созданием точки и установкой принадлежности её обоим кривым. Это будет работать, но конвергенция будет значительно медленнее, сложнее, и потребует вдвое больше итераций чем в норме. Используйте другие режимы этого ограничения, если нужна точка касания.

Между двумя конечными точками (касание точка-к-точке)

The endpoints are made coincident, and the angle between the edges at that point is set to 180° (smooth joint) or 0° (sharp joint), depending on the placement of the edges before the constraint is applied.

Между кривой и конечной точкой (касательная точки к кривой)

В этом режиме конечная точка одной кривой ограничивается лежать на другой кривой так, чтобы обе кривые были касательными в этой точке. Этот режим применяется, когда выделены кривая и конечная точка другой кривой.

Между двумя кривыми в точке (касательная через точку) (v0.15)

В этом режиме две кривые делаются касательными и отслеживается точка касания. Этот режим применяется, когда выделены две кривые и точка.

В сравнении с прямой касательностью, это ограничение медленнее, поскольку привлекается большее число степеней свободы, но если нужна точка касания, это рекомендованный режим, поскольку он предлагает лучшую сходимость в сравнении к прямому касанию + точке на двух кривых.

Между двумя линиями (коллинеарно)

The two lines are made collinear.

Программирование

Ограничение касательности может создаваться из макросов и из консоли Python следующим образом:

# direct tangency
Sketch.addConstraint(Sketcher.Constraint('Tangent',icurve1,icurve2))

# point-to-point tangency
Sketch.addConstraint(Sketcher.Constraint('Tangent',icurve1,pointpos1,icurve2,pointpos2))

# point-to-curve tangency
Sketch.addConstraint(Sketcher.Constraint('Tangent',icurve1,pointpos1,icurve2))

# tangent-via-point (plain constraint, helpers are not added automatically)
Sketch.addConstraint(Sketcher.Constraint('TangentViaPoint',icurve1,icurve2,geoidpoint,pointpos))

Где:

  • Sketch это объект эскиза
  • icurve1, icurve2 это два целых идентификатора кривых, которые станут касательными. Целые это индексы в эскизе (значения, возвращаемые Sketch.addGeometry).
  • pointpos1, pointpos2 должны быть 1 для начальной и 2 для конечной точки.
  • geoidpoint и pointpos в TangentViaPoint это индексы, указывающие точку касания.

На странице Программирование в Sketcher объясняются значения, которые можно использовать для incurve1, incurve2, pointpos1, pointpos2, geoidpoint и pointpos а также содержатся дополнительные примеры того, как создавать ограничения из сценариев Python.