Draft Rotate: Difference between revisions
Renatorivo (talk | contribs) mNo edit summary |
No edit summary |
||
(29 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
⚫ | |||
<translate> |
<translate> |
||
<!--T:17--> |
|||
{{Docnav |
|||
|[[Draft_Move|Move]] |
|||
|[[Draft_Offset|Offset]] |
|||
|[[Draft_Module|Draft]] |
|||
|IconL=Draft_Move.svg |
|||
|IconR=Draft_Offset.svg |
|||
|IconC=Workbench_Draft.svg |
|||
}} |
|||
<!--T:1--> |
<!--T:1--> |
||
{{GuiCommand |
|||
{{GuiCommand|Name=Draft Rotate|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]|MenuLocation=Draft -> Rotate|Shortcut=R O}} |
|||
|Name=Draft Rotate |
|||
|MenuLocation=Draft → Rotate |
|||
|Workbenches=[[Draft_Module|Draft]], [[Arch_Module|Arch]] |
|||
|Shortcut={{KEY|R}} {{KEY|O}} |
|||
|Version=0.7 |
|||
|SeeAlso=[[Draft_Move|Draft Move]], [[Draft_Array|Draft Array]] |
|||
}} |
|||
==Description== <!--T:2--> |
==Description== <!--T:2--> |
||
<!--T:3--> |
<!--T:3--> |
||
The Rotate tool rotates or copies the selected objects by a given angle around a reference point. |
|||
<!--T:13--> |
|||
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]]. |
|||
<!--T:14--> |
|||
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]]. |
|||
</translate> |
</translate> |
||
[[Image:Draft_Rotate_example.jpg|400px]] |
[[Image:Draft_Rotate_example.jpg|400px]] |
||
<translate> |
<translate> |
||
<!--T:15--> |
|||
{{Caption|Rotating one object using a center reference point, from one reference angle to another angle}} |
|||
== |
==Usage== <!--T:4--> |
||
<!--T:5--> |
<!--T:5--> |
||
# Select objects you wish to |
# Select the objects that you wish to move or copy. |
||
# Press the {{ |
# Press the {{Button|[[Image:Draft Rotate.svg|16px]] [[Draft Rotate]]}} button, or press {{KEY|R}} then {{KEY|O}} keys. If no object is selected, you will be invited to select one. |
||
# Click a |
# Click a first point on the [[3D view]], or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button. This serves as the base point of the operation, through which the axis of rotation will pass. |
||
# Click a second point on the 3D view, or |
# Click a second point on the [[3D view]], or type a base angle. This defines a baseline that will rotate around the first point. |
||
# Click a third point on the 3D view, or |
# Click a third point on the [[3D view]], or type a rotation angle. This indicates the rotation of the baseline, and thus the objects. |
||
===Limitations=== <!--T:12--> |
|||
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. |
|||
==Options== <!--T:6--> |
==Options== <!--T:6--> |
||
Line 25: | Line 54: | ||
<!--T:7--> |
<!--T:7--> |
||
* Press {{KEY|X}}, {{KEY|Y}} or {{KEY|Z}} after a point to constrain the next point on the given axis. |
* 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| |
* To enter coordinates manually, simply enter the numbers, then press {{KEY|Enter}} between each X, Y and Z component. You can press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button when you have the desired values to insert the point. |
||
* Press {{KEY|T}} or click the checkbox to |
* Press {{KEY|T}} or click the checkbox to toggle ''continue'' mode. If continue mode is on, the Rotate tool will restart after you finish the operation, allowing you to rotate or copy the objects again without pressing the tool button again. |
||
* |
* Press {{KEY|P}} or click the checkbox to toggle ''copy'' mode. If copy mode is on, the Rotate tool will keep the original shape in its place but will make a copy at the set angle set by the third point. |
||
:You can use both {{KEY|T}} and {{KEY|P}} to place several copies in sequence. In this case, the duplicated element is the last placed copy. |
|||
⚫ | |||
* Hold {{KEY|Alt}} after the second point to also toggle copy mode. Keeping {{KEY|Alt}} pressed after clicking on the third point will allow you to continue placing copies using the same rotation base point and baseline; release {{KEY|Alt}} to finish the operation and see all copies. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
==Scripting== <!--T:8--> |
==Scripting== <!--T:8--> |
||
{{Emphasis|See also:}} [[Draft API|Draft API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]]. |
|||
<!--T:9--> |
<!--T:9--> |
||
The Rotate tool can |
The Rotate tool can be used in [[macros|macros]] and from the [[Python|Python]] console by using the following function: |
||
</translate> |
</translate> |
||
{{Code|code= |
|||
<syntaxhighlight> |
|||
rotatedlist = rotate(objectslist, angle, center=Vector(0,0,0), axis=Vector(0,0,1), copy=False) |
|||
}} |
|||
</syntaxhighlight> |
|||
<translate> |
<translate> |
||
<!--T:10--> |
<!--T:10--> |
||
* Rotates the |
* Rotates the base point of the objects in {{incode|objectlist}} by the given {{incode|angle}}. |
||
** {{incode|objectlist}} is either a single object or a list of objects. |
|||
* If axis is omitted, the rotation will be around the vertical Z axis. |
|||
** If a rotation base point ({{incode|center}}), and {{incode|axis}} are given, they are used; otherwise the rotation is based on the origin and around the Z axis. |
|||
* If copymode is True, the actual objects are not moved, but copies are created instead. |
|||
:The rotation angle is relative to the base point of the object, which means that if an object is rotated 45 degrees, and then another 45 degrees, it will have rotated 90 degrees in total from its original position. |
|||
* Returns the objects (or their copies is copymode was True). |
|||
* If {{incode|copy}} is {{incode|True}} copies are created instead of rotating the original objects. |
|||
* {{incode|rotatedlist}} is returned with the original rotated objects, or with the new copies. |
|||
** {{incode|rotatedlist}} is either a single object or a list of objects, depending on the input {{incode|objectlist}}. |
|||
<!--T:11--> |
<!--T:11--> |
||
Line 52: | Line 88: | ||
</translate> |
</translate> |
||
{{Code|code= |
|||
<syntaxhighlight> |
|||
import FreeCAD, Draft |
|||
Draft.rotate(FreeCAD.ActiveDocument.ActiveObject,45) |
|||
</syntaxhighlight> |
|||
Polygon1 = Draft.makePolygon(3, radius=500) |
|||
⚫ | |||
Draft.move(Polygon1, FreeCAD.Vector(1500, 0, 0)) |
|||
Draft.rotate(Polygon1, 45) |
|||
# Rotation around the origin |
|||
angle1 = 63 |
|||
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.makePolygon(3, radius=1000) |
|||
Polygon3 = Draft.makePolygon(5, radius=500) |
|||
Draft.move(Polygon2, FreeCAD.Vector(2000, 0, 0)) |
|||
Draft.move(Polygon3, FreeCAD.Vector(2000, 0, 0)) |
|||
# Rotation around another point |
|||
angle2 = 60 |
|||
c = FreeCAD.Vector(3100, 0, 0) |
|||
List2 = [Polygon2, Polygon3] |
|||
rot_list2 = Draft.rotate(List2, angle2, center=c, copy=True) |
|||
rot_list3 = Draft.rotate(List2, 2*angle2, center=c, copy=True) |
|||
rot_list4 = Draft.rotate(List2, 4*angle2, center=c, copy=True) |
|||
}} |
|||
<translate> |
|||
<!--T:16--> |
|||
{{Docnav |
|||
|[[Draft_Move|Move]] |
|||
|[[Draft_Offset|Offset]] |
|||
|[[Draft_Module|Draft]] |
|||
|IconL=Draft_Move.svg |
|||
|IconR=Draft_Offset.svg |
|||
|IconC=Workbench_Draft.svg |
|||
}} |
|||
</translate> |
|||
{{Draft Tools navi{{#translation:}}}} |
|||
{{Userdocnavi{{#translation:}}}} |
|||
{{clear}} |
Revision as of 15:58, 29 November 2020
Draft Rotate |
Menu location |
---|
Draft → Rotate |
Workbenches |
Draft, Arch |
Default shortcut |
R O |
Introduced in version |
0.7 |
See also |
Draft Move, Draft Array |
Description
The Rotate tool rotates or copies the selected objects by a given angle around a reference point.
The Rotate tool can be used on 2D shapes created with the Draft Workbench or Sketcher Workbench, but can also be used on many types of 3D objects such as those created with the Part Workbench or Arch Workbench.
To move without rotation, use Draft Move. To produce various copies in different arrangements use Draft Array, Draft PathArray and Draft PointArray.
Rotating one object using a center reference point, from one reference angle to another angle
Usage
- Select the objects that you wish to move or copy.
- Press the Draft Rotate button, or press R then O keys. If no object is selected, you will be invited to select one.
- Click a first point on the 3D view, or type a coordinate and press the add point button. This serves as the base point of the operation, through which the axis of rotation will pass.
- Click a second point on the 3D view, or type a base angle. This defines a baseline that will rotate around the first point.
- Click a third point on the 3D view, or type a rotation angle. This indicates the rotation of the baseline, and thus the objects.
Limitations
When rotating an object that is based on a Sketcher Sketch, for example, a feature created with the PartDesign Workbench (Pad, 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.
Options
- 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. You can press the add point button when you have the desired values to insert the point.
- Press T or click the checkbox to toggle continue mode. If continue mode is on, the Rotate tool will restart after you finish the operation, allowing you to rotate or copy the objects again without pressing the tool button again.
- Press P or click the checkbox to toggle copy mode. If copy mode is on, the Rotate tool will keep the original shape in its place but will make a copy at the set angle set by the third point.
- You can use both T and P to place several copies in sequence. In this case, the duplicated element is the last placed copy.
- Hold Alt after the second point to also toggle copy mode. Keeping Alt pressed after clicking on the third point will allow you to continue placing copies using the same rotation base point and baseline; release Alt to finish the operation and see all copies.
- Hold Ctrl while rotating to force snapping your point to the nearest snap location, independently of the distance.
- Hold Shift while rotating to constrain your next point horizontally or vertically in relation to the rotation base point.
- Press Esc or the Close button to abort the current command; copies already placed will remain.
Scripting
See also: Draft API and FreeCAD Scripting Basics.
The Rotate tool can be used in macros and from the Python console by using the following function:
rotatedlist = rotate(objectslist, angle, center=Vector(0,0,0), axis=Vector(0,0,1), copy=False)
- Rotates the base point of the objects in
objectlist
by the givenangle
.objectlist
is either a single object or a list of objects.- If a rotation base point (
center
), andaxis
are given, they are used; otherwise the rotation is based on the origin and around the Z axis.
- The rotation angle is relative to the base point of the object, which means that if an object is rotated 45 degrees, and then another 45 degrees, it will have rotated 90 degrees in total from its original position.
- If
copy
isTrue
copies are created instead of rotating the original objects. rotatedlist
is returned with the original rotated objects, or with the new copies.rotatedlist
is either a single object or a list of objects, depending on the inputobjectlist
.
Example:
import FreeCAD, Draft
Polygon1 = Draft.makePolygon(3, radius=500)
Draft.move(Polygon1, FreeCAD.Vector(1500, 0, 0))
Draft.rotate(Polygon1, 45)
# Rotation around the origin
angle1 = 63
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.makePolygon(3, radius=1000)
Polygon3 = Draft.makePolygon(5, radius=500)
Draft.move(Polygon2, FreeCAD.Vector(2000, 0, 0))
Draft.move(Polygon3, FreeCAD.Vector(2000, 0, 0))
# Rotation around another point
angle2 = 60
c = FreeCAD.Vector(3100, 0, 0)
List2 = [Polygon2, Polygon3]
rot_list2 = Draft.rotate(List2, angle2, center=c, copy=True)
rot_list3 = Draft.rotate(List2, 2*angle2, center=c, copy=True)
rot_list4 = Draft.rotate(List2, 4*angle2, center=c, copy=True)
- Drafting: Line, Polyline, Fillet, Arc, Arc by 3 points, Circle, Ellipse, Rectangle, Polygon, B-spline, Cubic Bézier curve, Bézier curve, Point, Facebinder, ShapeString, Hatch
- Annotation: Text, Dimension, Label, Annotation styles, Annotation scale
- Modification: Move, Rotate, Scale, Mirror, Offset, Trimex, Stretch, Clone, Array, Polar array, Circular array, Path array, Path link array, Point array, Point link array, Edit, Subelement highlight, Join, Split, Upgrade, Downgrade, Wire to B-spline, Draft to sketch, Set slope, Flip dimension, Shape 2D view
- Draft Tray: Select plane, Set style, Toggle construction mode, AutoGroup
- Snapping: Snap lock, Snap endpoint, Snap midpoint, Snap center, Snap angle, Snap intersection, Snap perpendicular, Snap extension, Snap parallel, Snap special, Snap near, Snap ortho, Snap grid, Snap working plane, Snap dimensions, Toggle grid
- Miscellaneous: Apply current style, Layer, Manage layers, Add a new named group, Move to group, Select group, Add to construction group, Toggle normal/wireframe display, Create working plane proxy, Heal, Show snap toolbar
- Additional: Constraining, Pattern, Preferences, Import Export Preferences, DXF/DWG, SVG, OCA, DAT
- Context menu:
- Layer container: Merge layer duplicates, Add new layer
- Layer: Activate this layer, Select layer contents
- Text: Open hyperlinks
- Wire: Flatten
- Working plane proxy: Write camera position, Write objects state
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web
- Hubs: User hub, Power users hub, Developer hub