Std Placement/ru: Difference between revisions

From FreeCAD Documentation
(Created page with "==Применение==")
(Updating to match new version of source page)
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
<languages/>
<languages/>


{{Docnav
{{Docnav/ru
|[[Std_SendToPythonConsole|SendToPythonConsole]]
|[[Std_SendToPythonConsole/ru|Команда "Отправить в консоль Python"]]
|[[Std_TransformManip|TransformManip]]
|[[Std_TransformManip/ru|Команда "Преобразование"]]
|[[Std_Edit_Menu|Std Edit Menu]]
|[[Std_Edit_Menu/ru|Меню "Правка"]]
|IconL=Std_SendToPythonConsole.svg
|IconL=Std_SendToPythonConsole.svg
|IconR=Std_TransformManip.svg
|IconR=Std_TransformManip.svg
Line 10: Line 10:
}}
}}


<div class="mw-translate-fuzzy">
{{GuiCommand/ru
{{GuiCommand/ru
|Name/ru=Расположение
|Name=Std Placement
|Name/ru=Std Placement
|Name=Std_Placement
|MenuLocation=Правка → Размещение...‏‎
|MenuLocation=Правка → Расположение...
||Workbenches=All
|Workbenches=Все
|SeeAlso=[[Std_Alignment/ru|Std Alignment]], [[Tasks_Placement/ru|Tasks Placement]], [[Placement/ru|Placement]]
|SeeAlso=[[Std_Alignment/ru|Выравнивание]], [[Placement/ru|Расположение]]
}}
}}
</div>


<span id="Description"></span>
==Описание==
==Описание==


Line 27: Line 26:
{{Caption|The Placement task panel}}
{{Caption|The Placement task panel}}


<span id="Usage"></span>
==Применение==
==Применение==


Line 39: Line 39:
The dialog can also be launched by clicking on the ellipsis button {{Button|...}} that appears in the [[Property_editor|property editor]] when you click on the {{PropertyData|Placement}} property.
The dialog can also be launched by clicking on the ellipsis button {{Button|...}} that appears in the [[Property_editor|property editor]] when you click on the {{PropertyData|Placement}} property.


==Notes==
<span id="Notes"></span>
==Примечания==


* For more information about the placement parameters see the [[Placement|Placement]] page, and the [[Aeroplane|Aeroplane]] tutorial.
* For more information about the placement parameters see the [[Placement|Placement]] page, and the [[Aeroplane|Aeroplane]] tutorial.
* The rotation angle can be set in degrees in the GUI but is stored in radians internally so that angles usually have to be converted when used in scripts.


==Scripting==
==Scripting==


{{Emphasis|See also:}} [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].
{{Emphasis|Смотрите так же:}} [[FreeCAD_Scripting_Basics/ru|Основы составления скриптов в FreeCAD]].


See the [[Python_scripting_tutorial#Vectors_and_placements|Python scripting tutorial]].
See the [[Python_scripting_tutorial#Vectors_and_placements|Python scripting tutorial]].
Line 73: Line 75:


Move the base point of the object, then rotate the object 45 degrees around the X axis.
Move the base point of the object, then rotate the object 45 degrees around the X axis.

The math module supplies a method {{incode|radians()}} to easily convert degrees to radians and has to be imported at first.

{{Code|code=
{{Code|code=
import math
import math
Line 89: Line 94:




{{Docnav
{{Docnav/ru
|[[Std_SendToPythonConsole|SendToPythonConsole]]
|[[Std_SendToPythonConsole/ru|Команда "Отправить в консоль Python"]]
|[[Std_TransformManip|TransformManip]]
|[[Std_TransformManip/ru|Команда "Преобразование"]]
|[[Std_Edit_Menu|Std Edit Menu]]
|[[Std_Edit_Menu/ru|Меню "Правка"]]
|IconL=Std_SendToPythonConsole.svg
|IconL=Std_SendToPythonConsole.svg
|IconR=Std_TransformManip.svg
|IconR=Std_TransformManip.svg
Line 100: Line 105:
{{Std Base navi{{#translation:}}}}
{{Std Base navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Latest revision as of 10:01, 20 September 2023

Other languages:

Расположение

Системное название
Std_Placement
Расположение в меню
Правка → Расположение...
Верстаки
Все
Быстрые клавиши
Нет
Представлено в версии
-
См. также
Выравнивание, Расположение

Описание

The Std Placement command displays the Placement task panel for a selected object.

The Placement task panel

Применение

  1. Select a single object that has a ДанныеPlacement property in the property editor.
  2. Select the Edit → Placement... option from the menu.
  3. Change one or more of the translation and rotation parameters.
  4. Do one of the following:
    • Press the OK button to apply the changes and close the task panel.
    • Press the Apply button to apply the changes, but keep the task panel open for further changes.
  5. Press Esc or the Cancel button to abort the operation. This will undo any changes that have not been applied.

The dialog can also be launched by clicking on the ellipsis button ... that appears in the property editor when you click on the ДанныеPlacement property.

Примечания

  • For more information about the placement parameters see the Placement page, and the Aeroplane tutorial.
  • The rotation angle can be set in degrees in the GUI but is stored in radians internally so that angles usually have to be converted when used in scripts.

Scripting

Смотрите так же: Основы составления скриптов в FreeCAD.

See the Python scripting tutorial.

A placement is internally defined by a matrix; in many cases it is simpler to represent it by means of two components, a Base point (vector), and a Rotation value. The Rotation itself has different representations; it can be entirely defined by the value of a "quaternion" (xi + yj + zk + w), but it can also be described by a rotation Axis (unit vector) and a rotation Angle (radians).

import FreeCAD as App

doc = App.newDocument()
obj = doc.addObject("Part::Cylinder", "Cylinder")

print(obj.Placement)
# Placement [Pos=(0,0,0), Yaw-Pitch-Roll=(0,0,0)]
print(obj.Placement.Base)
# Vector (0.0, 0.0, 0.0)
print(obj.Placement.Rotation)
# Rotation (0.0, 0.0, 0.0, 1.0)

print(obj.Placement.Rotation.Angle)
# 0.0
print(obj.Placement.Rotation.Axis)
# Vector (0.0, 0.0, 1.0)
print(obj.Placement.Rotation.Q)
# (0.0, 0.0, 0.0, 1.0)

Move the base point of the object, then rotate the object 45 degrees around the X axis.

The math module supplies a method radians() to easily convert degrees to radians and has to be imported at first.

import math

obj.Placement.Base = App.Vector(5, 3, 1)
obj.Placement.Rotation.Axis = App.Vector(1, 0, 0)
obj.Placement.Rotation.Angle = math.radians(45)

print(obj.Placement)
# Placement [Pos=(5,3,1), Yaw-Pitch-Roll=(0,0,45)]
print(obj.Placement.Rotation.Q)
# (0.3826834323650898, 0.0, 0.0, 0.9238795325112867)
print(obj.Placement.Matrix)
# Matrix ((1,0,0,5),(0,0.707107,-0.707107,3),(0,0.707107,0.707107,1),(0,0,0,1))