Draft Scale/sv: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Page_in_progress}}
<languages/>
<languages/>


Line 5: Line 4:
|[[Draft_Rotate|Rotate]]
|[[Draft_Rotate|Rotate]]
|[[Draft_Mirror|Mirror]]
|[[Draft_Mirror|Mirror]]
|[[Draft_Module|Draft]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Rotate.svg
|IconL=Draft_Rotate.svg
|IconR=Draft_Mirror.svg
|IconR=Draft_Mirror.svg
Line 12: Line 11:


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
{{GuiCommand/sv|Name=Draft Scale|Name/sv=Draft Scale|Workbenches=[[Draft Module/sv|Draft]], [[Arch Module/sv|Arch]]|MenuLocation=Draft → Scale|Shortcut=S C|SeeAlso=[[Draft Clone/sv|Draft Clone]]}}
{{GuiCommand/sv|Name=Draft Scale|Name/sv=Draft Scale|Workbenches=[[Draft_Workbench/sv|Draft]], [[Arch_Workbench/sv|Arch]]|MenuLocation=Draft → Scale|Shortcut=S C|SeeAlso=[[Draft Clone/sv|Draft Clone]]}}
</div>
</div>


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


Line 21: Line 21:
</div>
</div>


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


[[Image:Draft_Scale_example.png|400px]]
This tool can be used on 2D shapes created with the [[Image:Workbench_Draft.svg|16px]] [[Draft Workbench|Draft Workbench]] but can also be used on many types of 3D objects such as those created with the [[Image:Workbench_Part.svg|16px]] [[Part Workbench|Part]] or [[Image:Workbench_PartDesign.svg|16px]] [[PartDesign Workbench|PartDesign]] workbenches.
{{Caption|Scaling an object around a base point}}

[[Image:Draft_Scale_example.jpg|400px]]
{{Caption|Scaling one object from a reference point to a second point}}


<span id="Usage"></span>
==Bruk==
==Bruk==


See also: [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]].
# Select the objects that you wish to scale.

# 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.
# Optionally select one or more objects, or one or more subelements of [[Draft_Line|Draft Lines]] or [[Draft_Wire|Draft Wires]].
# 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.
# There are several ways to invoke the command:
# Set the X, Y, and Z factors, and the appropriate result options, then press {{KEY|Enter}} or the {{Button|OK}} button to finish the operation.
#* Press the {{Button|[[Image:Draft_Scale.svg|16px]] [[Draft_Scale|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.
# Press {{KEY|Enter}} or the {{Button|OK}} button to finish the command.


==Options==
==Options==

===First task panel===

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.

* 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.
* 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|S}} to switch [[Draft_Snap|Draft snapping]] on or off.
* Press the {{Button|Close}} button to abort the command.

===Second task panel===


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 43: Line 62:
* Nedtryckning av {{KEY|SKIFT}} kommer att koppla ihop x och y värdena, så att förhållandet inte ändras
* Nedtryckning av {{KEY|SKIFT}} kommer att koppla ihop x och y värdena, så att förhållandet inte ändras
* Om du trycker på {{KEY|ESC}} så avbryts funktionen.
* Om du trycker på {{KEY|ESC}} så avbryts funktionen.
* Skriv in siffror för att [[Draft_Coordinates/sv|manuellt mata in en koordinat]].
* Skriv in siffror för att manuellt mata in en koordinat.
* {{KEY|C}} växlar kopieringsläget på/av. Med kopiering på, så kommer objekt(en) att kopieras istället för att flyttas.
* {{KEY|C}} växlar kopieringsläget på/av. Med kopiering på, så kommer objekt(en) att kopieras istället för att flyttas.
* Nedtryckning av {{KEY|ALT}} kommer att skapa en kopia, även om kopieringsknappen är av.
* Nedtryckning av {{KEY|ALT}} kommer att skapa en kopia, även om kopieringsknappen är av.
* Om {{KEY|ALT}} är nedtryckt, så kan du göra multipla kopior ända tills {{KEY|ALT}} släpps.
* Om {{KEY|ALT}} är nedtryckt, så kan du göra multipla kopior ända tills {{KEY|ALT}} släpps.
</div>
</div>

==Notes==

* The command can also scale [[Image_CreateImagePlane|Image Planes]], but not in clone mode.

==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==
==Scripting==


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


To scale objects use the {{incode|scale}} method of the Draft module.
To scale objects use the {{incode|scale}} method of the Draft module.
Line 60: Line 89:


* {{incode|objectslist}} contains the objects to be scaled. It is either a single object or a list of objects.
* {{incode|objectslist}} contains the objects to be scaled. It is either a single object or a list of objects.
* {{incode|scale}} indicates the vector that specifies by the X, Y and Z scale factors.
* {{incode|scale}} is the vector that specifies by the X, Y and Z scale factors.
* {{incode|center}} indicates the center point of the scaling operation.
* {{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. It is either a single object or a list of objects, depending on {{incode|objectslist}}.
* {{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}}.
Line 90: Line 119:
|[[Draft_Rotate|Rotate]]
|[[Draft_Rotate|Rotate]]
|[[Draft_Mirror|Mirror]]
|[[Draft_Mirror|Mirror]]
|[[Draft_Module|Draft]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Rotate.svg
|IconL=Draft_Rotate.svg
|IconR=Draft_Mirror.svg
|IconR=Draft_Mirror.svg

Latest revision as of 05:05, 9 January 2024

Draft Scale

Menyplacering
Draft → Scale
Arbetsbänkar
Draft, Arch
Standard genväg
S C
Introducerad i version
-
Se även
Draft Clone

Beskrivning

Detta verktyg skalar valda objekt runt en baspunkt. Om inga objekt är markerade, så kommer du ombes att välja ett.

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

Bruk

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 Scale button.
    • Select the Modification → Scale option from the menu.
    • Use the keyboard shortcut: S then C.
  3. If you have not yet selected an object: select an object in the 3D view.
  4. The Scale 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 base point in the 3D view, or type coordinates and press the Enter point button.
  7. Enter the X, Y and Z scale factors.
  8. Press Enter or the OK button to finish the command.

Options

First task panel

The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts.

  • 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.
  • 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 S to switch Draft snapping on or off.
  • Press the Close button to abort the command.

Second task panel

  • Markera en punkt i ett tomt område i 3d vyn, eller på ett existerande objekt för baspunkten, sedan en annan punkt för skalfaktorn
  • x, y och z komponenterna av den andra punkten definierar skalfaktorn. Till exempel, (1,1,1) gör ingenting, (2,2,2) kommer att skala 2x i alla riktningar, (-1,1,1) kommer att spegla i x riktningen.
  • Nedtryckning av CTRL kommer att snäppa din punkt till tillgängliga snäpp-punkter.
  • Nedtryckning av SKIFT kommer att koppla ihop x och y värdena, så att förhållandet inte ändras
  • Om du trycker på ESC så avbryts funktionen.
  • Skriv in siffror för att manuellt mata in en koordinat.
  • C växlar kopieringsläget på/av. Med kopiering på, så kommer objekt(en) att kopieras istället för att flyttas.
  • Nedtryckning av ALT kommer att skapa en kopia, även om kopieringsknappen är av.
  • Om ALT är nedtryckt, så kan du göra multipla kopior ända tills ALT släpps.

Notes

  • The command can also scale Image Planes, but not in clone mode.

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

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 is True 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 on objectslist.

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