Draft Rotate/ru: Difference between revisions

From FreeCAD Documentation
(Created page with "{{GuiCommand/ru |Name=Draft Rotate |Name/ru=Draft Rotate |Workbenches=Draft, Arch |MenuLocation=Черчение -> Повернуть |...")
 
(Updating to match new version of source page)
 
(33 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>

{{Docnav/ru
|[[Draft_Move/ru|Переместить]]
|[[Draft_Scale/ru|Масштаб]]
|[[Draft_Workbench/ru|Верстак Draft]]
|IconL=Draft_Move.svg
|IconR=Draft_Scale.svg
|IconC=Workbench_Draft.svg
}}

{{GuiCommand/ru
{{GuiCommand/ru
|Name=Draft Rotate
|Name/ru=Повернуть
|Name/ru=Draft Rotate
|Name=Draft_Rotate
|MenuLocation=Модификация → Повернуть
|Workbenches=[[Draft Module/ru|Draft]], [[Arch Module/ru|Arch]]
|Workbenches=[[Draft_Workbench/ru|Draft]], [[Arch_Workbench/ru|Arch]]
|MenuLocation=Черчение -> Повернуть
|Shortcut=R O
|Shortcut={{KEY|R}} {{KEY|O}}
|Version=0.7
|SeeAlso=[[Draft_SubelementHighlight/ru|Draft SubelementHighlight]]
}}
}}


==Description==
<span id="Description"></span>
==Описание==


This tool rotates or copies the selected objects by a given angle around a point on the current [[Draft SelectPlane|work plane]]. If no object is selected, you will be invited to select one.
The [[Image:Draft_Rotate.svg|24px]] '''Draft Rotate''' command rotates or copies selected objects around a center point by a given angle. The axis of rotation is perpendicular to the current [[Draft_SelectPlane|working plane]] and the rotation angle is relative to that plane. In subelement mode the command rotates selected points and edges, or copies selected edges, of [[Draft_Line|Draft Lines]] and [[Draft_Wire|Draft Wires]].

Команду можно использовать на 2D-объектах, созданных в [[Draft_Workbench/ru|верстаке Draft]] или [[Sketcher_Workbench/ru|верстаке Sketcher]], а также на многих 3D-объектах, созданных с помощью [[Part_Workbench/ru|верстака Part]], [[PartDesign_Workbench/ru|верстака PartDesign]] и [[Arch_Workbench/ru|верстака Arch]].


[[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==
==Применение==


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
# Optionally select one or more objects, or one or more subelements of [[Draft_Line|Draft Lines]] or [[Draft_Wire|Draft Wires]].
# Click a center point on the 3D view, or type a [[Draft_Coordinates|coordinate]]
# There are several ways to invoke the command:
# Click a second point on the 3D view, or give a reference angle
#* Press the {{Button|[[Image:Draft_Rotate.svg|16px]] [[Draft_Rotate|Rotate]]}} button.
# Click a third point on the 3D view, or give a rotation angle
#* Select the {{MenuCommand|Modification → [[Image:Draft_Rotate.svg|16px]] Rotate}} option from the menu.
#* Use the keyboard shortcut: {{KEY|R}} then {{KEY|O}}.
# If you have not yet selected an object: select an object in the [[3D_view|3D view]].
# The {{MenuCommand|Rotate}} task panel opens. See [[#Options|Options]] for more information.
# If subelements have been selected: check the {{MenuCommand|Modify subelements}} checkbox to switch on subelement mode.
# Pick the first point, the center of rotation, in the [[3D_view|3D view]], or type coordinates and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button.
# Pick the second point in the [[3D_view|3D view]], or enter a {{MenuCommand|Base angle}}.
# Pick the third point in the [[3D_view|3D view]], or enter a {{MenuCommand|Rotation}}.


==Options==
==Options==


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).
* Press {{KEY|X}}, {{KEY|Y}} or {{KEY|Z}} after a point to constrain the next point on the given axis.
* 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.
* 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.
* Press {{KEY|SHIFT}} while drawing to [[Draft_Constrain|constrain]] your next point horizontally or vertically in relation to the rotation center.
* Press {{KEY|ESC}} or the {{KEY|'''Cancel'''}} button to abort the current command.


* To manually enter the coordinates for the center of rotation enter the X, Y and Z component, and press {{KEY|Enter}} after each. Or you can press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button when you have the desired values. It is advisable to move the pointer out of the [[3D_view|3D view]] before entering coordinates.
==Scripting==
* Press {{KEY|G}} or click the {{MenuCommand|Global}} checkbox to toggle global mode. If global mode is on, coordinates are relative to the global coordinate system, else they are relative to the [[Draft_SelectPlane|working plane]] coordinate system. {{Version|0.20}}
* Press {{KEY|N}} or click the {{MenuCommand|Continue}} checkbox to toggle continue mode. If continue mode is on, the command will restart after finishing. This mode really only makes sense if copy mode is switched on. Depending on the {{MenuCommand|Select base objects after copying}} preference, either the original objects are selected for the next command call or the copies that were created last. See [[#Preferences|Preferences]].
* Press {{KEY|C}} or click the {{MenuCommand|Copy}} checkbox to toggle copy mode. If copy mode is on, the command will create rotated copies instead of rotating the original objects.
* Press {{KEY|B}} or click the {{MenuCommand|Modify subelements}} checkbox to toggle subelement mode. If subelement mode is on, the command will use the selected subelements instead of the whole objects. The subelements must belong to [[Draft_Line|Draft Lines]] or [[Draft_Wire|Draft Wires]].
* If copy mode and subelement mode are both on, and edges of [[Draft_Wire|Draft Wires]] are selected, new wires will be created from those edges.
* Holding down {{KEY|Alt}} after entering the {{MenuCommand|Base angle}} will also toggle copy mode. While {{KEY|Alt}} is held down multiple points can be picked for the {{MenuCommand|Rotation}}. Release {{KEY|Alt}} to finish the command and see the created copies.
* Press {{KEY|S}} to switch [[Draft_Snap|Draft snapping]] on or off.
* Press {{KEY|Esc}} or the {{Button|Close}} button to abort the command.


<span id="Notes"></span>
The Rotate tool can by used in [[macros]] and from the python console by using the following function:
==Примечания==

* 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].

<span id="Preferences"></span>
==Настройки==

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}}.

<span id="Scripting"></span>
==Программирование==

See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].

