Sketcher ConstrainCoincident/pl: Difference between revisions

From FreeCAD Documentation
No edit summary
(Updating to match new version of source page)
Line 10: Line 10:
}}
}}


<div class="mw-translate-fuzzy">
{{GuiCommand/pl
{{GuiCommand/pl
|Name/pl=Wiązanie spójności punktów
|Name/pl=Wiązanie spójności punktów
Line 17: Line 18:
|SeeAlso=[[Sketcher_ConstrainLock/pl|Constraint Lock]], [[Sketcher ConstrainPointOnObject/pl|Constraint Point onto Object]]
|SeeAlso=[[Sketcher_ConstrainLock/pl|Constraint Lock]], [[Sketcher ConstrainPointOnObject/pl|Constraint Point onto Object]]
}}
}}
</div>


==Opis==
==Opis==
Line 44: Line 46:
== Alternatives to Coincident constraint ==
== Alternatives to Coincident constraint ==


The two constrained items of a [[Sketcher ConstrainCoincident|Coincident]] constraint must be start point or end point vertices, or center points of arcs, circles or ellipses. Some combinations which are not possible with a coincident constraint can be emulated using other constraints:
The two constrained items of a [[Sketcher_ConstrainCoincident|Coincident]] constraint must be start point or end point vertices, or center points of arcs, circles or ellipses. Some combinations which are not possible with a coincident constraint can be emulated using other constraints:
* The [[File:Sketcher_ConstrainSymmetric.svg|24px]] [[Sketcher ConstrainSymmetric|Symmetric]] constraint can be used to place a start point, end point or center point on the midpoint of a straight line.
* The [[File:Sketcher_ConstrainSymmetric.svg|24px]] [[Sketcher_ConstrainSymmetric|Symmetric]] constraint can be used to place a start point, end point or center point on the midpoint of a straight line.
* A midpoint-to-midpoint placement of two straight lines can be achieved by creating a new [[File:Sketcher_CreatePoint.svg|24px]] [[Sketcher CreatePoint|Point]] and using two [[File:Sketcher_ConstrainSymmetric.svg|24px]] [[Sketcher ConstrainSymmetric|Symmetric]] constraints so that it lies on the midpoint of both lines.
* A midpoint-to-midpoint placement of two straight lines can be achieved by creating a new [[File:Sketcher_CreatePoint.svg|24px]] [[Sketcher_CreatePoint|Point]] and using two [[File:Sketcher_ConstrainSymmetric.svg|24px]] [[Sketcher_ConstrainSymmetric|Symmetric]] constraints so that it lies on the midpoint of both lines.
* A vertex can be constrained to lie along an edge using a [[File:Sketcher_ConstrainPointOnObject.svg|24px]][[Sketcher ConstrainPointOnObject|PointOnObject]] constraint. Note that with this constraint, the point can lie anywhere on the full extension of a segment or curve (i.e. also before the start point or beyond the end point).
* A vertex can be constrained to lie along an edge using a [[File:Sketcher_ConstrainPointOnObject.svg|24px]][[Sketcher_ConstrainPointOnObject|PointOnObject]] constraint. Note that with this constraint, the point can lie anywhere on the full extension of a segment or curve (i.e. also before the start point or beyond the end point).
* A collinear placement of two straight lines can be obtained by applying a [[File:Sketcher_ConstrainTangent.svg|24px]] [[Sketcher ConstrainTangent|Tangent]] constraint to them, or by combining a [[File:Sketcher_ConstrainPointOnObject.svg|24px]] [[Sketcher ConstrainPointOnObject|PointOnObject]] constraint and a [[File:Sketcher_ConstrainParallel.svg|24px]] [[Sketcher ConstrainParallel|Parallel]] constraint.
* A collinear placement of two straight lines can be obtained by applying a [[File:Sketcher_ConstrainTangent.svg|24px]] [[Sketcher_ConstrainTangent|Tangent]] constraint to them, or by combining a [[File:Sketcher_ConstrainPointOnObject.svg|24px]] [[Sketcher_ConstrainPointOnObject|PointOnObject]] constraint and a [[File:Sketcher_ConstrainParallel.svg|24px]] [[Sketcher_ConstrainParallel|Parallel]] constraint.
* Two edges can be made identical by using two [[File:Sketcher_ConstrainCoincident.svg|24px]] [[Sketcher ConstrainCoincident|Coincident]] constraints, one for each pair of extremities.
* Two edges can be made identical by using two [[File:Sketcher_ConstrainCoincident.svg|24px]] [[Sketcher_ConstrainCoincident|Coincident]] constraints, one for each pair of extremities.
* Two circles can be made identical by using a [[File:Sketcher_ConstrainCoincident.svg|24px]] [[Sketcher ConstrainCoincident|Coincident]] constraint to merge the centers, and applying an [[File:Sketcher_ConstrainEqual.svg|24px]] [[Sketcher ConstrainEqual|Equal]] constraint to their edges. For arcs, this will ensure both arcs are part of the same circle, while allowing them to have different start and end points.
* Two circles can be made identical by using a [[File:Sketcher_ConstrainCoincident.svg|24px]] [[Sketcher_ConstrainCoincident|Coincident]] constraint to merge the centers, and applying an [[File:Sketcher_ConstrainEqual.svg|24px]] [[Sketcher_ConstrainEqual|Equal]] constraint to their edges. For arcs, this will ensure both arcs are part of the same circle, while allowing them to have different start and end points.


