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)
Line 1: Line 1:
<languages/>
<languages/>
<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 Module/sv|Draft]], [[Arch Module/sv|Arch]]|MenuLocation=Draft → Scale|Shortcut=S C|SeeAlso=[[Draft Clone/sv|Draft Clone]]}}
</div>


==Beskrivning==
==Beskrivning==
Line 7: Line 9:
Detta verktyg skalar valda objekt runt en baspunkt. Om inga objekt är markerade, så kommer du ombes att välja ett.
Detta verktyg skalar valda objekt runt en baspunkt. Om inga objekt är markerade, så kommer du ombes att välja ett.
</div>
</div>

The Scale tool can produce a copy or a [[Draft Clone]] at a defined scale. Use [[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]].

This tool can be used on 2D shapes created with the [[Draft Workbench]] but can also be used on many types of 3D objects such as those created with the [[Part Workbench]] or [[PartDesign Workbench]].


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


==Bruk==
==Bruk==


# Select objects you wish to scale
# Select the objects that you wish to scale.
# Press the {{KEY|[[Image:Draft Scale.png|16px]] [[Draft Scale]]}} button, or press {{KEY|S}} then {{KEY|C}} keys
# Press the {{Button|[[Image:Draft Scale.svg|16px]] [[Draft Scale]]}} button, or press {{KEY|S}} then {{KEY|C}} keys. If no object is selected, you will be invited to select one.
# Click a first point on the 3D view, or type a [[Draft_Coordinates|coordinate]] to define the base point of the scaling
# 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.
# Another task dialog with scaling options opens. Fill in the different options, and press {{KEY|OK}} to accept
# 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.


==Options==
==Options==
Line 32: Line 39:


==Scripting==
==Scripting==
{{Emphasis|See also:}} [[Draft API]] and [[FreeCAD Scripting Basics]].


The Scale tool can by used in [[macros]] and from the python console by using the following function:
The Scale tool can be used in [[macros]] and from the [[Python]] console by using the following function:


{{Code|code=
{{Code|code=
scale (objects,vector,[center,copy,legacy])
scaledlist = scale(objectslist, delta=Vector(1,1,1), center=Vector(0,0,0), copy=False, legacy=False)
}}
}}


* Scales the objects contained in objects (that can be a list of objects or an object) of the given scale factors defined by the given vector (in X, Y and Z directions) around the given center.
* Scales the objects in {{incode|objectslist}} by the factors specified by the components of {{incode|delta}}, defined as a {{incode|FreeCAD.Vector}}, and using {{incode|center}} as base point.
** {{incode|objectslist}} is either a single object or a list of objects.
* If legacy is True, direct (old) mode is used, otherwise a parametric copy is made.
* If copy is True, the actual objects are not moved, but copies are created instead.
* If {{incode|copy}} is {{incode|True}} copies are created instead of modifying the original objects.
* If {{incode|legacy}} is {{incode|True}}, direct copy mode is used (outdated), otherwise a parametric copy is made.
* The objects (or their copies) are returned.
* {{incode|scaledlist}} is returned with the original scaled objects, or with the new clones.
** {{incode|scaledlist}} is either a single object or a list of objects, depending on the input {{incode|objectslist}}.


Example:
Example:


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

Draft.scale(FreeCAD.ActiveDocument.ActiveObject,FreeCAD.Vector(2,2,2))
Polygon1 = Draft.makePolygon(3, radius=1200)
delta1 = FreeCAD.Vector(2.3, 0.75, 0)

clone_1 = Draft.scale(Polygon1, delta1, copy=True)

Polygon2 = Draft.makePolygon(5, radius=750)
delta2 = FreeCAD.Vector(-2, -1.5, 0)

clone_2 = Draft.scale([Polygon1, Polygon2], delta2, copy=True)
Draft.move(clone_2, FreeCAD.Vector(3500, 1000, 0))
}}
}}

{{Draft Tools navi}}
{{Userdocnavi}}
{{clear}}

Revision as of 13:03, 8 January 2019

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 Scale tool can produce a copy or a Draft Clone at a defined scale. Use 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.

This tool can be used on 2D shapes created with the Draft Workbench but can also be used on many types of 3D objects such as those created with the Part Workbench or PartDesign Workbench.

File:Draft Scale example.jpg

Scaling one object from a reference point to a second point

Bruk

  1. Select the objects that you wish to scale.
  2. Press the Draft Scale button, or press S then C keys. If no object is selected, you will be invited to select one.
  3. 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.
  4. Set the X, Y, and Z factors, and the appropriate result options, then press Enter or the OK button to finish the operation.

Options

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

Scripting

See also: Draft API and FreeCAD Scripting Basics.

The Scale tool can be used in macros and from the Python console by using the following function:

scaledlist = scale(objectslist, delta=Vector(1,1,1), center=Vector(0,0,0), copy=False, legacy=False)
  • Scales the objects in objectslist by the factors specified by the components of delta, defined as a FreeCAD.Vector, and using center as base point.
    • objectslist is either a single object or a list of objects.
  • If copy is True copies are created instead of modifying the original objects.
  • If legacy is True, direct copy mode is used (outdated), otherwise a parametric copy is made.
  • scaledlist is returned with the original scaled objects, or with the new clones.
    • scaledlist is either a single object or a list of objects, depending on the input objectslist.

Example:

import FreeCAD, Draft

Polygon1 = Draft.makePolygon(3, radius=1200)
delta1 = FreeCAD.Vector(2.3, 0.75, 0)

clone_1 = Draft.scale(Polygon1, delta1, copy=True)

Polygon2 = Draft.makePolygon(5, radius=750)
delta2 = FreeCAD.Vector(-2, -1.5, 0)

clone_2 = Draft.scale([Polygon1, Polygon2], delta2, copy=True)
Draft.move(clone_2, FreeCAD.Vector(3500, 1000, 0))