Draft Scale/pl: Difference between revisions

From FreeCAD Documentation
(Created page with "Do skalowania obiektów służy metoda {{incode|scale}} środowiska Rysunek Roboczy.")
(Created page with "Przykład:")
Line 97: Line 97:
* {{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}}.


Przykład:
Example:


{{Code|code=
{{Code|code=

Revision as of 09:13, 5 August 2021

Draft: Skala

Lokalizacja w menu
Modyfikacja → Skala
Środowisko pracy
Rysunek Roboczy, Architektura
Domyślny skrót
S C
Wprowadzono w wersji
-
Zobacz także
Podświetl element podrzędny,Klon

Opis

Polecenie Skaluj - skaluje lub kopiuje wybrane obiekty wokół punktu bazowego. W trybie elementu podrzędnego polecenie zmienia skalę wybranych krawędzi, Linii i Polilinii.

Narzędzie może być używane na obiektach 2D utworzonych za pomocą środowisk pracy Rysunek Roboczy lub Szkicownik, ale może być również używane dla wielu typów obiektów 3D, takich jak te utworzone za pomocą środowisk pracy Część, Projekt Części lub Architektura.

Skalowanie obiektu przy użyciu punktu środkowego.

Użycie

Zobacz także strony: Rysunek Roboczy: Przyciąganie i Rysunek Roboczy: Wiązania.

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

Opcje

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

Uwagi

Ustawienia

Zobacz także strony: Edytor ustawień oraz Rysunek Roboczy: Preferencje.

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

Tworzenie skryptów

Zobacz również stronę: Dokumentacja API generowana automatycznie oraz Podstawy pisania skryptów dla FreeCAD.

Do skalowania obiektów służy metoda scale środowiska Rysunek Roboczy.

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.

Przykład:

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