Draft Scale: Difference between revisions
(Module to Workbench renaming.) |
|||
(40 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Page_in_progress}} |
|||
<languages/> |
<languages/> |
||
<translate> |
<translate> |
||
Line 7: | Line 6: | ||
|[[Draft_Rotate|Rotate]] |
|[[Draft_Rotate|Rotate]] |
||
|[[Draft_Mirror|Mirror]] |
|[[Draft_Mirror|Mirror]] |
||
|[[ |
|[[Draft_Workbench|Draft]] |
||
|IconL=Draft_Rotate.svg |
|IconL=Draft_Rotate.svg |
||
|IconR=Draft_Mirror.svg |
|IconR=Draft_Mirror.svg |
||
Line 17: | Line 16: | ||
|Name=Draft Scale |
|Name=Draft Scale |
||
|MenuLocation=Modification → Scale |
|MenuLocation=Modification → Scale |
||
|Workbenches=[[ |
|Workbenches=[[Draft_Workbench|Draft]], [[Arch_Workbench|Arch]] |
||
|Shortcut={{KEY|S}} {{KEY|C}} |
|Shortcut={{KEY|S}} {{KEY|C}} |
||
|SeeAlso=[[ |
|SeeAlso=[[Draft_SubelementHighlight|Draft SubelementHighlight]], [[Draft_Clone|Draft Clone]] |
||
}} |
}} |
||
Line 25: | Line 24: | ||
<!--T:3--> |
<!--T:3--> |
||
The |
The [[Image:Draft_Scale.svg|24px]] '''Draft Scale''' command scales or copies selected objects around a base point. In subelement mode the command scales selected points and edges of [[Draft_Line|Draft Lines]] and [[Draft_Wire|Draft Wires]]. |
||
⚫ | |||
The Scale tool can produce a copy or a [[Draft Clone|Draft Clone]] at a defined scale. Use [[Draft Offset|Draft Offset]] to produce a scaled copy of a wire set at a certain offset. A simple copy with no scaling can be produced with [[Draft Move|Draft Move]]. |
|||
<!--T:13--> |
<!--T:13--> |
||
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]]. |
|||
</translate> |
</translate> |
||
[[Image:Draft_Scale_example. |
[[Image:Draft_Scale_example.png|400px]] |
||
<translate> |
<translate> |
||
<!--T:14--> |
<!--T:14--> |
||
{{Caption|Scaling |
{{Caption|Scaling an object around a base point}} |
||
==Usage== <!--T:4--> |
==Usage== <!--T:4--> |
||
⚫ | |||
See also: [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]]. |
|||
<!--T:5--> |
<!--T:5--> |
||
# Optionally select one or more objects, or one or more subelements of [[Draft_Line|Draft Lines]] or [[Draft_Wire|Draft Wires]]. |
|||
# Select the objects that you wish to scale. |
|||
# There are several ways to invoke the command: |
|||
# Press the {{Button|[[Image:Draft Scale.svg|16px]] [[Draft Scale|Draft Scale]]}} button, or press {{KEY|S}} then {{KEY|C}} keys. If no object is selected, you will be invited to select one. |
|||
# |
#* Press the {{Button|[[Image:Draft_Scale.svg|16px]] [[Draft_Scale|Draft Scale]]}} button. |
||
#* Select the {{MenuCommand|Modification → [[Image:Draft_Scale.svg|16px]] Scale}} option from the menu. |
|||
⚫ | |||
#* Use the keyboard shortcut: {{KEY|S}} then {{KEY|C}}. |
|||
# If you have not yet selected an object: select an object in the [[3D_view|3D view]]. |
|||
# The {{MenuCommand|Scale}} 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 base point in the [[3D_view|3D view]], or type coordinates and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button. |
|||
# Enter the X, Y and Z scale factors. |
|||
⚫ | |||
==Options== <!--T:6--> |
==Options== <!--T:6--> |
||
===First task panel=== <!--T:21--> |
|||
<!--T:22--> |
|||
The single character keyboard shortcuts mentioned here can be changed. See [[Draft_Preferences|Draft Preferences]]. |
|||
<!--T:23--> |
|||
⚫ | * To manually enter the coordinates for the base point 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. |
||
* The {{MenuCommand|Relative}} checkbox has no purpose for this command. |
|||
* 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}} |
|||
* The remaining checkboxes in this task panel are ignore by the command. |
|||
* Press {{KEY|S}} to switch [[Draft_Snap|Draft snapping]] on or off. |
|||
* Press the {{Button|Close}} button to abort the command. |
|||
===Second task panel=== <!--T:24--> |
|||
<!--T:7--> |
<!--T:7--> |
||
⚫ | |||
⚫ | |||
* Check the {{MenuCommand|Uniform scaling}} checkbox to lock the X, Y and Z factors to the same value. For this setting to take effect one of the scale factors has to be changed. Alternatively you can click in the inputbox with the desired scale and press {{KEY|Enter}} to finish the command. |
|||
⚫ | |||
* If the {{MenuCommand|Working plane orientation}} checkbox is checked the scale factors are relative to the [[Draft_SelectPlane|working plane]] coordinate system, else they are relative to the global coordinate system. |
|||
** Click the "Uniform scaling" checkbox to lock the X, Y and Z factors to the same value. |
|||
* If the {{MenuCommand|Copy}} checkbox is checked a scaled copy of the original object is created. This only works for Draft objects that have a {{PropertyData|Points}} property, such as [[Draft_Wire|Draft Wires]]. |
|||
** Click the "Working plane orientation" checkbox to lock the X, Y and Z scaling along the current [[Draft SelectPlane|Working Plane]]; otherwise, global X, Y and Z directions are used. |
|||
* If the {{MenuCommand|Modify subelements}} checkbox is checked 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]]. |
|||
* Three options control the result of the scaling operation: |
|||
* If the {{MenuCommand|Create a clone}} checkbox is checked scaled [[Draft_Clone|clones]] of the original objects are created. This works for all object types. For objects that are not Draft objects, or for Draft objects that do not have a {{PropertyData|Points}} property, this option {{Emphasis|must}} be selected. |
|||
* Press the {{Button|Pick from/to points}} button and pick two additional points in the [[3D_view|3D view]] to calculate the scale factors. This will automatically check the {{MenuCommand|Uniform scaling}} checkbox. The X, Y and Z scale factors will therefore be equal and will be set to the distance between the base point and the 'from' point, divided by the distance between the base point and the 'to' point. |
|||
::{{Emphasis|Note:}} even if the scaling factors are left at their default values (1.0, 1.0, 1.0), once the clone is created you will be able to change these factors manually in the [[property editor|property editor]]. |
|||
* Press {{KEY|Esc}} or the {{Button|Cancel}} button to abort the command. |
|||
:* Modify original. The original object will have its size modified. This will only work with [[Draft Workbench|Draft]] objects and non-parametric [[Part Workbench|Part]] shapes. |
|||
:* Create a copy. A scaled copy of the original object will be created. This will work for all object types, but only the copies of [[Draft Workbench|Draft]] objects will be parametric. |
|||
==Notes== <!--T:25--> |
|||
::{{Emphasis|Note:}} a copy is a completely different object from the original shape; it will be created at the specified scale, and then will have its own set of properties. On the other hand, a [[Draft Clone|Draft Clone]] is linked to the original shape and the only property that can be changed is the scale. |
|||
* Image planes created with the Image workbench are also supported (but not in clone mode). |
|||
<!--T:26--> |
|||
* The command can also scale [[Image_CreateImagePlane|Image Planes]], but not in clone mode. |
|||
==Preferences== <!--T:27--> |
|||
<!--T:28--> |
|||
See also: [[Preferences_Editor|Preferences Editor]] and [[Draft_Preferences|Draft Preferences]]. |
|||
<!--T:29--> |
|||
* To change the number of decimals used for the input of coordinates: {{MenuCommand|Edit → Preferences... → General → Units → Units settings → Number of decimals}}. |
|||
* To change the number of decimals used for the input of scale factors: {{MenuCommand|Edit → Preferences... → Draft → General settings → General Draft Settings → Internal precision level}}. |
|||
* To store and reuse the same copy mode setting across commands: {{MenuCommand|Edit → Preferences... → Draft → General settings → Draft tools options → Global copy mode}}. |
|||
* To reselect the base objects after copying objects: {{MenuCommand|Edit → Preferences... → Draft → General settings → Draft tools options → Select base objects after copying}}. |
|||
==Scripting== |
==Scripting== <!--T:19--> |
||
<!--T:8--> |
<!--T:8--> |
||
See also: [https:// |
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]]. |
||
<!--T:9--> |
<!--T:9--> |
||
Line 77: | Line 111: | ||
<!--T:10--> |
<!--T:10--> |
||
* {{incode|objectslist}} contains the objects to be scaled. |
* {{incode|objectslist}} contains the objects to be scaled. It is either a single object or a list of objects. |
||
* {{incode|scale}} |
* {{incode|scale}} is the vector that specifies by the X, Y and Z scale factors. |
||
* {{incode|center}} |
* {{incode|center}} is the center point of the scaling operation. |
||
* If {{incode|copy}} is {{incode|True}} copies are created instead of scaling the original objects. |
* If {{incode|copy}} is {{incode|True}} copies are created instead of scaling the original objects. |
||
* {{incode|scaled_list}} is returned with the original scaled objects, or with the new copies. |
* {{incode|scaled_list}} is returned with the original scaled objects, or with the new copies. It is either a single object or a list of objects, depending on {{incode|objectslist}}. |
||
<!--T:11--> |
<!--T:11--> |
||
Line 112: | Line 146: | ||
|[[Draft_Rotate|Rotate]] |
|[[Draft_Rotate|Rotate]] |
||
|[[Draft_Mirror|Mirror]] |
|[[Draft_Mirror|Mirror]] |
||
|[[ |
|[[Draft_Workbench|Draft]] |
||
|IconL=Draft_Rotate.svg |
|IconL=Draft_Rotate.svg |
||
|IconR=Draft_Mirror.svg |
|IconR=Draft_Mirror.svg |
Revision as of 18:11, 24 August 2021
Draft Scale |
Menu location |
---|
Modification → Scale |
Workbenches |
Draft, Arch |
Default shortcut |
S C |
Introduced in version |
- |
See also |
Draft SubelementHighlight, Draft Clone |
Description
The Draft Scale command scales or copies selected objects around a base point. In subelement mode the command scales selected points and edges of Draft Lines and Draft Wires.
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.
Scaling an object around a base point
Usage
See also: Draft Snap and Draft Constrain.
- Optionally select one or more objects, or one or more subelements of Draft Lines or Draft Wires.
- There are several ways to invoke the command:
- Press the Draft Scale button.
- Select the Modification → Scale option from the menu.
- Use the keyboard shortcut: S then C.
- If you have not yet selected an object: select an object in the 3D view.
- The Scale task panel opens. See Options for more information.
- If subelements have been selected: check the Modify subelements checkbox to switch on subelement mode.
- Pick the base point in the 3D view, or type coordinates and press the Enter point button.
- Enter the X, Y and Z scale factors.
- Press Enter or the OK button to finish the command.
Options
First task panel
The single character keyboard shortcuts mentioned here can be changed. See Draft Preferences.
- To manually enter the coordinates for the base point 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.
- The Relative checkbox has no purpose for this command.
- 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
- The remaining checkboxes in this task panel are ignore by the command.
- Press S to switch Draft snapping on or off.
- Press the Close button to abort the command.
Second task panel
- Enter the X, Y and Z factors to define the scaling. The values must be larger than zero.
- Check the Uniform scaling checkbox to lock the X, Y and Z factors to the same value. For this setting to take effect one of the scale factors has to be changed. Alternatively you can click in the inputbox with the desired scale and press Enter to finish the command.
- If the Working plane orientation checkbox is checked the scale factors are relative to the working plane coordinate system, else they are relative to the global coordinate system.
- If the Copy checkbox is checked a scaled copy of the original object is created. This only works for Draft objects that have a DataPoints property, such as Draft Wires.
- If the Modify subelements checkbox is checked the command will use the selected subelements instead of the whole objects. The subelements must belong to Draft Lines or Draft Wires.
- If the Create a clone checkbox is checked scaled clones of the original objects are created. This works for all object types. For objects that are not Draft objects, or for Draft objects that do not have a DataPoints property, this option must be selected.
- Press the Pick from/to points button and pick two additional points in the 3D view to calculate the scale factors. This will automatically check the Uniform scaling checkbox. The X, Y and Z scale factors will therefore be equal and will be set to the distance between the base point and the 'from' point, divided by the distance between the base point and the 'to' point.
- Press Esc or the Cancel button to abort the command.
Notes
- The command can also scale Image Planes, but not in clone mode.
Preferences
See also: Preferences Editor and Draft Preferences.
- To change the number of decimals used for the input of coordinates: Edit → Preferences... → General → Units → Units settings → Number of decimals.
- To change the number of decimals used for the input of scale factors: Edit → Preferences... → Draft → General settings → General Draft Settings → Internal precision level.
- To store and reuse the same copy mode setting across commands: Edit → Preferences... → Draft → General settings → Draft tools options → Global copy mode.
- To reselect the base objects after copying objects: Edit → Preferences... → Draft → General settings → Draft tools options → Select base objects after copying.
Scripting
See also: Autogenerated API documentation and FreeCAD Scripting Basics.
To scale objects use the scale
method of the Draft module.
scaled_list = scale(objectslist, scale=Vector(1,1,1), center=Vector(0,0,0), copy=False)
objectslist
contains the objects to be scaled. It is either a single object or a list of objects.scale
is the vector that specifies by the X, Y and Z scale factors.center
is the center point of the scaling operation.- If
copy
isTrue
copies are created instead of scaling the original objects. scaled_list
is returned with the original scaled objects, or with the new copies. It is either a single object or a list of objects, depending onobjectslist
.
Example:
import FreeCAD as App
import Draft
doc = App.newDocument()
pts = [App.Vector(0, 0, 0), App.Vector(500, 500, 0), App.Vector(600, 0, 0)]
wire1 = Draft.make_wire(pts, closed=True)
doc.recompute()
scale1 = App.Vector(2.3, 0.75, 0)
wire2 = Draft.scale(wire1, scale1, copy=True)
doc.recompute()
scale2 = App.Vector(-2, -1.5, 0)
wires = Draft.scale([wire1, wire2], scale2, copy=True)
doc.recompute()
- 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