Draft Rotate/ro: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
<languages/>

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


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
{{GuiCommand/ro
{{GuiCommand/ro|Name=Draft Rotate|Name/ro=Draft Rotate|Workbenches=[[Draft Module/ro|Draft]], [[Arch Module/ro|Arch]]|MenuLocation=Draft → Rotate|Shortcut=R O}}
|Name=Draft Rotate
|Name/ro=Draft Rotate
|MenuLocation=Draft → Rotate
|Workbenches=[[Draft_Workbench/ro|Draft]], [[Arch_Workbench/ro|Arch]]
|Shortcut={{KEY|R}} {{KEY|O}}
}}
</div>
</div>


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


Line 19: Line 27:
</div>
</div>


The Rotate tool can be used on 2D shapes created with the [[Draft Workbench|Draft Workbench]] or [[Sketcher Workbench|Sketcher Workbench]], but can also be used on many types of 3D objects such as those created with the [[Part Workbench|Part Workbench]] or [[Arch Workbench|Arch Workbench]].
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]].

To move without rotation, use [[Draft Move]]. To produce various copies in different arrangements use [[Draft Array|Draft Array]], [[Draft PathArray|Draft PathArray]] and [[Draft PointArray|Draft PointArray]].


[[Image:Draft_Rotate_example.jpg|400px]]
[[Image:Draft_Rotate_example.jpg|400px]]
{{Caption|Rotating one object using a center reference point, from one reference angle to another angle}}
{{Caption|Rotating an object around a center point}}


<span id="Usage"></span>
<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
== Cum se folosește ==
== Cum se folosește ==
</div>
</div>

See also: [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]].


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
# Select objects you wish to rotate or copy
# 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
# 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 center point on the 3D view, or type a coordinate
# Click a second point on the 3D view, or give a reference angle
# 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
# Click a third point on the 3D view, or give a rotation angle
</div>
</div>


<span id="Options"></span>
===Limitations===
When rotating an object that is based on a [[Sketcher Sketch|Sketcher Sketch]], for example, a feature created with the [[PartDesign Workbench|PartDesign Workbench]] ([[PartDesign Pad|Pad]], [[PartDesign Revolution|Revolution]], etc.) you must move the original sketch. If you move the derived object, it will just go back to the position defined by the sketch.

== Opţiuni ==
== Opţiuni ==

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


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 52: Line 61:
* Press {{KEY|ESC}} or the {{KEY|'''Cancel'''}} button to abort the current command.
* Press {{KEY|ESC}} or the {{KEY|'''Cancel'''}} button to abort the current command.
</div>
</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==


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 62: Line 84:


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


Line 75: Line 97:


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


doc = App.newDocument()
Polygon1 = Draft.makePolygon(3, radius=500)
Draft.move(Polygon1, FreeCAD.Vector(1500, 0, 0))


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


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


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


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

doc.recompute()
}}
}}



{{Docnav
{{Docnav
|[[Draft_Move|Move]]
|[[Draft_Move|Move]]
|[[Draft_Offset|Offset]]
|[[Draft_Scale|Scale]]
|[[Draft_Module|Draft]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Move.svg
|IconL=Draft_Move.svg
|IconR=Draft_Offset.svg
|IconR=Draft_Scale.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
Line 113: Line 139:
{{Draft Tools navi{{#translation:}}}}
{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Latest revision as of 17:30, 26 February 2024

Draft Rotate

poziția meniului
Draft → Rotate
Ateliere
Draft, Arch
scurtătură
R O
Prezentat în versiune
-
A se vedea, de asemenea,
nici unul

Descriere

Acest instrument rotește sau copiază obiectele selectate cu un unghi dat în jurul unui punct de pe work plane curent. Dacă nu este selectat niciun obiect, veți fi invitat să selectați unul ..

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

Cum se folosește

See also: Draft Snap and Draft Constrain.

  1. Select objects you wish to rotate or copy
  2. Press the Draft Rotate button, or press R then O keys
  3. Click a center point on the 3D view, or type a coordinate
  4. Click a second point on the 3D view, or give a reference angle
  5. Click a third point on the 3D view, or give a rotation angle

Opţiuni

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

  • Press X, Y or Z after a point to constrain the next point on the given axis.
  • To enter coordinates manually, simply enter the numbers, then press ENTER between each X, Y and Z component.
  • Press T or click the checkbox to check/uncheck the 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 ALT or C or clicking the Copy button will make a copy of the objects, instead of rotating them. If you keep ALT pressed after clicking the third point, you will be able to place more copies, until you release the ALT key.
  • Press CTRL while drawing to force snapping your point to the nearest snap location, independently of the distance.
  • Press SHIFT while drawing to constrain your next point horizontally or vertically in relation to the rotation center.
  • Press ESC or the Cancel button to abort the current command.

Notes

  • An Object that is attached cannot be rotated with the Draft Rotate command. To rotate it either its DateSupport object has to be rotated, or its DateAttachment 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

Script

The Rotate tool can by used in macros and from the python console by using the following function:

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

Exempluː

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