Draft Rotate/cs: Difference between revisions

From FreeCAD Documentation
(Created page with "Kreslení Otočit")
 
(Updating to match new version of source page)
 
(34 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
{{GuiCommand|Name=Draft Rotate|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]|MenuLocation=Draft -> Rotate|Shortcut=R O}}


{{Docnav
==Description==
|[[Draft_Move|Move]]
|[[Draft_Scale|Scale]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Move.svg
|IconR=Draft_Scale.svg
|IconC=Workbench_Draft.svg
}}


<div class="mw-translate-fuzzy">
This tool rotates or copies the selected objects by a given angle around a point on the current [[Draft Workingplane|work plane]]. If no object is selected, you will be invited to select one.
{{GuiCommand/cs|Name=Draft Rotate|Name/cs=Kreslení Otočit|Workbenches=[[Draft_Workbench/cs|Kreslení]], [[Arch_Workbench/cs|Architektura]]|MenuLocation=Kreslení → Otočit|Shortcut=R O}}
</div>

<span id="Description"></span>
==Popis==

<div class="mw-translate-fuzzy">
Nástroj Otočit otáčí nebo kopíruje vybrané objekty o zadaný úhel kolem bodu v aktuální [[Draft SelectPlane/cs|pracovní rovině]]. Není-li vybrán žádný objekt, budete vyzváni k výběru objektu.
</div>

The command can be used on 2D objects created with the [[Draft_Workbench|Draft Workbench]] or [[Sketcher_Workbench|Sketcher Workbench]], but also on many 3D objects such as those created with the [[Part_Workbench|Part Workbench]], [[PartDesign_Workbench|PartDesign Workbench]] or [[Arch_Workbench|Arch Workbench]].


[[Image:Draft_Rotate_example.jpg|400px]]
[[Image:Draft_Rotate_example.jpg|400px]]
{{Caption|Rotating an object around a center point}}


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


See also: [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]].
# Select objects you wish to rotate or copy
# Press the {{KEY|[[Image:Draft Rotate.png|16px]] [[Draft Rotate]]}} button, or press {{KEY|R}} then {{KEY|O}} keys
# Click a center point on the 3D view, or type a [[Draft_Coordinates|coordinate]]
# Click a second point on the 3D view, or give a reference angle
# Click a third point on the 3D view, or give a rotation angle


<div class="mw-translate-fuzzy">
==Options==
# Vyberte objekt, který chcete otočit nebo zkopírovat
# Stiskněte tlačítko {{KEY|[[Image:Draft Rotate.png|16px]] [[Draft Rotate/cs|Kreslení Otočit]]}} nebo klávesy {{KEY|R}} potom {{KEY|O}}
# Klikněte na střed ve 3D pohledu nebo zadejte souřadnice
# Klikněte na druhý bod ve 3D pohledu nebo zadejte referenční úhel
# Klikněte na třetí bod ve 3D pohledu nebo zadejte úhel otočení
</div>


<span id="Options"></span>
* Press {{KEY|X}}, {{KEY|Y}} or {{KEY|Z}} after a point to constrain the next point on the given axis.
==Volby==
* To enter coordinates manually, simply enter the numbers, then press {{KEY|ENTER}} between each X, Y and Z component.

* Press {{KEY|T}} or click the checkbox to check/uncheck the {{KEY|'''Continue'''}} button. If continue mode is on, the Rotate tool will restart after you finish or close it, allowing you to rotate or copy the objects another time without pressing the Rotate button again.
The single character keyboard shortcuts available in the task panel can be changed. See [[Draft_Preferences|Draft Preferences]]. The shortcuts mentioned here are the default shortcuts (for version 0.22).
* Pressing {{KEY|ALT}} or {{KEY|C}} or clicking the {{KEY|'''Copy'''}} button will make a copy of the objects, instead of rotating them. If you keep {{KEY|ALT}} pressed after clicking the third point, you will be able to place more copies, until you release the {{KEY|ALT}} key.

