Sketcher ConstrainDistance/cs: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 30: Line 30:
[[Image:Sketcher_ConstrainDistance_example.png]]
[[Image:Sketcher_ConstrainDistance_example.png]]


<span id="Usage"></span>
<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
==Použití==
==Použití==
</div>
</div>


# Pick two points or one line or one point and one line.
# Pick one line, or one point and one line, or two points, or the edges of two circles.
# Invoke the command several ways:
# There are several ways to invoke the command:
#* Press the {{Button|[[File:Sketcher_ConstrainDistance.svg|16px]] [[Sketcher_ConstrainDistance|Constrain distance]]}} button in the Sketcher toolbar.
#* Press the {{Button|[[File:Sketcher_ConstrainDistance.svg|16px]] [[Sketcher_ConstrainDistance|Constrain distance]]}} button in the Sketcher toolbar.
#* Use the {{KEY|K}} then {{KEY|D}} keyboard shortcut.
#* Use the {{KEY|K}} then {{KEY|D}} keyboard shortcut.
Line 54: Line 55:
Distance from origin:
Distance from origin:


{{Code|code=Sketch.addConstraint(Sketcher.Constraint('DistanceX', Edge, PointOfEdge, App.Units.Quantity('123.0 mm')))}}
{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Distance', Edge, PointOfEdge, -1, 1, App.Units.Quantity('123.0 mm')))}}


Distance between two vertices:
Distance between two vertices:
Line 64: Line 65:
{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Distance', Line, 1, Line, 2, App.Units.Quantity('123.0 mm')))}}
{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Distance', Line, 1, Line, 2, App.Units.Quantity('123.0 mm')))}}


Distance from point ({{incode|Edge, PointOfEdge}}) to nearest point on line ({{incode|Line}}):
Distance from point ({{incode|Edge, PointOfEdge}}) to perpendicular point on line ({{incode|Line}}):


{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Distance', Edge, PointOfEdge, Line, App.Units.Quantity('123.0 mm')))}}
{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Distance', Edge, PointOfEdge, Line, 0, App.Units.Quantity('123.0 mm')))}}


Distance between the edges of two circles:
The [[Sketcher_scripting|Sketcher scripting]] page explains the values which can be used for {{incode|Edge1}}, {{incode|Edge2}}, {{incode|Edge}}, {{incode|PointOfEdge1}}, {{incode|PointOfEdge2}}, {{incode|PointOfEdge}} and {{incode|Line}}, and contains further examples on how to create constraints from Python scripts.

{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Distance', Circle1, 0, Circle2, 0, App.Units.Quantity('123.0 mm')))}}

The [[Sketcher_scripting|Sketcher scripting]] page explains the values which can be used for {{incode|Edge}}, {{incode|Edge1}}, {{incode|Edge2}}, {{incode|PointOfEdge}}, {{incode|PointOfEdge1}}, {{incode|PointOfEdge2}}, {{incode|Line}}, {{incode|Circle1}} and {{incode|Circle2}}, and contains further examples on how to create constraints from Python scripts.





Revision as of 19:54, 5 April 2023

Constraint Length

Umístění Menu
Sketch → Vazby náčrtu → Vazba vzdálenosti
Pracovní stoly
Sketcher
Výchozí zástupce
Shift + D
Představen ve verzi
-
Viz také
Constrain horizontal distance, Constrain vertical distance

Description

Popis

Vazba Délka nastavuje délku přímky, kolmou vzdálenost mezi bodem a přímkou nebo vzdálenost mezi dvěma body.

Použití

  1. Pick one line, or one point and one line, or two points, or the edges of two circles.
  2. There are several ways to invoke the command:
    • Press the Constrain distance button in the Sketcher toolbar.
    • Use the K then D keyboard shortcut.
    • Use the Sketch → Sketcher constraints → Constrain distance entry from the top menu.
  3. A pop up dialog opens to edit or confirm the value. Press OK to validate.

Note: the constraint tool can also be started with no prior selection. To set the perpendicular distance between a point and a line, the point needs to be selected first. By default the command will be in continue mode to create new constraints; press the right mouse button or Esc once to quit the command.

Hint

Rada

Pokud uvažujete o její aplikaci, zamyslete se raději nad použitím vazeb Horizontální vzdálenost nebo vertikální vzdálenost. Tyto vazby jsou robustnější a mají rychlejší výpočet než zde popisovaná vazba Délka.

Scripting

Distance from origin:

Sketch.addConstraint(Sketcher.Constraint('Distance', Edge, PointOfEdge, -1, 1, App.Units.Quantity('123.0 mm')))

Distance between two vertices:

Sketch.addConstraint(Sketcher.Constraint('Distance', Edge1, PointOfEdge1, Edge2, PointOfEdge2, App.Units.Quantity('123.0 mm')))

Length of line (the GUI allows selecting the edge itself, but it is just a shorthand for using the two extremities of the same line):

Sketch.addConstraint(Sketcher.Constraint('Distance', Line, 1, Line, 2, App.Units.Quantity('123.0 mm')))

Distance from point (Edge, PointOfEdge) to perpendicular point on line (Line):

Sketch.addConstraint(Sketcher.Constraint('Distance', Edge, PointOfEdge, Line, 0, App.Units.Quantity('123.0 mm')))

Distance between the edges of two circles:

Sketch.addConstraint(Sketcher.Constraint('Distance', Circle1, 0, Circle2, 0, App.Units.Quantity('123.0 mm')))

The Sketcher scripting page explains the values which can be used for Edge, Edge1, Edge2, PointOfEdge, PointOfEdge1, PointOfEdge2, Line, Circle1 and Circle2, and contains further examples on how to create constraints from Python scripts.