To rotate objects use the {{incode|rotate}} method of the Draft module.


{{Code|code=
{{Code|code=
rotate (FreeCAD.Object or list, angle, [center], [axis] ,[copymode])
rotated_list = rotate(objectslist, angle, center=Vector(0,0,0), axis=Vector(0,0,1), copy=False)
}}
}}
* 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).


* {{incode|objectslist}} contains the objects to be rotated. It is either a single object or a list of objects.
Example:
* {{incode|angle}} is the angle of rotation in degrees.
* {{incode|center}} is the center point of rotation.
* {{incode|axis}} is the direction of the axis of rotation.
* If {{incode|copy}} is {{incode|True}} copies are created instead of rotating the original objects.
* {{incode|rotated_list}} is returned with the original rotated objects, or with the new copies. It is either a single object or a list of objects, depending on {{incode|objectlist}}.

Пример:


{{Code|code=
{{Code|code=
import FreeCAD,Draft
import FreeCAD as App
import Draft
Draft.rotate(FreeCAD.ActiveDocument.ActiveObject,45)

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()
}}
}}

<languages/>

{{Docnav/ru
|[[Draft_Move/ru|Переместить]]
|[[Draft_Scale/ru|Масштаб]]
|[[Draft_Workbench/ru|Верстак 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

Повернуть

Системное название
Draft_Rotate
Расположение в меню
Модификация → Повернуть
Верстаки
Draft, Arch
Быстрые клавиши
R O
Представлено в версии
0.7
См. также
Draft SubelementHighlight

Описание

The Draft Rotate command rotates or copies selected objects around a center point by a given angle. The axis of rotation is perpendicular to the current working plane and the rotation angle is relative to that plane. In subelement mode the command rotates selected points and edges, or copies selected edges, of Draft Lines and Draft Wires.

Команду можно использовать на 2D-объектах, созданных в верстаке Draft или верстаке Sketcher, а также на многих 3D-объектах, созданных с помощью верстака Part, верстака PartDesign и верстака Arch.

Rotating an object around a center point

Применение

See also: Draft Snap and Draft Constrain.

  1. Optionally select one or more objects, or one or more subelements of Draft Lines or Draft Wires.
  2. There are several ways to invoke the command:
    • Press the Rotate button.
    • Select the Modification → Rotate option from the menu.
    • Use the keyboard shortcut: R then O.
  3. If you have not yet selected an object: select an object in the 3D view.
  4. The Rotate task panel opens. See Options for more information.
  5. If subelements have been selected: check the Modify subelements checkbox to switch on subelement mode.
  6. Pick the first point, the center of rotation, in the 3D view, or type coordinates and press the Enter point button.
  7. Pick the second point in the 3D view, or enter a Base angle.
  8. Pick the third point in the 3D view, or enter a Rotation.

Options

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).

  • To manually enter the coordinates for the center of rotation enter the X, Y and Z component, and press Enter after each. Or you can press the Enter point button when you have the desired values. It is advisable to move the pointer out of the 3D view before entering coordinates.
  • Press G or click the Global checkbox to toggle global mode. If global mode is on, coordinates are relative to the global coordinate system, else they are relative to the working plane coordinate system. introduced in version 0.20
  • Press N or click the Continue checkbox to toggle continue mode. If continue mode is on, the command will restart after finishing. This mode really only makes sense if copy mode is switched on. Depending on the Select base objects after copying preference, either the original objects are selected for the next command call or the copies that were created last. See Preferences.
  • Press C or click the Copy checkbox to toggle copy mode. If copy mode is on, the command will create rotated copies instead of rotating the original objects.
  • Press B or click the Modify subelements checkbox to toggle subelement mode. If subelement mode is on, the command will use the selected subelements instead of the whole objects. The subelements must belong to Draft Lines or Draft Wires.
  • If copy mode and subelement mode are both on, and edges of Draft Wires are selected, new wires will be created from those edges.
  • Holding down Alt after entering the Base angle will also toggle copy mode. While Alt is held down multiple points can be picked for the Rotation. Release Alt to finish the command and see the created copies.
  • Press S to switch Draft snapping on or off.
  • Press Esc or the Close button to abort the command.

Примечания

  • An Object that is attached cannot be rotated with the Draft Rotate command. To rotate it either its ДанныеSupport object has to be rotated, or its Данные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 this forum thread.

Настройки

See also: Preferences Editor and Draft Preferences.

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

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

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

To rotate objects use the rotate method of the Draft module.

rotated_list = rotate(objectslist, angle, center=Vector(0,0,0), axis=Vector(0,0,1), copy=False)
  • objectslist contains the objects to be rotated. It is either a single object or a list of objects.
  • angle is the angle of rotation in degrees.
  • center is the center point of rotation.
  • axis is the direction of the axis of rotation.
  • If copy is True copies are created instead of rotating the original objects.
  • rotated_list is returned with the original rotated objects, or with the new copies. It is either a single object or a list of objects, depending on objectlist.

Пример:

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()