* Press {{KEY|CTRL}} while drawing to force [[Draft_Snap|snapping]] your point to the nearest snap location, independently of the distance.
<div class="mw-translate-fuzzy">
* Press {{KEY|SHIFT}} while drawing to [[Draft_Constrain|constrain]] your next point horizontally or vertically in relation to the rotation center.
* Stiskněte klávesu {{KEY|X}}, {{KEY|Y}} nebo {{KEY|Z}} po prvním bodu pokud chcete uplatnit vazbu dalšího bodu v příslušné ose.
* Press {{KEY|ESC}} or the {{KEY|'''Cancel'''}} button to abort the current command.
* Chcete-li zadat souřadnice ručně jednoduše zadejte číslo a potom stiskněte {{KEY|ENTER}} mezi každou z komponent X, Y a Z.
* Stiskněte klávesu {{KEY|T}} nebo zaklikněte/odklikněte políčko {{KEY|'''Pokračovat'''}}. Je-li nastaven pokračovací mód, bude nástroj Otočit hned po ukončení připraven k otočení nebo kopírování bez nutnosti stisknout znovu tlačítko Otočit.
* Stisknutí klávesy {{KEY|ALT}} nebo {{KEY|C}} nebo kliknutí na tlačítko {{KEY|'''Kopie'''}} vytvoří kopii objektu místo jeho otočení. Podržíte-li stisknutou klávesu {{KEY|ALT}} po kliknutí na druhý bod, budete moci umístit několik kopií, až dokud neuvolníte klávesu {{KEY|ALT}}.
* Stisknutím klávesy {{KEY|CTRL}} během kreslení vynutíte [[Draft_Snap/cs|přichycení]] vašeho bodu k nejbližšímu uchopovacímu místu nezávisle na vzálenosti od něho.
*Stisknutím klávesy {{KEY|SHIFT}} během kreslení [[Draft_Constrain/cs|nastavíte vazbu]] vašeho bodu svisle nebo vodorovně v relaci předchozímu bodu.
* Stisknutím tlačítka {{KEY|ESC}} nebo {{KEY|'''Zrušit'''}} zrušíte právě probíhající příkaz.
</div>

==Notes==

