|Draft → Rotate|
|Introduced in version|
|Draft Move, Draft Array|
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.
Rotating one object using a center reference point, from one reference angle to another angle
- Select the objects that you wish to move or copy.
- Press the button, or press then 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 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.
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.
- Press , or after a point to constrain the next point on the given axis.
- To enter coordinates manually, simply enter the numbers, then press between each X, Y and Z component. You can press the button when you have the desired values to insert the point.
- Press 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 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 and to place several copies in sequence. In this case, the duplicated element is the last placed copy.
- Hold after the second point to also toggle copy mode. Keeping pressed after clicking on the third point will allow you to continue placing copies using the same rotation base point and baseline; release to finish the operation and see all copies.
- Hold snapping your point to the nearest snap location, independently of the distance. while rotating to force
- Hold constrain your next point horizontally or vertically in relation to the rotation base point. while rotating to
- Press or the button to abort the current command; copies already placed will remain.
rotatedlist = rotate(objectslist, angle, center=Vector(0,0,0), axis=Vector(0,0,1), copy=False)
- Rotates the base point of the objects in
objectlistby the given
objectlistis either a single object or a list of objects.
- If a rotation base point (
axisare 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.
Truecopies are created instead of rotating the original objects.
rotatedlistis returned with the original rotated objects, or with the new copies.
rotatedlistis either a single object or a list of objects, depending on the input
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)