===Ogólne zasady tworzenia skryptów===
===Ogólne zasady tworzenia skryptów===


<div class="mw-translate-fuzzy">
Wiązanie może być utworzone zarówno przez makrodefinicje jak i z konsoli Python za pomocą następującego polecenia:
Wiązanie może być utworzone zarówno przez makrodefinicje jak i z konsoli Python za pomocą następującego polecenia:
</div>


{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Coincident',LineFixed,PointOfLineFixed,LineMoving,PointOfLineMoving)) }}
{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Coincident',LineFixed,PointOfLineFixed,LineMoving,PointOfLineMoving)) }}

Revision as of 15:43, 24 January 2021

Wiązanie spójności punktów

Lokalizacja w menu
Sketch → Wiązania szkicownika → Wiązanie zgodności
Środowisko pracy
Sketcher
Domyślny skrót
C
Wprowadzono w wersji
-
Zobacz także
Constraint Lock, Constraint Point onto Object

Opis

Stwórz wiązanie zbieżności z wybraną pozycją.

Narzędzie to przyjmuje dwa punkty jako swój argument i służy do nadania tym dwóm punktom "zbieżności". (To znaczy, że są one tylko jednym punktem).

W praktyce narzędzie to jest użyteczne w przypadku przerwania profilu, na przykład gdy dwie linie kończą się blisko siebie i muszą zostać połączone - wiązanie zbieżności w punkcie końcowym doprowadzi do zlikwidowania tej przerwy.

Użycie

Jak stwierdzono powyżej, narzędzie to przyjmuje dwa argumenty - oba są punktami.

  1. Po pierwsze, konieczne jest zaznaczenie dwóch różnych punktów. (Uwaga: to nie zadziała, jeżeli na przykład spróbujemy wybrać punkt początkowy i punkt końcowy tej samej linii prostej. Wybranie punktów początkowych i końcowych łuku spowoduje utworzenie zamkniętego okręgu lub elipsy, ale ograniczy położenie szwu do tego punktu).
  2. Podświetlenie elementu rysunku uzyskuje się poprzez umieszczenie na nim kursora myszki i kliknięcie lewym przyciskiem myszy.
  3. Możliwe jest również zaznaczenie wszystkich elementów wewnątrz prostokąta poprzez kliknięcie i przeciągnięcie. Przy przeciąganiu od lewej do prawej (z dowolnym ruchem pionowym) zostaną podświetlone tylko kształty, które w całości mieszczą się w prostokącie; w drugim kierunku zostaną podświetlone wszystkie kształty, które przecinają się z prostokątem zaznaczenia. Można to wykorzystać do zaznaczenia tylko wierzchołków bez zaznaczania krawędzi, przeciągając mały prostokąt wokół niektórych wierzchołków od lewej do prawej, o ile nie ma krawędzi, które w całości mieszczą się w prostokącie.
  4. Podświetlony element zmieni swój kolor na zielony. (Kolor ten można dostosować do własnych potrzeb w Edycja → Preferencje → Wyświetlanie → Kolory → Zaznaczanie).
  5. Kolejne punkty mogą być podświetlone poprzez powtórzenie powyższych procedur. Uwaga" Nie trzeba przytrzymywać żadnego specjalnego klawisza, jak Ctrl aby uzyskać wielokrotny wybór pozycji na rysunku.
  6. Po podświetleniu dwóch punktów, można wywołać komendę za pomocą kilku metod:
    • Wciskając przycisk wiązania na pasku przyborów Wiązanie zbieżności.
    • Użycie skrótu klawiszy C przy pomocy klawiatury.
    • Użycie polecenia w górnym menu Szkicownik → Wiązania szkicownika → Wiązanie zbieżności.

Wynik: polecenie to spowoduje, że dwa punkty staną się nałożone na siebie i zostaną zastąpione jednym punktem.

Uwaga: Aby uczynić dwa punkty zbieżnymi, FreeCAD musi z konieczności przenieść jeden (lub oba) z oryginalnych pozycji.

Alternatives to Coincident constraint

The two constrained items of a Coincident constraint must be start point or end point vertices, or center points of arcs, circles or ellipses. Some combinations which are not possible with a coincident constraint can be emulated using other constraints:

  • The Symmetric constraint can be used to place a start point, end point or center point on the midpoint of a straight line.
  • A midpoint-to-midpoint placement of two straight lines can be achieved by creating a new Point and using two Symmetric constraints so that it lies on the midpoint of both lines.
  • A vertex can be constrained to lie along an edge using a PointOnObject constraint. Note that with this constraint, the point can lie anywhere on the full extension of a segment or curve (i.e. also before the start point or beyond the end point).
  • A collinear placement of two straight lines can be obtained by applying a Tangent constraint to them, or by combining a PointOnObject constraint and a Parallel constraint.
  • Two edges can be made identical by using two Coincident constraints, one for each pair of extremities.
  • Two circles can be made identical by using a Coincident constraint to merge the centers, and applying an Equal constraint to their edges. For arcs, this will ensure both arcs are part of the same circle, while allowing them to have different start and end points.

Ogólne zasady tworzenia skryptów

Wiązanie może być utworzone zarówno przez makrodefinicje jak i z konsoli Python za pomocą następującego polecenia:

Sketch.addConstraint(Sketcher.Constraint('Coincident',LineFixed,PointOfLineFixed,LineMoving,PointOfLineMoving))

gdzie:

  • Sketch jest obiektem szkicu,
  • LineFixed to numer linii, która nie przesunie się po zastosowaniu wiązania,
  • PointOfLineFixed wskazuje, który wierzchołek LineFixed musi spełniać warunek wiązania,
  • LineMoving to numer linii, która ulegnie przesunięciu przez zastosowanie wiązania,
  • PointOfLineMoving wskazuje, który wierzchołek LineMoving, musi spełniać warunek wiązania,

As the names LineFixed and LineMoving indicate, if both constrained vertices are free to move in any direction, the first one (first to be selected in the Gui) will remain fixed and the other one will move. In the presence of existing constraints, however, both edges may move.

The Sketcher scripting page explains the values which can be used for LineFixed, PointOfLineFixed, LineMoving and PointOfLineMoving, and contains further examples on how to create constraints from Python scripts.