* An Object that is [[Part_EditAttachment|attached]] cannot be rotated with the Draft Rotate command. To rotate it either its {{PropertyData|Support}} object has to be rotated, or its {{PropertyData|Attachment Offset}} has to be changed.
* The base angle concept can be somewhat confusing. Especially since it works only when selecting points, not when specifying the angle using the input field. An explanation of how it works, with an example, can be found in [https://forum.freecad.org/viewtopic.php?p=736674#p736674 this forum thread].

==Preferences==

See also: [[Preferences_Editor|Preferences Editor]] and [[Draft_Preferences|Draft Preferences]].

* To reselect the base objects after copying objects: {{MenuCommand|Edit → Preferences... → Draft → General → Select base objects after copying}}.


==Scripting==
==Scripting==


<div class="mw-translate-fuzzy">
The Rotate tool can by used in [[macros]] and from the python console by using the following function:
==Skriptování==
</div>


<div class="mw-translate-fuzzy">
<syntaxhighlight>
Nástroj Otočit může být využit v [[macros/cs|makrech]] a z konzoly Pythonu použitím následující funkce:
rotate (FreeCAD.Object or list, angle, [center], [axis] ,[copymode])
</div>
</syntaxhighlight>
* Rotates the given object or the objects contained in the given list with the given angle around the given center if provided, using axis as a rotation axis.
* If axis is omitted, the rotation will be around the vertical Z axis.
* If copymode is True, the actual objects are not moved, but copies are created instead.
* Returns the objects (or their copies is copymode was True).


{{Code|code=
Example:
rotated_list = rotate(objectslist, angle, center=Vector(0,0,0), axis=Vector(0,0,1), copy=False)
}}


<div class="mw-translate-fuzzy">
<syntaxhighlight>
* Otočí zadaný objekt nebo objekty obsažené v zadaném seznamum (list) o daný úhel (angle) kolem středu (je-li zadán) s použitím osy jako osy rotace.
import FreeCAD,Draft
* Chybí-li osa (axis), bude otočení provedeno podle svislé osy Z.
Draft.rotate(FreeCAD.ActiveDocument.ActiveObject,45)
* Je-li copymode True, aktuální objekty se nepohnou, ale místo toho jsou vytvořeny jejich kopie.
</syntaxhighlight>
* Vrací objekty (nebo jejich kopie, pokud bylo copymode True).
</div>


Příklad:
<languages/>

{{Code|code=
import FreeCAD as App
import Draft

doc = App.newDocument()

polygon1 = Draft.make_polygon(3, radius=300)
Draft.move(polygon1, App.Vector(1000, 0, 0))

# Rotation around the origin
angle1 = 45
rot2 = Draft.rotate(polygon1, angle1, copy=True)
rot3 = Draft.rotate(polygon1, 2*angle1, copy=True)
rot4 = Draft.rotate(polygon1, 4*angle1, copy=True)

polygon2 = Draft.make_polygon(3, radius=1000)
polygon3 = Draft.make_polygon(5, radius=500)
Draft.move(polygon2, App.Vector(2000, 0, 0))
Draft.move(polygon3, App.Vector(2000, 0, 0))

# Rotation around another point
angle2 = 60
cen = App.Vector(3100, 0, 0)
list2 = [polygon2, polygon3]
rot_list2 = Draft.rotate(list2, angle2, center=cen, copy=True)
rot_list3 = Draft.rotate(list2, 2*angle2, center=cen, copy=True)
rot_list4 = Draft.rotate(list2, 4*angle2, center=cen, copy=True)

doc.recompute()
}}


{{Docnav
|[[Draft_Move|Move]]
|[[Draft_Scale|Scale]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Move.svg
|IconR=Draft_Scale.svg
|IconC=Workbench_Draft.svg
}}

{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

Latest revision as of 17:30, 26 February 2024

Kreslení Otočit

Umístění Menu
Kreslení → Otočit
Pracovní stoly
Kreslení, Architektura
Výchozí zástupce
R O
Představen ve verzi
-
Viz také
Nikdo

Popis

Nástroj Otočit otáčí nebo kopíruje vybrané objekty o zadaný úhel kolem bodu v aktuální pracovní rovině. Není-li vybrán žádný objekt, budete vyzváni k výběru objektu.

The command can be used on 2D objects created with the Draft Workbench or Sketcher Workbench, but also on many 3D objects such as those created with the Part Workbench, PartDesign Workbench or Arch Workbench.

Rotating an object around a center point

Použití

See also: Draft Snap and Draft Constrain.

  1. Vyberte objekt, který chcete otočit nebo zkopírovat
  2. Stiskněte tlačítko Kreslení Otočit nebo klávesy R potom O
  3. Klikněte na střed ve 3D pohledu nebo zadejte souřadnice
  4. Klikněte na druhý bod ve 3D pohledu nebo zadejte referenční úhel
  5. Klikněte na třetí bod ve 3D pohledu nebo zadejte úhel otočení

Volby

The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts (for version 0.22).

  • Stiskněte klávesu X, Y nebo Z po prvním bodu pokud chcete uplatnit vazbu dalšího bodu v příslušné ose.
  • Chcete-li zadat souřadnice ručně jednoduše zadejte číslo a potom stiskněte ENTER mezi každou z komponent X, Y a Z.
  • Stiskněte klávesu T nebo zaklikněte/odklikněte políčko Pokračovat. Je-li nastaven pokračovací mód, bude nástroj Otočit hned po ukončení připraven k otočení nebo kopírování bez nutnosti stisknout znovu tlačítko Otočit.
  • Stisknutí klávesy ALT nebo C nebo kliknutí na tlačítko Kopie vytvoří kopii objektu místo jeho otočení. Podržíte-li stisknutou klávesu ALT po kliknutí na druhý bod, budete moci umístit několik kopií, až dokud neuvolníte klávesu ALT.
  • Stisknutím klávesy CTRL během kreslení vynutíte přichycení vašeho bodu k nejbližšímu uchopovacímu místu nezávisle na vzálenosti od něho.
  • Stisknutím klávesy SHIFT během kreslení nastavíte vazbu vašeho bodu svisle nebo vodorovně v relaci předchozímu bodu.
  • Stisknutím tlačítka ESC nebo Zrušit zrušíte právě probíhající příkaz.

Notes

  • An Object that is attached cannot be rotated with the Draft Rotate command. To rotate it either its ÚdajeSupport object has to be rotated, or its ÚdajeAttachment Offset has to be changed.
  • The base angle concept can be somewhat confusing. Especially since it works only when selecting points, not when specifying the angle using the input field. An explanation of how it works, with an example, can be found in this forum thread.

Preferences

See also: Preferences Editor and Draft Preferences.

  • To reselect the base objects after copying objects: Edit → Preferences... → Draft → General → Select base objects after copying.

Scripting

Skriptování

Nástroj Otočit může být využit v makrech a z konzoly Pythonu použitím následující funkce:

rotated_list = rotate(objectslist, angle, center=Vector(0,0,0), axis=Vector(0,0,1), copy=False)
  • Otočí zadaný objekt nebo objekty obsažené v zadaném seznamum (list) o daný úhel (angle) kolem středu (je-li zadán) s použitím osy jako osy rotace.
  • Chybí-li osa (axis), bude otočení provedeno podle svislé osy Z.
  • Je-li copymode True, aktuální objekty se nepohnou, ale místo toho jsou vytvořeny jejich kopie.
  • Vrací objekty (nebo jejich kopie, pokud bylo copymode True).

Příklad:

import FreeCAD as App
import Draft

doc = App.newDocument()

polygon1 = Draft.make_polygon(3, radius=300)
Draft.move(polygon1, App.Vector(1000, 0, 0))

# Rotation around the origin
angle1 = 45
rot2 = Draft.rotate(polygon1, angle1, copy=True)
rot3 = Draft.rotate(polygon1, 2*angle1, copy=True)
rot4 = Draft.rotate(polygon1, 4*angle1, copy=True)

polygon2 = Draft.make_polygon(3, radius=1000)
polygon3 = Draft.make_polygon(5, radius=500)
Draft.move(polygon2, App.Vector(2000, 0, 0))
Draft.move(polygon3, App.Vector(2000, 0, 0))

# Rotation around another point
angle2 = 60
cen = App.Vector(3100, 0, 0)
list2 = [polygon2, polygon3]
rot_list2 = Draft.rotate(list2, angle2, center=cen, copy=True)
rot_list3 = Draft.rotate(list2, 2*angle2, center=cen, copy=True)
rot_list4 = Draft.rotate(list2, 4*angle2, center=cen, copy=True)

doc.recompute()